r54822 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r54821‎ | r54822 | r54823 >
Date:22:59, 11 August 2009
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Changes for 0.3
Modified paths:
  • /trunk/extensions/Maps/GoogleMaps/Maps_GoogleMaps.php (modified) (history)
  • /trunk/extensions/Maps/Maps_BaseMap.php (modified) (history)
  • /trunk/extensions/Maps/OpenLayers/Maps_OpenLayers.php (modified) (history)
  • /trunk/extensions/Maps/OpenLayers/OpenLayerFunctions.js (modified) (history)

Diff [purge]

Index: trunk/extensions/Maps/OpenLayers/OpenLayerFunctions.js
@@ -70,7 +70,9 @@
7171
7272 // Variables to prevent double adding of a base layer
7373 var usedNor = false; var usedSat = false; var usedHyb = false; var usedPhy = false; // Google types
74 - var usedBing = false; var usedYahoo = false; var usedOLWMS = false; var usedNasa = false; var usedOSM = false;
 74+ var usedBingNor = false; var usedBingHyb = false; var usedBingSat = false; // Bing types
 75+ var usedYahooNor = false; var usedYahooHyb = false; var usedYahooSat = false; // Yahoo types
 76+ var usedOLWMS = false; var usedNasa = false; var usedOSM = false;
7577 var isDefaultBaseLayer = false;
7678
7779 // Add the base layers
@@ -113,11 +115,30 @@
114116 }
115117 break;
116118 case 'bing' : case 'virtual-earth' :
117 - if (!usedBing){ newLayer = new OpenLayers.Layer.VirtualEarth( 'Virtual Earth' /* , {sphericalMercator:true} */); usedBing = true; }
 119+ if (!usedBingNor){ newLayer = new OpenLayers.Layer.VirtualEarth( 'Bing Maps' , {type: VEMapStyle.Shaded} ); usedBingNor = true; }
 120+ if (!usedBingSat){ newLayer = new OpenLayers.Layer.VirtualEarth( 'Bing Satellite' , {type: VEMapStyle.Aerial} ); usedBingSat = true; }
 121+ if (!usedBingHyb){ newLayer = new OpenLayers.Layer.VirtualEarth( 'Bing Hybrid' , {type: VEMapStyle.Hybrid} ); usedBingHyb = true; }
118122 break;
119 - case 'yahoo' : case 'yahoo-maps' :
120 - if (!usedYahoo){ newLayer = new OpenLayers.Layer.Yahoo( 'Yahoo Maps' /*, {sphericalMercator:true} */); usedYahoo = true; }
 123+ case 'bing-normal' :
 124+ if (!usedBingNor){ newLayer = new OpenLayers.Layer.VirtualEarth( 'Bing Maps' , {type: VEMapStyle.Shaded} ); usedBingNor = true; }
 125+ case 'bing-satellite' :
 126+ if (!usedBingSat){ newLayer = new OpenLayers.Layer.VirtualEarth( 'Bing Satellite' , {type: VEMapStyle.Aerial} ); usedBingSat = true; }
 127+ case 'bing-hybrid' :
 128+ if (!usedBingHyb){ newLayer = new OpenLayers.Layer.VirtualEarth( 'Bing Hybrid' , {type: VEMapStyle.Hybrid} ); usedBingHyb = true; }
 129+ case 'yahoo' :
 130+ if (!usedYahooNor){ newLayer = new OpenLayers.Layer.Yahoo( 'Yahoo Maps' ); usedYahooNor = true; }
 131+ if (!usedYahooSat){ newLayer = new OpenLayers.Layer.Yahoo( 'Yahoo Maps', {'type': YAHOO_MAP_SAT} ); usedYahooSat = true; }
 132+ if (!usedYahooHyb){ newLayer = new OpenLayers.Layer.Yahoo( 'Yahoo Maps', {'type': YAHOO_MAP_HYB} ); usedYahooHyb = true; }
121133 break;
 134+ case 'yahoo-normal' :
 135+ if (!usedYahooNor){ newLayer = new OpenLayers.Layer.Yahoo( 'Yahoo Maps' ); usedYahooNor = true; }
 136+ break;
 137+ case 'yahoo-satellite' :
 138+ if (!usedYahooSat){ newLayer = new OpenLayers.Layer.Yahoo( 'Yahoo Maps', {'type': YAHOO_MAP_SAT} ); usedYahooSat = true; }
 139+ break;
 140+ case 'yahoo-hybrid' :
 141+ if (!usedYahooHyb){ newLayer = new OpenLayers.Layer.Yahoo( 'Yahoo Maps', {'type': YAHOO_MAP_HYB} ); usedYahooHyb = true; }
 142+ break;
122143 case 'openlayers' : case 'open-layers' :
123144 if (!usedOLWMS){ newLayer = new OpenLayers.Layer.WMS( 'OpenLayers WMS', 'http://labs.metacarta.com/wms/vmap0', {layers: 'basic'} ); usedOLWMS = true; }
124145 break;
Index: trunk/extensions/Maps/OpenLayers/Maps_OpenLayers.php
@@ -67,7 +67,7 @@
6868 $lat = $markerData['lat'];
6969 $lon = $markerData['lon'];
7070 $title = array_key_exists('title', $markerData) ? $markerData['title'] : $this->title;
71 - $label = array_key_exists('label', $markerData) ? $markerData['label'] : $this->label;
 71+ $label = array_key_exists('label', $markerData) ? $markerData['label'] : $this->label;
7272 $markerItems[] = "getOLMarkerData($lon, $lat, '$title', '$label')";
7373 }
7474
Index: trunk/extensions/Maps/GoogleMaps/Maps_GoogleMaps.php
@@ -69,7 +69,8 @@
7070 $lon = $markerData['lon'];
7171 $title = array_key_exists('title', $markerData) ? $markerData['title'] : $this->title;
7272 $label = array_key_exists('label', $markerData) ? $markerData['label'] : $this->label;
73 - $markerItems[] = "getGMarkerData($lat, $lon, '$title', '$label', '')";
 73+ $icon = array_key_exists('icon', $markerData) ? $markerData['icon'] : '';
 74+ $markerItems[] = "getGMarkerData($lat, $lon, '$title', '$label', '$icon')";
7475 }
7576
7677 $markersString = implode(',', $markerItems);
Index: trunk/extensions/Maps/Maps_BaseMap.php
@@ -68,7 +68,7 @@
6969 }
7070
7171 /**
72 - * Sets the $marler_lon and $marler_lat fields.
 72+ * Fills the $markerData array with the locations and their meta data.
7373 *
7474 */
7575 private function setCoordinates() {
@@ -87,6 +87,10 @@
8888
8989 if (count($args) > 2) {
9090 $markerData['label'] = $args[2];
 91+
 92+ if (count($args) > 3) {
 93+ $markerData['icon'] = $args[3];
 94+ }
9195 }
9296 }
9397

Status & tagging log