http://www.mediawiki.org/wiki/Special:Code/MediaWiki/54822

Revision: 54822
Author:   jeroendedauw
Date:     2009-08-11 22:59:52 +0000 (Tue, 11 Aug 2009)

Log Message:
-----------
Changes for 0.3

Modified Paths:
--------------
    trunk/extensions/Maps/GoogleMaps/Maps_GoogleMaps.php
    trunk/extensions/Maps/Maps_BaseMap.php
    trunk/extensions/Maps/OpenLayers/Maps_OpenLayers.php
    trunk/extensions/Maps/OpenLayers/OpenLayerFunctions.js

Modified: trunk/extensions/Maps/GoogleMaps/Maps_GoogleMaps.php
===================================================================
--- trunk/extensions/Maps/GoogleMaps/Maps_GoogleMaps.php        2009-08-11 
22:45:26 UTC (rev 54821)
+++ trunk/extensions/Maps/GoogleMaps/Maps_GoogleMaps.php        2009-08-11 
22:59:52 UTC (rev 54822)
@@ -69,7 +69,8 @@
                        $lon = $markerData['lon'];
                        $title = array_key_exists('title', $markerData) ? 
$markerData['title'] : $this->title;
                        $label = array_key_exists('label', $markerData) ? 
$markerData['label'] : $this->label;
-                       $markerItems[] = "getGMarkerData($lat, $lon, '$title', 
'$label', '')";
+                       $icon = array_key_exists('icon', $markerData) ? 
$markerData['icon'] : '';
+                       $markerItems[] = "getGMarkerData($lat, $lon, '$title', 
'$label', '$icon')";
                }               
                
                $markersString = implode(',', $markerItems);    

Modified: trunk/extensions/Maps/Maps_BaseMap.php
===================================================================
--- trunk/extensions/Maps/Maps_BaseMap.php      2009-08-11 22:45:26 UTC (rev 
54821)
+++ trunk/extensions/Maps/Maps_BaseMap.php      2009-08-11 22:59:52 UTC (rev 
54822)
@@ -68,7 +68,7 @@
        }       
        
        /**
-        * Sets the $marler_lon and $marler_lat fields.
+        * Fills the $markerData array with the locations and their meta data.
         *
         */
        private function setCoordinates() {
@@ -87,6 +87,10 @@
                                
                                if (count($args) > 2) {
                                        $markerData['label'] = $args[2];
+                                       
+                                       if (count($args) > 3) {
+                                               $markerData['icon'] = $args[3];
+                                       }                                       
                                }
                        }
 

Modified: trunk/extensions/Maps/OpenLayers/Maps_OpenLayers.php
===================================================================
--- trunk/extensions/Maps/OpenLayers/Maps_OpenLayers.php        2009-08-11 
22:45:26 UTC (rev 54821)
+++ trunk/extensions/Maps/OpenLayers/Maps_OpenLayers.php        2009-08-11 
22:59:52 UTC (rev 54822)
@@ -67,7 +67,7 @@
                        $lat = $markerData['lat'];
                        $lon = $markerData['lon'];
                        $title = array_key_exists('title', $markerData) ? 
$markerData['title'] : $this->title;
-                       $label = array_key_exists('label', $markerData) ? 
$markerData['label'] : $this->label;                  
+                       $label = array_key_exists('label', $markerData) ? 
$markerData['label'] : $this->label;          
                        $markerItems[] = "getOLMarkerData($lon, $lat, '$title', 
'$label')";
                }               
                

Modified: trunk/extensions/Maps/OpenLayers/OpenLayerFunctions.js
===================================================================
--- trunk/extensions/Maps/OpenLayers/OpenLayerFunctions.js      2009-08-11 
22:45:26 UTC (rev 54821)
+++ trunk/extensions/Maps/OpenLayers/OpenLayerFunctions.js      2009-08-11 
22:59:52 UTC (rev 54822)
@@ -70,7 +70,9 @@
        
        // Variables to prevent double adding of a base layer
        var usedNor = false; var usedSat = false; var usedHyb = false; var 
usedPhy = false;  // Google types
-       var usedBing = false; var usedYahoo = false; var usedOLWMS = false; var 
usedNasa = false; var usedOSM = false;
+       var usedBingNor = false; var usedBingHyb = false; var usedBingSat = 
false; // Bing types
+       var usedYahooNor = false; var usedYahooHyb = false; var usedYahooSat = 
false; // Yahoo types
+       var usedOLWMS = false; var usedNasa = false; var usedOSM = false;
        var isDefaultBaseLayer = false;
 
        // Add the base layers
@@ -113,11 +115,30 @@
                                }
                                break;
                        case 'bing' : case 'virtual-earth' :
-                               if (!usedBing){ newLayer = new 
OpenLayers.Layer.VirtualEarth( 'Virtual Earth' /* , {sphericalMercator:true} 
*/); usedBing = true; }
+                               if (!usedBingNor){ newLayer = new 
OpenLayers.Layer.VirtualEarth( 'Bing Maps'  , {type: VEMapStyle.Shaded} ); 
usedBingNor = true; }
+                               if (!usedBingSat){ newLayer = new 
OpenLayers.Layer.VirtualEarth( 'Bing Satellite'  , {type: VEMapStyle.Aerial} ); 
usedBingSat = true; }                                 
+                               if (!usedBingHyb){ newLayer = new 
OpenLayers.Layer.VirtualEarth( 'Bing Hybrid'  , {type: VEMapStyle.Hybrid} ); 
usedBingHyb = true; }
                                break;
-                       case 'yahoo' : case 'yahoo-maps' :
-                               if (!usedYahoo){ newLayer = new 
OpenLayers.Layer.Yahoo( 'Yahoo Maps' /*, {sphericalMercator:true} */); 
usedYahoo = true; }
+                       case 'bing-normal' :
+                               if (!usedBingNor){ newLayer = new 
OpenLayers.Layer.VirtualEarth( 'Bing Maps'  , {type: VEMapStyle.Shaded} ); 
usedBingNor = true; }
+                       case 'bing-satellite' :
+                               if (!usedBingSat){ newLayer = new 
OpenLayers.Layer.VirtualEarth( 'Bing Satellite'  , {type: VEMapStyle.Aerial} ); 
usedBingSat = true; }                                 
+                       case 'bing-hybrid' :                    
+                               if (!usedBingHyb){ newLayer = new 
OpenLayers.Layer.VirtualEarth( 'Bing Hybrid'  , {type: VEMapStyle.Hybrid} ); 
usedBingHyb = true; }                    
+                       case 'yahoo' :
+                               if (!usedYahooNor){ newLayer = new 
OpenLayers.Layer.Yahoo( 'Yahoo Maps' ); usedYahooNor = true; }
+                               if (!usedYahooSat){ newLayer = new 
OpenLayers.Layer.Yahoo( 'Yahoo Maps', {'type': YAHOO_MAP_SAT} ); usedYahooSat = 
true; }
+                               if (!usedYahooHyb){ newLayer = new 
OpenLayers.Layer.Yahoo( 'Yahoo Maps', {'type': YAHOO_MAP_HYB} ); usedYahooHyb = 
true; }
                                break;
+                       case 'yahoo-normal' :
+                               if (!usedYahooNor){ newLayer = new 
OpenLayers.Layer.Yahoo( 'Yahoo Maps' ); usedYahooNor = true; }
+                               break;  
+                       case 'yahoo-satellite' :
+                               if (!usedYahooSat){ newLayer = new 
OpenLayers.Layer.Yahoo( 'Yahoo Maps', {'type': YAHOO_MAP_SAT} ); usedYahooSat = 
true; }
+                               break;  
+                       case 'yahoo-hybrid' :
+                               if (!usedYahooHyb){ newLayer = new 
OpenLayers.Layer.Yahoo( 'Yahoo Maps', {'type': YAHOO_MAP_HYB} ); usedYahooHyb = 
true; }
+                               break;                                  
                        case 'openlayers' : case 'open-layers' :
                                if (!usedOLWMS){ newLayer = new 
OpenLayers.Layer.WMS( 'OpenLayers WMS', 'http://labs.metacarta.com/wms/vmap0', 
{layers: 'basic'} ); usedOLWMS = true; }
                                break;          



_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to