<div dir="ltr">OK. Well I think I meet the criteria. Same protocol, same host, same port. But I can get as far as the iframe Document. From there, whatever I try to do to access the map element doesn't seem to work. Any advice?<br>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/12/19 Christian Wygoda <span dir="ltr"><<a href="mailto:christian.wygoda@wheregroup.com" target="_blank">christian.wygoda@wheregroup.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
if your main document and the iframe document fulfill the browser's same<br>
origin policy, you're set to go, if not, expect trouble.<br>
<br>
See<br>
<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Same_origin_policy_for_JavaScript" target="_blank">https://developer.mozilla.org/en-US/docs/Web/JavaScript/Same_origin_policy_for_JavaScript</a> for an explanation.<br>
<br>
Cheers,<br>
Christian<br>
<div class="HOEnZb"><div class="h5"><br>
On Thu, 2013-12-19 at 09:30 +0200, Geoset Ltd wrote:<br>
> Thanks a lot! But what do you mean at the end "If the iframe and main<br>
> document target different origins" ? The src of the iframe doesn't<br>
> point to another html page. It points to the map itself. The link is<br>
> the one of the Mapbender application.<br>
><br>
><br>
><br>
> 2013/12/18 Christian Wygoda <<a href="mailto:christian.wygoda@wheregroup.com">christian.wygoda@wheregroup.com</a>><br>
> Hi,<br>
><br>
> you will need to gain access to the iframe's window object and<br>
> from<br>
> there use that window's jQuery object to gain access to the<br>
> map like so:<br>
><br>
> // Code untested, so here be dragons:<br>
><br>
> var iframe = $('iframe').get(0);<br>
> var iwindow = iframe.contentWindow || iframe;<br>
> var mapDiv = iwindow.$('.mb-element-map')<br>
> var olMap = mapDiv.data('mapbenderMbMap').map.olMap;<br>
><br>
> Then, add a click listener to mapDiv and use the olMap to<br>
> convert the<br>
> viewport click position to world coordinates. See the<br>
> OpenLayer Map API<br>
> docs for that.<br>
><br>
> If the iframe and main document target different origins, you<br>
> will<br>
> probably have trouble accessing them from each other in<br>
> JavaScript<br>
> though.<br>
><br>
> Cheers,<br>
> Christian<br>
><br>
><br>
> On Tue, 2013-12-17 at 13:35 +0200, Geoset Ltd wrote:<br>
> > I'm using mapbender3<br>
> ><br>
> ><br>
> ><br>
> > 2013/12/17 Armin Retterath <<a href="mailto:armin.retterath@gmail.com">armin.retterath@gmail.com</a>><br>
> > sorry - do you use mapbender3 or mapbender2?<br>
> ><br>
> ><br>
> ><br>
> ><br>
> > 2013/12/17 Geoset Ltd <<a href="mailto:gsetit@gmail.com">gsetit@gmail.com</a>><br>
> > Hello. I have a web application and in it,<br>
> an iframe<br>
> > with a Mapbender map. Is there a way to get<br>
> the<br>
> > coordinates of a point when I click on it on<br>
> the map?<br>
> > I want to use these coordinates in my web<br>
> app.<br>
> ><br>
> > Thanks.<br>
> ><br>
> ><br>
> ><br>
> ><br>
> _______________________________________________<br>
> > Mapbender_users mailing list<br>
> > <a href="mailto:Mapbender_users@lists.osgeo.org">Mapbender_users@lists.osgeo.org</a><br>
> ><br>
> <a href="http://lists.osgeo.org/mailman/listinfo/mapbender_users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapbender_users</a><br>
> ><br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > Mapbender_users mailing list<br>
> > <a href="mailto:Mapbender_users@lists.osgeo.org">Mapbender_users@lists.osgeo.org</a><br>
> ><br>
> <a href="http://lists.osgeo.org/mailman/listinfo/mapbender_users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapbender_users</a><br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > Mapbender_users mailing list<br>
> > <a href="mailto:Mapbender_users@lists.osgeo.org">Mapbender_users@lists.osgeo.org</a><br>
> > <a href="http://lists.osgeo.org/mailman/listinfo/mapbender_users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapbender_users</a><br>
><br>
><br>
> --<br>
> ********************************************<br>
> Where2B Konferenz 2013<br>
> 12. Dezember 2013 in Bonn<br>
> <a href="http://www.where2b-conference.com" target="_blank">www.where2b-conference.com</a><br>
> ********************************************<br>
> --------------------------------------------<br>
> WhereGroup GmbH & Co. KG<br>
> Eifelstraße 7<br>
> 53119 Bonn<br>
> Germany<br>
><br>
> Christian Wygoda<br>
> Anwendungsentwickler<br>
><br>
> Fon: <a href="tel:%2B49%20%280%29228%20%2F%2090%2090%2038%20-%2015" value="+4922890903815">+49 (0)228 / 90 90 38 - 15</a><br>
> Fax: <a href="tel:%2B49%20%280%29228%20%2F%2090%2090%2038%20-%2011" value="+4922890903811">+49 (0)228 / 90 90 38 - 11</a><br>
><br>
> <a href="mailto:info@wheregroup.com">info@wheregroup.com</a><br>
> <a href="http://www.wheregroup.com" target="_blank">www.wheregroup.com</a><br>
> Amtsgericht Bonn, HRA 6788<br>
> --------------------------------------------<br>
> Komplementärin:<br>
> WhereGroup Verwaltungs GmbH<br>
> vertreten durch:<br>
> Olaf Knopp, Peter Stamm<br>
> --------------------------------------------<br>
><br>
> _______________________________________________<br>
> Mapbender_users mailing list<br>
> <a href="mailto:Mapbender_users@lists.osgeo.org">Mapbender_users@lists.osgeo.org</a><br>
> <a href="http://lists.osgeo.org/mailman/listinfo/mapbender_users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapbender_users</a><br>
><br>
><br>
> _______________________________________________<br>
> Mapbender_users mailing list<br>
> <a href="mailto:Mapbender_users@lists.osgeo.org">Mapbender_users@lists.osgeo.org</a><br>
> <a href="http://lists.osgeo.org/mailman/listinfo/mapbender_users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapbender_users</a><br>
<br>
--<br>
********************************************<br>
Where2B Konferenz 2013<br>
12. Dezember 2013 in Bonn<br>
<a href="http://www.where2b-conference.com" target="_blank">www.where2b-conference.com</a><br>
********************************************<br>
--------------------------------------------<br>
WhereGroup GmbH & Co. KG<br>
Eifelstraße 7<br>
53119 Bonn<br>
Germany<br>
<br>
Christian Wygoda<br>
Anwendungsentwickler<br>
<br>
Fon: <a href="tel:%2B49%20%280%29228%20%2F%2090%2090%2038%20-%2015" value="+4922890903815">+49 (0)228 / 90 90 38 - 15</a><br>
Fax: <a href="tel:%2B49%20%280%29228%20%2F%2090%2090%2038%20-%2011" value="+4922890903811">+49 (0)228 / 90 90 38 - 11</a><br>
<br>
<a href="mailto:info@wheregroup.com">info@wheregroup.com</a><br>
<a href="http://www.wheregroup.com" target="_blank">www.wheregroup.com</a><br>
Amtsgericht Bonn, HRA 6788<br>
--------------------------------------------<br>
Komplementärin:<br>
WhereGroup Verwaltungs GmbH<br>
vertreten durch:<br>
Olaf Knopp, Peter Stamm<br>
--------------------------------------------<br>
<br>
_______________________________________________<br>
Mapbender_users mailing list<br>
<a href="mailto:Mapbender_users@lists.osgeo.org">Mapbender_users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapbender_users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapbender_users</a></div></div></blockquote></div><br></div>