Changeset 25922 for extensions
- Timestamp:
- Dec 10, 2013, 10:17:07 PM (10 years ago)
- Location:
- extensions/rv_gmaps/trunk
- Files:
-
- 4 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/rv_gmaps/trunk/map.php
r23083 r25922 54 54 rvm_build_section_items($img_fields, null, RVM_BUILD_AGGREGATE); 55 55 //var_export( $page['items'] ); 56 if ( count($page['items']) )56 if ( isset($page['items'][0]['s']) ) 57 57 $template->assign('initial_bounds', $page['items'][0] ); 58 58 unset( $page['items'] ); -
extensions/rv_gmaps/trunk/template/map.tpl
r25834 r25922 25 25 <![endif]--> 26 26 27 <script type="text/javascript"> {literal}27 <script type="text/javascript"> 28 28 //<![CDATA[ 29 29 var map; 30 30 31 31 document.is_debug = false; 32 if ( document.location.search.match(/[\?&]debug/) ) {32 if ( document.location.search.match(/[\?&]debug/) ) 33 33 document.is_debug = true; 34 }35 34 36 35 function glog(msg) { 37 if (console) 38 { 36 if (console) { 39 37 var b = map.getBounds(); 40 38 if (b) … … 52 50 { 53 51 var mapOptions = { 54 mapTypeId: google.maps.MapTypeId.{ /literal}{$MAP_TYPE}{literal},52 mapTypeId: google.maps.MapTypeId.{$MAP_TYPE}, 55 53 overviewMapControl: true, 56 overviewMapControlOptions: { opened: document.documentElement.offsetWidth>640}54 overviewMapControlOptions: { opened: document.documentElement.offsetWidth>640} 57 55 } 58 56 59 57 if (!PageLinker.url2Map(mapOptions)) 60 58 { 61 {/literal}62 59 {if isset($initial_bounds)} 63 60 mapOptions.iniBounds = new google.maps.LatLngBounds( new google.maps.LatLng({$initial_bounds.s},{$initial_bounds.w}), new google.maps.LatLng({$initial_bounds.n},{$initial_bounds.e}) ); … … 67 64 mapOptions.zoom = 2; 68 65 {/if} 69 {literal}70 66 } 71 67 … … 75 71 map.fitBounds(mapOptions.iniBounds); 76 72 77 if (document.is_debug) 78 { 79 google.maps.event.addListener(map, "idle", function() { glog("idle"); }); 80 google.maps.event.addListener(map, "bounds_changed", function() { glog("bounds_changed");} ); 81 google.maps.event.addListener(map, "center_changed", function() { glog("center_changed");} ); 82 google.maps.event.addListener(map, "maptypeid_changed", function() { glog("maptypeid_changed");} ); 83 google.maps.event.addListener(map, "zoom_changed", function() { glog("zoom_changed");} ); 84 google.maps.event.addListener(map, "drag", function() { glog("drag");} ); 85 } 86 73 {if isset($smarty.get.debug)} 74 google.maps.event.addListener(map, "idle", function() { glog("idle"); }); 75 google.maps.event.addListener(map, "bounds_changed", function() { glog("bounds_changed");} ); 76 google.maps.event.addListener(map, "center_changed", function() { glog("center_changed");} ); 77 google.maps.event.addListener(map, "maptypeid_changed", function() { glog("maptypeid_changed");} ); 78 google.maps.event.addListener(map, "zoom_changed", function() { glog("zoom_changed");} ); 79 google.maps.event.addListener(map, "drag", function() { glog("drag");} ); 80 {/if} 87 81 pwgPageLinker = new PageLinker(map, "aLinkToThisPage" ); 88 82 89 var pwgStyler = { /literal}{$MAP_MARKER_ICON_JS}{literal};83 var pwgStyler = {$MAP_MARKER_ICON_JS}; 90 84 91 map.pwgDataLoader = new PwgDataLoader(map, { rectangle_of_confusion: pwgStyler.roc} );85 map.pwgDataLoader = new PwgDataLoader(map, { rectangle_of_confusion: pwgStyler.roc} ); 92 86 google.maps.event.addListener(map.pwgDataLoader, "dataloading", function() { 93 var pre = '<img src="{ /literal}{$PLUGIN_ROOT_URL}{literal}/icons/progress_s.gif" width="16" height="16" alt="~"> ';87 var pre = '<img src="{$PLUGIN_ROOT_URL}/icons/progress_s.gif" width="16" height="16" alt="~"> '; 94 88 document.getElementById("dataLoadStatus").innerHTML = pre + Localization.get("Loading"); 95 89 } … … 101 95 ); 102 96 103 map.pwgDataHandler = new PwgDataHandler(map, { styler: pwgStyler, show_all_img_src: "{/literal}{$PLUGIN_ROOT_URL}{literal}/icons/pic_s.gif" } );97 map.pwgDataHandler = new PwgDataHandler(map, { styler: pwgStyler, show_all_img_src: "{$PLUGIN_ROOT_URL}/icons/pic_s.gif" } ); 104 98 google.maps.event.addListener(map.pwgDataLoader, "dataloaded", pwgBind(map.pwgDataHandler, map.pwgDataHandler.handle) ); 105 99 106 map.pwgDataLoader.start( "{ /literal}{$U_MAP_DATA}{literal}" );100 map.pwgDataLoader.start( "{$U_MAP_DATA}" ); 107 101 108 102 positionMap(); … … 134 128 { 135 129 _strings: { 136 {/literal}137 130 "go to %s": "{'go to %s'|@translate|@escape:javascript}", 138 131 "Next": "{'Next'|@translate|@escape:javascript}", … … 146 139 "opens %s in Google Earth" : "{'opens %s in Google Earth'|@translate|@escape:javascript}", 147 140 "%d photos" : "{'%d photos'|@translate|@escape:javascript}", 148 {literal}149 141 dontMindTheComma: "" 150 142 }, … … 172 164 } 173 165 } 174 {/literal}175 166 //]]> 176 167 </script> … … 188 179 <a id="aLinkToThisPage" href="" class="gmnoprint"><img src="//maps.google.com/mapfiles/bar_icon_link.gif" alt="<->" width="16" height="16"><span class="hideable"> {'Link to this page'|@translate}</span></a> 189 180 <a id="aBlowup" href="" onclick="return PwgDataHandler.blowupUrl(this.href);" class="gmnoprint" title="{'show all photos around this location'|@translate}"> 190 <img src="{$PLUGIN_ROOT_URL}/icons/pic_s.gif" alt="" title="{'show all photos around this location'|@translate}">181 <img src="{$PLUGIN_ROOT_URL}/icons/pic_s.gif" width="16" height="16" alt="" title="{'show all photos around this location'|@translate}"> 191 182 <span>{'Show all'|@translate}</span> 192 183 </a>
Note: See TracChangeset
for help on using the changeset viewer.