Changeset 287 for Products.ATGoogleMaps/trunk/Products/ATGoogleMaps/skins/ATGoogleMaps/atgooglemaps.js.dtml
- Timestamp:
- 03/04/10 03:54:44 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Products.ATGoogleMaps/trunk/Products/ATGoogleMaps/skins/ATGoogleMaps/atgooglemaps.js.dtml
r285 r287 33 33 var visibleInfoWindow = null; 34 34 35 function createMarker(map, lat, lng, marker_id, title ) {35 function createMarker(map, lat, lng, marker_id, title, draggable) { 36 36 var shape = { 37 37 coord: <dtml-var "gmap_properties.icon_shape">, … … 51 51 </dtml-with> 52 52 53 if (draggable == null) { 54 draggable = false; 55 } 53 56 var marker = new google.maps.Marker({ 54 57 position: new google.maps.LatLng(lat, lng), … … 57 60 icon: icon, 58 61 shadow: shadow, 59 shape: shape 62 shape: shape, 63 draggable: draggable 60 64 }); 61 65 62 var content = document.getElementById('infowindow_html_' + marker_id).innerHTML; 63 var infoWindow = new google.maps.InfoWindow({ 64 content: content 65 }); 66 if (marker_id) { 67 var content = document.getElementById('infowindow_html_' + marker_id).innerHTML; 68 var infoWindow = new google.maps.InfoWindow({ 69 content: content 70 }); 71 google.maps.event.addListener(marker, 'click', function() { 72 if (visibleInfoWindow) { 73 visibleInfoWindow.close(); 74 } 75 infoWindow.open(map, marker); 76 visibleInfoWindow = infoWindow; 77 }); 66 78 67 google.maps.event.addListener(marker, 'click', function() { 68 if (visibleInfoWindow) { 69 visibleInfoWindow.close(); 70 } 71 infoWindow.open(map, marker); 72 visibleInfoWindow = infoWindow; 73 }); 74 75 var link = document.getElementById("infowindow_link_" + marker_id); 76 link.onclick = function() { 77 google.maps.event.trigger(marker, "click"); 78 }; 79 var link = document.getElementById("infowindow_link_" + marker_id); 80 link.onclick = function() { 81 google.maps.event.trigger(marker, "click"); 82 }; 83 } 79 84 80 85 return marker;
Note: See TracChangeset
for help on using the changeset viewer.
