Changeset 159 for trunk/templates/basic/includes/pages/gmap/gmap_js.tpl
- Timestamp:
- 03/16/2006 05:30:30 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/templates/basic/includes/pages/gmap/gmap_js.tpl
r131 r159 128 128 129 129 {literal} 130 131 function copy_obj(o) { 132 var c = new Object(); for (var e in o) { c[e] = o[e]; } return c; 133 } 134 130 135 function gmap_onload() { 131 136 ch_p2p = document.getElementsByName("p2p")[0]; … … 134 139 ch_unlinked = document.getElementsByName("unlinked")[0]; 135 140 if (GBrowserIsCompatible()) { 136 map = new GMap(document.getElementById("map")); 141 {/literal} 142 {foreach from=$maps_available item=map_enabled key=map_name} 143 {if $map_enabled===true} 144 {if $map_types != null} 145 {assign var=map_types value="`$map_types`,"} 146 {/if} 147 {assign var=map_types value="`$map_types` G_`$map_name`_TYPE"} 148 {/if} 149 {/foreach} 150 {foreach from=$maps_available.custom_maps item=custom_type} 151 {if $custom_type.coordinates_type == "map"} 152 G_CUSTOM_{$custom_type.name|upper}_TYPE = copy_obj(G_MAP_TYPE); 153 {elseif $custom_type.coordinates_type == "satellite"} 154 G_CUSTOM_{$custom_type.name|upper}_TYPE = copy_obj(G_SATELLITE_TYPE); 155 {/if} 156 G_CUSTOM_{$custom_type.name|upper}_TYPE.baseUrls = new Array(); 157 G_CUSTOM_{$custom_type.name|upper}_TYPE.baseUrls[0] = "{$custom_type.url}"; 158 G_CUSTOM_{$custom_type.name|upper}_TYPE.lowResBaseUrls = new Array(); 159 G_CUSTOM_{$custom_type.name|upper}_TYPE.lowResBaseUrls[0] = "{$custom_type.url}"; 160 {literal} 161 G_CUSTOM_{/literal}{$custom_type.name|upper}{literal}_TYPE.getLinkText = function() { return '{/literal}{$custom_type.name}{literal}'; } 162 {/literal} 163 {if $map_types != null} 164 {assign var=map_types value="`$map_types`,"} 165 {/if} 166 {assign var=map_types value="`$map_types` G_CUSTOM_`$custom_type.name`_TYPE"} 167 {/foreach} 168 {literal} 169 var map_types = [{/literal}{$map_types|upper}{literal}]; 170 map = new GMap(document.getElementById("map"), map_types); 171 172 if(map_types.length > 1) 173 map.addControl(new GMapTypeControl()); 174 175 map.setMapType(G_CUSTOM_{/literal}{$maps_available.default|upper}{literal}_TYPE); 176 137 177 var center = new GPoint({/literal}{$center_longitude}{literal}, 138 178 {/literal}{$center_latitude}{literal}); … … 148 188 map.centerAndZoom(center, zoom); 149 189 map.addControl(new GLargeMapControl()); 150 map.setMapType(G_SATELLITE_TYPE);151 190 GEvent.addListener(map, "moveend", gmap_reload); 152 191 GEvent.addListener(map, "zoom",
Note: See TracChangeset
for help on using the changeset viewer.
