Index: trunk/extensions/Maps/GoogleMaps3/Maps_GoogleMaps3DispPoint.php |
— | — | @@ -29,10 +29,10 @@ |
30 | 30 | * |
31 | 31 | */ |
32 | 32 | protected function setMapSettings() { |
33 | | - global $egMapsGoogleMaps3Zoom, $egMapsGoogleMaps3Prefix; |
| 33 | + global $egMapsGMaps3Zoom, $egMapsGMaps3Prefix; |
34 | 34 | |
35 | | - $this->elementNamePrefix = $egMapsGoogleMaps3Prefix; |
36 | | - $this->defaultZoom = $egMapsGoogleMaps3Zoom; |
| 35 | + $this->elementNamePrefix = $egMapsGMaps3Prefix; |
| 36 | + $this->defaultZoom = $egMapsGMaps3Zoom; |
37 | 37 | |
38 | 38 | $this->markerStringFormat = ''; // TODO |
39 | 39 | |
— | — | @@ -45,12 +45,12 @@ |
46 | 46 | * |
47 | 47 | */ |
48 | 48 | protected function doMapServiceLoad() { |
49 | | - global $egGoogleMaps3OnThisPage; |
| 49 | + global $egGMaps3OnThisPage; |
50 | 50 | |
51 | 51 | MapsGoogleMaps3::addGMap3Dependencies($this->output); |
52 | | - $egGoogleMaps3OnThisPage++; |
| 52 | + $egGMaps3OnThisPage++; |
53 | 53 | |
54 | | - $this->elementNr = $egGoogleMaps3OnThisPage; |
| 54 | + $this->elementNr = $egGMaps3OnThisPage; |
55 | 55 | } |
56 | 56 | |
57 | 57 | /** |
— | — | @@ -62,7 +62,18 @@ |
63 | 63 | |
64 | 64 | // TODO |
65 | 65 | $this->output .=<<<END |
66 | | - |
| 66 | +<div id="$this->mapName" style="width:{$this->width}px; height:{$this->height}px"></div> |
| 67 | +<script type="$wgJsMimeType"> /*<![CDATA[*/ |
| 68 | +addOnloadHook( |
| 69 | + initGMap3("$this->mapName", { |
| 70 | + zoom: $this->zoom, |
| 71 | + lat: $this->centre_lat, |
| 72 | + lon: $this->centre_lon, |
| 73 | + }, |
| 74 | + [] |
| 75 | + ) |
| 76 | +); |
| 77 | +/*]]>*/ </script> |
67 | 78 | END; |
68 | 79 | |
69 | 80 | } |
Index: trunk/extensions/Maps/GoogleMaps3/GoogleMap3Functions.js |
— | — | @@ -7,4 +7,14 @@ |
8 | 8 | * @author Jeroen De Dauw |
9 | 9 | */ |
10 | 10 | |
11 | | -// TODO |
\ No newline at end of file |
| 11 | +/** |
| 12 | + * Created a new Map object with the provided properties and markers. |
| 13 | + */ |
| 14 | +function initGMap3(name, options, markers) { |
| 15 | + options.center = new google.maps.LatLng(options.lat, options.lon); |
| 16 | + |
| 17 | + var map = new google.maps.Map(document.getElementById(name), options); |
| 18 | + |
| 19 | + map.mapTypes = options.types; |
| 20 | + map.setMapTypeId(options.type); |
| 21 | +} |
\ No newline at end of file |
Index: trunk/extensions/Maps/GoogleMaps3/Maps_GoogleMaps3DispMap.php |
— | — | @@ -29,10 +29,10 @@ |
30 | 30 | * |
31 | 31 | */ |
32 | 32 | protected function setMapSettings() { |
33 | | - global $egMapsGoogleMaps3Zoom, $egMapsGoogleMaps3Prefix; |
| 33 | + global $egMapsGMaps3Zoom, $egMapsGMaps3Prefix; |
34 | 34 | |
35 | | - $this->elementNamePrefix = $egMapsGoogleMaps3Prefix; |
36 | | - $this->defaultZoom = $egMapsGoogleMaps3Zoom; |
| 35 | + $this->elementNamePrefix = $egMapsGMaps3Prefix; |
| 36 | + $this->defaultZoom = $egMapsGMaps3Zoom; |
37 | 37 | |
38 | 38 | $this->spesificParameters = array( |
39 | 39 | ); |
— | — | @@ -41,39 +41,38 @@ |
42 | 42 | /** |
43 | 43 | * @see MapsBaseMap::doMapServiceLoad() |
44 | 44 | * |
45 | | - */ |
| 45 | + */ |
46 | 46 | protected function doMapServiceLoad() { |
47 | | - global $egGoogleMaps3OnThisPage; |
| 47 | + global $egGMaps3OnThisPage; |
48 | 48 | |
49 | 49 | MapsGoogleMaps3::addGMap3Dependencies($this->output); |
50 | | - $egGoogleMaps3OnThisPage++; |
| 50 | + $egGMaps3OnThisPage++; |
51 | 51 | |
52 | | - $this->elementNr = $egGoogleMaps3OnThisPage; |
| 52 | + $this->elementNr = $egGMaps3OnThisPage; |
53 | 53 | } |
54 | 54 | |
55 | 55 | /** |
56 | 56 | * @see MapsBaseMap::addSpecificMapHTML() |
57 | 57 | * |
58 | | - */ |
| 58 | + */ |
59 | 59 | public function addSpecificMapHTML() { |
60 | 60 | global $wgJsMimeType; |
61 | 61 | |
62 | 62 | $this->output .=<<<END |
63 | | - |
64 | | -<div id="$this->mapName" class="$this->class" style="$this->style" ></div> |
| 63 | +<div id="$this->mapName" style="width:{$this->width}px; height:{$this->height}px"></div> |
65 | 64 | <script type="$wgJsMimeType"> /*<![CDATA[*/ |
66 | 65 | addOnloadHook( |
67 | | - function() { |
68 | | - var latlng = new google.maps.LatLng(-34.397, 150.644); |
69 | | - var myOptions = { |
70 | | - zoom: 8, |
71 | | - center: latlng, |
72 | | - mapTypeId: google.maps.MapTypeId.ROADMAP |
73 | | - }; |
74 | | - var map = new google.maps.Map(document.getElementById("$this->mapName"), myOptions); |
| 66 | + initGMap3("$this->mapName", { |
| 67 | + zoom: $this->zoom, |
| 68 | + lat: $this->centre_lat, |
| 69 | + lon: $this->centre_lon, |
| 70 | + types: [$this->types], |
| 71 | + type: $this->type, |
| 72 | + }, |
| 73 | + [] |
| 74 | + ) |
75 | 75 | ); |
76 | 76 | /*]]>*/ </script> |
77 | | - |
78 | 77 | END; |
79 | 78 | |
80 | 79 | } |
Index: trunk/extensions/Maps/GoogleMaps3/Maps_GoogleMaps3.php |
— | — | @@ -44,26 +44,89 @@ |
45 | 45 | |
46 | 46 | public static function initialize() { |
47 | 47 | self::initializeParams(); |
| 48 | + Validator::addOutputFormat('gmap3type', array('MapsGoogleMaps3', 'setGMapType')); |
| 49 | + Validator::addOutputFormat('gmap3types', array('MapsGoogleMaps3', 'setGMapTypes')); |
48 | 50 | } |
49 | 51 | |
50 | 52 | private static function initializeParams() { |
51 | | - global $egMapsServices; |
| 53 | + global $egMapsServices, $egMapsGMaps3Type, $egMapsGMaps3Types; |
52 | 54 | |
| 55 | + $allowedTypes = self::getTypeNames(); |
| 56 | + |
53 | 57 | $egMapsServices[self::SERVICE_NAME]['parameters'] = array( |
| 58 | + 'type' => array( |
| 59 | + 'aliases' => array('map-type', 'map type'), |
| 60 | + 'criteria' => array( |
| 61 | + 'in_array' => $allowedTypes |
| 62 | + ), |
| 63 | + 'default' => $egMapsGMaps3Type, // FIXME: default value should not be used when not present in types parameter. |
| 64 | + 'output-type' => 'gmap3type' |
| 65 | + ), |
| 66 | + 'types' => array( |
| 67 | + 'type' => array('string', 'list'), |
| 68 | + 'aliases' => array('map-types', 'map types'), |
| 69 | + 'criteria' => array( |
| 70 | + 'in_array' => $allowedTypes |
| 71 | + ), |
| 72 | + 'default' => $egMapsGMaps3Types, |
| 73 | + 'output-types' => array('gmap3types', 'list') |
| 74 | + ), |
54 | 75 | ); |
55 | 76 | } |
56 | 77 | |
| 78 | + private static $mapTypes = array( |
| 79 | + 'normal' => 'ROADMAP', |
| 80 | + 'roadmap' => 'ROADMAP', |
| 81 | + 'satellite' => 'SATELLITE', |
| 82 | + 'hybrid' => 'HYBRID', |
| 83 | + 'terrain' => 'TERRAIN', |
| 84 | + 'physical' => 'TERRAIN' |
| 85 | + ); |
| 86 | + |
57 | 87 | /** |
| 88 | + * Returns the names of all supported map types. |
| 89 | + * |
| 90 | + * @return array |
| 91 | + */ |
| 92 | + public static function getTypeNames() { |
| 93 | + return array_keys(self::$mapTypes); |
| 94 | + } |
| 95 | + |
| 96 | + /** |
| 97 | + * Changes the map type name into the corresponding Google Maps API v3 identifier. |
| 98 | + * |
| 99 | + * @param string $type |
| 100 | + * |
| 101 | + * @return string |
| 102 | + */ |
| 103 | + public static function setGMapType(&$type) { |
| 104 | + $type = 'google.maps.MapTypeId.' . self::$mapTypes[ $type ]; |
| 105 | + } |
| 106 | + |
| 107 | + /** |
| 108 | + * Changes the map type names into the corresponding Google Maps API v3 identifiers. |
| 109 | + * |
| 110 | + * @param array $types |
| 111 | + * |
| 112 | + * @return array |
| 113 | + */ |
| 114 | + public static function setGMapTypes(array &$types) { |
| 115 | + for($i = count($types) - 1; $i >= 0; $i--) { |
| 116 | + self::setGMapType($types[$i]); |
| 117 | + } |
| 118 | + } |
| 119 | + |
| 120 | + /** |
58 | 121 | * Add references to the Google Maps API v3 and required JS file to the provided output |
59 | 122 | * |
60 | 123 | * @param string $output |
61 | 124 | */ |
62 | 125 | public static function addGMap3Dependencies(&$output) { |
63 | 126 | global $wgJsMimeType, $wgLang; |
64 | | - global $egMapsScriptPath, $egGoogleMaps3OnThisPage, $egMapsStyleVersion; |
| 127 | + global $egMapsScriptPath, $egGMaps3OnThisPage, $egMapsStyleVersion; |
65 | 128 | |
66 | | - if (empty($egGoogleMaps3OnThisPage)) { |
67 | | - $egGoogleMaps3OnThisPage = 0; |
| 129 | + if (empty($egGMaps3OnThisPage)) { |
| 130 | + $egGMaps3OnThisPage = 0; |
68 | 131 | |
69 | 132 | $output .= "<script type='$wgJsMimeType' src='http://maps.google.com/maps/api/js?sensor=false&language={$wgLang->getCode()}'></script><script type='$wgJsMimeType' src='$egMapsScriptPath/GoogleMaps3/GoogleMap3Functions.js?$egMapsStyleVersion'></script>"; |
70 | 133 | } |
Index: trunk/extensions/Maps/GoogleMaps/GoogleMapFunctions.min.js |
— | — | @@ -1 +1,12 @@ |
2 | | -var GOverlays=[new GLayer("com.panoramio.all"),new GLayer("com.youtube.all"),new GLayer("org.wikipedia.en"),new GLayer("com.google.webcams")];function createGMarker(point,title,label,icon){var marker;if(icon!=''){var iconObj=new GIcon(G_DEFAULT_ICON);iconObj.image=icon;marker=new GMarker(point,{icon:iconObj});}else{marker=new GMarker(point);}if((title+label).length>0){var bothTxtAreSet=title.length>0&&label.length>0;var popupText=bothTxtAreSet?'<b>'+title+'</b><hr />'+label:title+label;popupText='<div style="overflow:auto;max-height:150px;">'+popupText+'</div>';GEvent.addListener(marker,'click',function(){marker.openInfoWindowHtml(popupText,{maxWidth:350});});}return marker;}function initializeGoogleMap(mapName,mapOptions,markers){if(GBrowserIsCompatible()){mapOptions.centre=(mapOptions.lat!=null&&mapOptions.lon!=null)?new GLatLng(mapOptions.lat,mapOptions.lon):null;mapOptions.size=new GSize(mapOptions.width,mapOptions.height);return createGoogleMap(mapName,mapOptions,markers);}else{return false;}}function createGoogleMap(mapName,mapOptions,markers){var mapElement=document.getElementById(mapName);var typesContainType=false;for(var i=0;i<mapOptions.types.length;i++){if(mapOptions.types[i]==mapOptions.type)typesContainType=true;}if(!typesContainType)mapOptions.types.push(mapOptions.type);var map=new GMap2(mapElement,{size:mapOptions.size,mapTypes:mapOptions.types});map.name=mapName;map.setMapType(mapOptions.type);for(i in mapOptions.controls){if(mapOptions.controls[i].toLowerCase()=='auto'){if(mapOptions.height>75)mapOptions.controls[i]=mapOptions.height>320?'large':'small';}switch(mapOptions.controls[i]){case'large':map.addControl(new GLargeMapControl3D());break;case'small':map.addControl(new GSmallZoomControl3D());break;case'large-original':map.addControl(new GLargeMapControl());break;case'small-original':map.addControl(new GSmallMapControl());break;case'zoom':map.addControl(new GSmallZoomControl());break;case'type':map.addControl(new GMapTypeControl());break;case'type-menu':map.addControl(new GMenuMapTypeControl());break;case'overlays':map.addControl(new MoreControl());break;case'overview':case'overview-map':map.addControl(new GOverviewMapControl());break;case'scale':map.addControl(new GScaleControl());break;case'nav-label':case'nav':map.addControl(new GNavLabelControl());break;}}var bounds=((mapOptions.zoom==null||mapOptions.centre==null)&&markers.length>1)?new GLatLngBounds():null;for(i in markers){var marker=markers[i];map.addOverlay(createGMarker(marker.point,marker.title,marker.label,marker.icon));if(bounds!=null)bounds.extend(marker.point);}if(bounds!=null){map.setCenter(bounds.getCenter(),map.getBoundsZoomLevel(bounds));}if(mapOptions.centre!=null)map.setCenter(mapOptions.centre);if(mapOptions.zoom!=null)map.setZoom(mapOptions.zoom);if(mapOptions.scrollWheelZoom)map.enableScrollWheelZoom();map.enableContinuousZoom();if(!window.GMaps)window.GMaps=new Object;eval("window.GMaps."+mapName+" = map;");return map;}function getGMarkerData(lat,lon,title,label,icon){return{point:new GLatLng(lat,lon),title:title,label:label,icon:icon};}function setupCheckboxShiftClick(){return true;}function MoreControl(){};MoreControl.prototype=new GControl();MoreControl.prototype.initialize=function(map){this.map=map;var more=document.getElementById(map.name+"-outer-more");var buttonDiv=document.createElement("div");buttonDiv.id=map.name+"-more-button";buttonDiv.title="Show/Hide Overlays";buttonDiv.style.border="1px solid black";buttonDiv.style.width="86px";var textDiv=document.createElement("div");textDiv.id=map.name+"-inner-more";textDiv.setAttribute('class','inner-more');textDiv.appendChild(document.createTextNode("Overlays"));buttonDiv.appendChild(textDiv);more.onmouseover=showGLayerbox;more.onmouseout=setGLayerboxClose;more.insertBefore(buttonDiv,document.getElementById(map.name+"-more-box").parentNode);map.getContainer().appendChild(more);return more;};MoreControl.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(7,35));};function checkGChecked(mapName){var boxes=document.getElementsByName(mapName+"-overlay-box");for(var i=0;i<boxes.length;i++){if(boxes[i].checked)return true;}return false;}function showGLayerbox(){var mapName=this.id.split('-')[0];eval("if(window.timer_"+mapName+") clearTimeout(timer_"+mapName+");");document.getElementById(mapName+"-more-box").style.display="block";var button=document.getElementById(mapName+"-inner-more");button.style.borderBottomWidth="4px";button.style.borderBottomColor="white";}function setGLayerboxClose(){var mapName=this.id.split('-')[0];var layerbox=document.getElementById(mapName+"-more-box");var button=document.getElementById(mapName+"-inner-more");var bottomColor=checkGChecked(mapName)?"#6495ed":"#c0c0c0";eval("timer_"+mapName+" = window.setTimeout(function() { layerbox.style.display = 'none'; button.style.borderBottomWidth = '1px'; button.style.borderBottomColor = bottomColor; }, 400);");}function switchGLayer(map,checked,layer){var layerbox=document.getElementById(map.name+"-more-box");var button=document.getElementById(map.name+"-inner-more");if(checked){map.addOverlay(layer);}else{map.removeOverlay(layer);}}function initiateGOverlay(elementId,mapName,urlNr){document.getElementById(elementId).checked=true;switchGLayer(GMaps[mapName],true,GOverlays[urlNr]);} |
\ No newline at end of file |
| 2 | +var GOverlays=[new GLayer("com.panoramio.all"),new GLayer("com.youtube.all"),new GLayer("org.wikipedia.en"),new GLayer("com.google.webcams")]; |
| 3 | +function createGMarker(b,a,d,c){var e;if(c!=""){var f=new GIcon(G_DEFAULT_ICON);f.image=c;e=new GMarker(b,{icon:f})}else e=new GMarker(b);if((a+d).length>0){var g=(b=a.length>0&&d.length>0)?"<b>"+a+"</b><hr />"+d:a+d;g='<div style="overflow:auto;max-height:150px;">'+g+"</div>";GEvent.addListener(e,"click",function(){e.openInfoWindowHtml(g,{maxWidth:350})})}return e} |
| 4 | +function initializeGoogleMap(b,a,d){if(GBrowserIsCompatible()){a.centre=a.lat!=null&&a.lon!=null?new GLatLng(a.lat,a.lon):null;a.size=new GSize(a.width,a.height);return createGoogleMap(b,a,d)}else return false} |
| 5 | +function createGoogleMap(b,a,d){for(var c=document.getElementById(b),e=false,f=0;f<a.types.length;f++)if(a.types[f]==a.type)e=true;e||a.types.push(a.type);c=new GMap2(c,{size:a.size,mapTypes:a.types});c.name=b;c.setMapType(a.type);for(f in a.controls){if(a.controls[f].toLowerCase()=="auto")if(a.height>75)a.controls[f]=a.height>320?"large":"small";switch(a.controls[f]){case "large":c.addControl(new GLargeMapControl3D);break;case "small":c.addControl(new GSmallZoomControl3D);break;case "large-original":c.addControl(new GLargeMapControl); |
| 6 | +break;case "small-original":c.addControl(new GSmallMapControl);break;case "zoom":c.addControl(new GSmallZoomControl);break;case "type":c.addControl(new GMapTypeControl);break;case "type-menu":c.addControl(new GMenuMapTypeControl);break;case "overlays":c.addControl(new MoreControl);break;case "overview":case "overview-map":c.addControl(new GOverviewMapControl);break;case "scale":c.addControl(new GScaleControl);break;case "nav-label":case "nav":c.addControl(new GNavLabelControl);break}}e=(a.zoom==null|| |
| 7 | +a.centre==null)&&d.length>1?new GLatLngBounds:null;for(f in d){var g=d[f];c.addOverlay(createGMarker(g.point,g.title,g.label,g.icon));e!=null&&e.extend(g.point)}e!=null&&c.setCenter(e.getCenter(),c.getBoundsZoomLevel(e));a.centre!=null&&c.setCenter(a.centre);a.zoom!=null&&c.setZoom(a.zoom);a.scrollWheelZoom&&c.enableScrollWheelZoom();c.enableContinuousZoom();if(!window.GMaps)window.GMaps={};eval("window.GMaps."+b+" = map;");return c} |
| 8 | +function getGMarkerData(b,a,d,c,e){return{point:new GLatLng(b,a),title:d,label:c,icon:e}}function setupCheckboxShiftClick(){return true}function MoreControl(){}MoreControl.prototype=new GControl; |
| 9 | +MoreControl.prototype.initialize=function(b){this.map=b;var a=document.getElementById(b.name+"-outer-more"),d=document.createElement("div");d.id=b.name+"-more-button";d.title="Show/Hide Overlays";d.style.border="1px solid black";d.style.width="86px";var c=document.createElement("div");c.id=b.name+"-inner-more";c.setAttribute("class","inner-more");c.appendChild(document.createTextNode("Overlays"));d.appendChild(c);a.onmouseover=showGLayerbox;a.onmouseout=setGLayerboxClose;a.insertBefore(d,document.getElementById(b.name+ |
| 10 | +"-more-box").parentNode);b.getContainer().appendChild(a);return a};MoreControl.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(7,35))};function checkGChecked(b){b=document.getElementsByName(b+"-overlay-box");for(var a=0;a<b.length;a++)if(b[a].checked)return true;return false} |
| 11 | +function showGLayerbox(){var b=this.id.split("-")[0];eval("if(window.timer_"+b+") clearTimeout(timer_"+b+");");document.getElementById(b+"-more-box").style.display="block";b=document.getElementById(b+"-inner-more");b.style.borderBottomWidth="4px";b.style.borderBottomColor="white"} |
| 12 | +function setGLayerboxClose(){var b=this.id.split("-")[0],a=document.getElementById(b+"-more-box");a=document.getElementById(b+"-inner-more");a=checkGChecked(b)?"#6495ed":"#c0c0c0";eval("timer_"+b+" = window.setTimeout(function() { layerbox.style.display = 'none'; button.style.borderBottomWidth = '1px'; button.style.borderBottomColor = bottomColor; }, 400);")} |
| 13 | +function switchGLayer(b,a,d){var c=document.getElementById(b.name+"-more-box");c=document.getElementById(b.name+"-inner-more");a?b.addOverlay(d):b.removeOverlay(d)}function initiateGOverlay(b,a,d){document.getElementById(b).checked=true;switchGLayer(GMaps[a],true,GOverlays[d])}; |
\ No newline at end of file |
Index: trunk/extensions/Maps/GoogleMaps/Maps_GoogleMaps.php |
— | — | @@ -162,7 +162,7 @@ |
163 | 163 | } |
164 | 164 | |
165 | 165 | /** |
166 | | - * Changes the map type name into the corresponding Google Maps API identifier. |
| 166 | + * Changes the map type name into the corresponding Google Maps API v2 identifier. |
167 | 167 | * |
168 | 168 | * @param string $type |
169 | 169 | * |
— | — | @@ -173,7 +173,7 @@ |
174 | 174 | } |
175 | 175 | |
176 | 176 | /** |
177 | | - * Changes the map type names into the corresponding Google Maps API identifiers. |
| 177 | + * Changes the map type names into the corresponding Google Maps API v2 identifiers. |
178 | 178 | * |
179 | 179 | * @param array $types |
180 | 180 | * |
Index: trunk/extensions/Maps/YahooMaps/YahooMapFunctions.min.js |
— | — | @@ -1 +1,3 @@ |
2 | | -function createYMarker(geoPoint,title,label,icon){var newMarker;if(icon!=''){newMarker=new YMarker(geoPoint,new YImage(icon));}else{newMarker=new YMarker(geoPoint);}if((title+label).length>0){var bothTxtAreSet=title.length>0&&label.length>0;var markerMarkup=bothTxtAreSet?'<b>'+title+'</b><hr />'+label:title+label;YEvent.Capture(newMarker,EventsList.MouseClick,function(){newMarker.openSmartWindow(markerMarkup);});}return newMarker;}function initializeYahooMap(mapName,lat,lon,zoom,type,types,controls,scrollWheelZoom,markers,height){var centre=(lon!=null&&lat!=null)?new YGeoPoint(lat,lon):null;return createYahooMap(document.getElementById(mapName),centre,zoom,type,types,controls,scrollWheelZoom,markers,height);}function createYahooMap(mapElement,centre,zoom,type,types,controls,scrollWheelZoom,markers,height){var typesContainType=false;for(var i=0;i<types.length;i++){if(types[i]==type)typesContainType=true;}if(!typesContainType)types.push(type);var map=new YMap(mapElement,type);map.removeZoomScale();for(i in controls){if(controls[i].toLowerCase()=='auto-zoom'){if(height>42)controls[i]=height>100?'zoom':'zoom-short';}switch(controls[i]){case'scale':map.addZoomScale();case'type':map.addTypeControl(types);break;case'pan':map.addPanControl();break;case'zoom':map.addZoomLong();break;case'zoom-short':map.addZoomShort();break;}}map.setMapType(type);if(!scrollWheelZoom)map.disableKeyControls();var map_locations=((zoom==null||centre==null)&&markers.length>1)?Array():null;for(i in markers){var marker=markers[i];map.addOverlay(createYMarker(marker.point,marker.title,marker.label,marker.icon));if(map_locations!=null)map_locations.push(marker.point);}if(map_locations!=null){var centerAndZoom=map.getBestZoomAndCenter(map_locations);map.drawZoomAndCenter(centerAndZoom.YGeoPoint,centerAndZoom.zoomLevel);}if(zoom!=null)map.setZoomLevel(zoom);if(centre!=null)map.drawZoomAndCenter(centre);return map;}function getYMarkerData(lat,lon,title,label,icon){return{point:new YGeoPoint(lat,lon),title:title,label:label,icon:icon};} |
\ No newline at end of file |
| 2 | +function createYMarker(a,d,e,c){var b;b=c!=""?new YMarker(a,new YImage(c)):new YMarker(a);if((d+e).length>0){var g=(a=d.length>0&&e.length>0)?"<b>"+d+"</b><hr />"+e:d+e;YEvent.Capture(b,EventsList.MouseClick,function(){b.openSmartWindow(g)})}return b}function initializeYahooMap(a,d,e,c,b,g,k,h,i,j){d=e!=null&&d!=null?new YGeoPoint(d,e):null;return createYahooMap(document.getElementById(a),d,c,b,g,k,h,i,j)} |
| 3 | +function createYahooMap(a,d,e,c,b,g,k,h,i){for(var j=false,f=0;f<b.length;f++)if(b[f]==c)j=true;j||b.push(c);a=new YMap(a,c);a.removeZoomScale();for(f in g){if(g[f].toLowerCase()=="auto-zoom")if(i>42)g[f]=i>100?"zoom":"zoom-short";switch(g[f]){case "scale":a.addZoomScale();case "type":a.addTypeControl(b);break;case "pan":a.addPanControl();break;case "zoom":a.addZoomLong();break;case "zoom-short":a.addZoomShort();break}}a.setMapType(c);k||a.disableKeyControls();c=(e==null||d==null)&&h.length>1?Array(): |
| 4 | +null;for(f in h){b=h[f];a.addOverlay(createYMarker(b.point,b.title,b.label,b.icon));c!=null&&c.push(b.point)}if(c!=null){h=a.getBestZoomAndCenter(c);a.drawZoomAndCenter(h.YGeoPoint,h.zoomLevel)}e!=null&&a.setZoomLevel(e);d!=null&&a.drawZoomAndCenter(d);return a}function getYMarkerData(a,d,e,c,b){return{point:new YGeoPoint(a,d),title:e,label:c,icon:b}}; |
\ No newline at end of file |
Index: trunk/extensions/Maps/Maps_Settings.php |
— | — | @@ -153,7 +153,7 @@ |
154 | 154 | # Google Maps |
155 | 155 | |
156 | 156 | # Your Google Maps API key. Required for displaying Google Maps, and using the Google Geocoder services. |
157 | | -if (empty($egGoogleMapsKey)) $egGoogleMapsKey = ''; # http://code.google.com/apis/maps/signup.html |
| 157 | +$egGoogleMapsKey = ''; # http://code.google.com/apis/maps/signup.html |
158 | 158 | |
159 | 159 | # String. The Google Maps map name prefix. It can not be identical to the one of another mapping service. |
160 | 160 | $egMapsGoogleMapsPrefix = 'map_google'; |
— | — | @@ -161,7 +161,7 @@ |
162 | 162 | # Integer. The default zoom of a map. This value will only be used when the user does not provide one. |
163 | 163 | $egMapsGoogleMapsZoom = 14; |
164 | 164 | |
165 | | -# Array of String. The Google Maps default map types. This value will only be used when the user does not provide one. |
| 165 | +# Array of String. The Google Maps v2 default map types. This value will only be used when the user does not provide one. |
166 | 166 | $egMapsGoogleMapsTypes = array('normal', 'satellite', 'hybrid', 'physical'); |
167 | 167 | |
168 | 168 | # String. The default map type. This value will only be used when the user does not provide one. |
— | — | @@ -171,11 +171,11 @@ |
172 | 172 | # This value will only be used when the user does not provide one. |
173 | 173 | $egMapsGoogleAutozoom = true; |
174 | 174 | |
175 | | -# Array of String. The default controls for Google Maps. This value will only be used when the user does not provide one. |
| 175 | +# Array of String. The default controls for Google Maps v2. This value will only be used when the user does not provide one. |
176 | 176 | # Available values: auto, large, small, large-original, small-original, zoom, type, type-menu, overview-map, scale, nav-label, overlays |
177 | 177 | $egMapsGMapControls = array('auto', 'scale', 'type', 'overlays'); |
178 | 178 | |
179 | | -# Array. The default overlays for the Google Maps overlays control, and whether they should be shown at pageload. |
| 179 | +# Array. The default overlays for the Google Maps v2 overlays control, and whether they should be shown at pageload. |
180 | 180 | # This value will only be used when the user does not provide one. |
181 | 181 | # Available values: photos, videos, wikipedia, webcams |
182 | 182 | $egMapsGMapOverlays = array('photos', 'videos', 'wikipedia', 'webcams'); |
— | — | @@ -185,18 +185,24 @@ |
186 | 186 | # Google Maps v3 |
187 | 187 | |
188 | 188 | # String. The Google Maps v3 map name prefix. It can not be identical to the one of another mapping service. |
189 | | -$egMapsGoogleMaps3Prefix = 'map_google3'; |
| 189 | +$egMapsGMaps3Prefix = 'map_google3'; |
190 | 190 | |
191 | 191 | # Integer. The default zoom of a map. This value will only be used when the user does not provide one. |
192 | | -$egMapsGoogleMaps3Zoom = 14; |
| 192 | +$egMapsGMaps3Zoom = 14; |
193 | 193 | |
| 194 | +# Array of String. The Google Maps v3 default map types. This value will only be used when the user does not provide one. |
| 195 | +$egMapsGMaps3Types = array('roadmap', 'satellite', 'hybrid', 'terrain'); |
194 | 196 | |
| 197 | +# String. The default map type. This value will only be used when the user does not provide one. |
| 198 | +$egMapsGMaps3Type = 'roadmap'; |
195 | 199 | |
| 200 | + |
| 201 | + |
196 | 202 | # Yahoo! Maps |
197 | 203 | |
198 | 204 | # Your Yahoo! Maps API key. Required for displaying Yahoo! Maps. |
199 | 205 | # Haven't got an API key yet? Get it here: https://developer.yahoo.com/wsregapp/ |
200 | | -if (empty($egYahooMapsKey)) $egYahooMapsKey = ''; |
| 206 | +$egYahooMapsKey = ''; |
201 | 207 | |
202 | 208 | # String. The Yahoo! maps map name prefix. It can not be identical to the one of another mapping service. |
203 | 209 | $egMapsYahooMapsPrefix = 'map_yahoo'; |