Changeset 955 for trunk/templates
- Timestamp:
- 03/20/07 12:10:39 (20 months ago)
- Files:
-
- 1 modified
-
trunk/templates/map_index.tt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/templates/map_index.tt
r872 r955 1 [% INCLUDE header.tt page_title = "Map of all nodes" %]1 [% INCLUDE header.tt page_title = criterion.name || "Map of all nodes" %] 2 2 [% INCLUDE banner.tt %] 3 3 <div id="content"> … … 30 30 map.addControl(new GMapTypeControl()); 31 31 map.centerAndZoom(new GPoint([% IF long %][% long %][% ELSE %][% centre_long %][% END %],[% IF lat %][% lat %][% ELSE %][% centre_lat %][% END %]), [% IF zoom %][% zoom %][% ELSE %][% default_gmaps_zoom %][% END %]); 32 [% IF map_type == "satellite" %] 33 map.setMapType( G_SATELLITE_TYPE ); 34 [% ELSIF map_type == "hybrid" %] 35 map.setMapType( G_HYBRID_TYPE ); 36 [% END %] 32 37 33 38 [% i = 0 %] … … 50 55 [% END %] 51 56 [% END %] 52 function map_ recenter() {57 function map_change() { 53 58 var center = map.getCenterLatLng(); 54 59 var link = document.getElementById('permalink'); 55 60 var zoom = map.getZoomLevel(); 56 link.href = "?action=index;format=map;long="+center.x+";lat="+center.y+";zoom="+zoom; 61 var type = map.getCurrentMapType(); 62 var map_type; 63 if ( type == G_SATELLITE_TYPE ) { 64 map_type = "satellite"; 65 } else if ( type == G_HYBRID_TYPE ) { 66 map_type = "hybrid"; 67 } else { 68 map_type = ""; 57 69 } 58 GEvent.addListener(map, "moveend", map_recenter ); 70 link.href = "?action=index;format=map;long="+center.x+";lat="+center.y+";zoom="+zoom+";map_type="+map_type[% IF criterion.type %][% IF criterion.value %]+";index_type="+encodeURIComponent("[% criterion.type %]")+";index_value="+encodeURIComponent("[% criterion.value %]")[% END %][% END %]; 71 } 72 GEvent.addListener(map, "moveend", map_change ); 73 GEvent.addListener(map, "maptypechanged", map_change ); 59 74 //]]> 60 75 </script>
