Index: trunk/extensions/Maps/includes/services/OpenLayers/Maps_ParamOLLayers.php |
— | — | @@ -35,9 +35,10 @@ |
36 | 36 | $layerNames = array(); |
37 | 37 | |
38 | 38 | foreach ( $parameter->getValue() as $layerOrGroup ) { |
| 39 | + $lcLayerOrGroup = strtolower( $layerOrGroup ); |
39 | 40 | // Layer groups. Loop over all items and add them when not present yet. |
40 | | - if ( array_key_exists( $layerOrGroup, $egMapsOLLayerGroups ) ) { |
41 | | - foreach ( $egMapsOLLayerGroups[$layerOrGroup] as $layerName ) { |
| 41 | + if ( array_key_exists( $lcLayerOrGroup, $egMapsOLLayerGroups ) ) { |
| 42 | + foreach ( $egMapsOLLayerGroups[$lcLayerOrGroup] as $layerName ) { |
42 | 43 | if ( !in_array( $layerName, $layerNames ) ) { |
43 | 44 | if ( is_array( $egMapsOLAvailableLayers[$layerName] ) ) { |
44 | 45 | $layerDefs[] = 'new ' . $egMapsOLAvailableLayers[$layerName][0]; |
— | — | @@ -50,16 +51,16 @@ |
51 | 52 | } |
52 | 53 | } |
53 | 54 | // Single layers. Add them when not present yet. |
54 | | - elseif ( array_key_exists( $layerOrGroup, $egMapsOLAvailableLayers ) ) { |
55 | | - if ( !in_array( $layerOrGroup, $layerNames ) ) { |
56 | | - if ( is_array( $egMapsOLAvailableLayers[$layerOrGroup] ) ) { |
57 | | - $layerDefs[] = 'new ' . $egMapsOLAvailableLayers[$layerOrGroup][0]; |
| 55 | + elseif ( array_key_exists( $lcLayerOrGroup, $egMapsOLAvailableLayers ) ) { |
| 56 | + if ( !in_array( $lcLayerOrGroup, $layerNames ) ) { |
| 57 | + if ( is_array( $egMapsOLAvailableLayers[$lcLayerOrGroup] ) ) { |
| 58 | + $layerDefs[] = 'new ' . $egMapsOLAvailableLayers[$lcLayerOrGroup][0]; |
58 | 59 | } |
59 | 60 | else { |
60 | | - $layerDefs[] = 'new ' . $egMapsOLAvailableLayers[$layerOrGroup]; |
| 61 | + $layerDefs[] = 'new ' . $egMapsOLAvailableLayers[$lcLayerOrGroup]; |
61 | 62 | } |
62 | 63 | |
63 | | - $layerNames[] = $layerOrGroup; |
| 64 | + $layerNames[] = $lcLayerOrGroup; |
64 | 65 | } |
65 | 66 | } |
66 | 67 | // Image layers. Check validity and add when not present yet. |
— | — | @@ -107,9 +108,10 @@ |
108 | 109 | $layerDependencies = array(); |
109 | 110 | |
110 | 111 | foreach ( $layerNames as $layerName ) { |
111 | | - if ( is_array( $egMapsOLAvailableLayers[$layerName] ) |
112 | | - && count( $egMapsOLAvailableLayers[$layerName] ) > 1 |
113 | | - && array_key_exists( $egMapsOLAvailableLayers[$layerName][1], $egMapsOLLayerDependencies ) ) { |
| 112 | + if ( array_key_exists( $layerName, $egMapsOLAvailableLayers ) // The layer must be defined in php |
| 113 | + && is_array( $egMapsOLAvailableLayers[$layerName] ) // The layer must be an array... |
| 114 | + && count( $egMapsOLAvailableLayers[$layerName] ) > 1 // ...with a second element... |
| 115 | + && array_key_exists( $egMapsOLAvailableLayers[$layerName][1], $egMapsOLLayerDependencies ) ) { //...that is a dependency. |
114 | 116 | $layerDependencies[] = $egMapsOLLayerDependencies[$egMapsOLAvailableLayers[$layerName][1]]; |
115 | 117 | } |
116 | 118 | } |
Index: trunk/extensions/Maps/includes/services/OpenLayers/Maps_OpenLayers.php |
— | — | @@ -46,6 +46,7 @@ |
47 | 47 | $params['layers']->setDoManipulationOfDefault( true ); |
48 | 48 | $params['layers']->addCriteria( new CriterionOLLayer() ); |
49 | 49 | $params['layers']->setDefault( $egMapsOLLayers ); |
| 50 | + $params['layers']->lowerCaseValue = false; |
50 | 51 | |
51 | 52 | //$params['imagelayers'] = new ListParameter(); |
52 | 53 | } |
— | — | @@ -83,9 +84,10 @@ |
84 | 85 | */ |
85 | 86 | public function createMarkersJs( array $markers ) { |
86 | 87 | $markerItems = array(); |
87 | | - |
| 88 | + $defaultGroup = wfMsg( 'maps-markers' ); |
| 89 | + //.// TODO |
88 | 90 | foreach ( $markers as $marker ) { |
89 | | - $markerItems[] = Xml::encodeJsVar( (object)array( |
| 91 | + $markerItems[false ? $marker[5] : $defaultGroup] = Xml::encodeJsVar( (object)array( |
90 | 92 | 'lat' => $marker[0], |
91 | 93 | 'lon' => $marker[1], |
92 | 94 | 'title' => $marker[2], |
Index: trunk/extensions/Maps/includes/services/OpenLayers/CriterionOLLayer.php |
— | — | @@ -30,7 +30,7 @@ |
31 | 31 | $dynamicLayers = MapsOpenLayers::getLayerNames( true ); |
32 | 32 | |
33 | 33 | // Dynamic layers, defined in the settings file or localsettings. |
34 | | - if ( in_array( $value, $dynamicLayers ) ) { |
| 34 | + if ( in_array( strtolower( $value ), $dynamicLayers ) ) { |
35 | 35 | return true; |
36 | 36 | } |
37 | 37 | |