1 var toolserver = 'http://toolserver.org/~kolossos/openlayers/kml-on-ol.php';
\r
2 var startTag = '<iframe class="osmFrame" style="width: 100%; height: 350px; clear: both;" src="'+ toolserver + '?lang=de&uselang=de&params=';
\r
3 var endTag = '"></iframe>';
\r
5 // @TODO document.ready() does not work for ajax loaded content
\r
6 jQuery(document).ready(function($) {
\r
7 $('.wall-item-content-wrapper').each(function(index) {
\r
8 var link = $(this).find('.wall-item-location .OSMMapLink');
\r
9 link.toggle(addIframe, removeIframe);
\r
13 function addIframe(ev) {
\r
14 var coordinate = $(ev.target).attr('title');
\r
15 var newTag = startTag + convertCoordinateString(coordinate) + endTag;
\r
16 $(ev.target).parents('.wall-item-content-wrapper').append(newTag);
\r
19 function removeIframe(ev) {
\r
20 $(ev.target).parents('.wall-item-content-wrapper').find('iframe').remove();
\r
23 function convertCoordinateString(coordinate) {
\r
24 var locstring = coordinate.split(' ');
\r
28 if (locstring[0] < 0) {
\r
33 if (locstring[1] < 0) {
\r
38 return Math.abs(locstring[0]) + northSouth + Math.abs(locstring[1]) + westEast;
\r