Skip to content
Browse files

Merge branch 'master' into danwe_custom-maps

Conflicts:
	Maps.php
	Maps_Settings.php
	includes/criteria/CriterionMapLayer.php
	includes/layers/Maps_ImageLayer.php
	includes/layers/Maps_KMLLayer.php
	includes/services/OpenLayers/CriterionOLLayer.php
	includes/services/OpenLayers/Maps_OpenLayers.php
	includes/services/OpenLayers/Maps_ParamOLLayers.php
	includes/services/OpenLayers/jquery.openlayers.js
  • Loading branch information...
2 parents 99a02b3 + a7a5256 commit 0672cbd61bfb84443de55604157bd7110b52f047 @DanweDE DanweDE committed Jan 14, 2014
Showing with 7,351 additions and 5,233 deletions.
  1. +4 −0 .coveralls.yml
  2. +7 −1 .gitignore
  3. +34 −0 .travis.sh
  4. +23 −0 .travis.yml
  5. +76 −0 Maps.classes.php
  6. +28 −7 Maps.hooks.php
  7. +42 −2 Maps.i18n.alias.php
  8. +60 −11 Maps.i18n.magic.php
  9. +1,664 −146 Maps.i18n.php
  10. +199 −322 Maps.php
  11. +90 −0 Maps.resources.php
  12. +134 −113 Maps_Settings.php
  13. +0 −62 README
  14. +73 −0 README.md
  15. +30 −4 RELEASE-NOTES
  16. +29 −0 composer.json
  17. +110 −0 includes/Element.php
  18. +5 −3 includes/{Maps_Geocoder.php → Geocoder.php}
  19. +54 −41 includes/{Maps_Geocoders.php → Geocoders.php}
  20. +0 −50 includes/Maps_BaseElement.php
  21. +10 −9 includes/Maps_BaseStrokableElement.php
  22. +0 −73 includes/Maps_Circle.php
  23. +0 −638 includes/Maps_CoordinateParser.php
  24. +166 −13 includes/Maps_DisplayMapRenderer.php
  25. +3 −1 includes/Maps_DistanceParser.php
  26. +23 −15 includes/Maps_GeoFunctions.php
  27. +0 −99 includes/Maps_ImageOverlay.php
  28. +13 −9 includes/Maps_KMLFormatter.php
  29. +37 −19 includes/Maps_Layer.php
  30. +3 −3 includes/Maps_LayerPage.php
  31. +0 −51 includes/Maps_Line.php
  32. +26 −26 includes/Maps_Mapper.php
  33. +2 −2 includes/Maps_MappingService.php
  34. +3 −3 includes/Maps_MappingServices.php
  35. +0 −75 includes/Maps_Polygon.php
  36. +0 −111 includes/Maps_Rectangle.php
  37. +0 −87 includes/Maps_WmsOverlay.php
  38. +28 −7 includes/{params/Maps_ServiceParam.php → ServiceParam.php}
  39. +26 −23 includes/api/ApiGeocode.php
  40. +0 −46 includes/criteria/CriterionIsDistance.php
  41. +0 −54 includes/criteria/CriterionIsImage.php
  42. +0 −80 includes/criteria/CriterionIsLocation.php
  43. +0 −97 includes/criteria/CriterionLine.php
  44. +0 −81 includes/criteria/CriterionMapDimension.php
  45. +0 −99 includes/criteria/CriterionPolygon.php
  46. +0 −43 includes/criteria/CriterionSearchMarkers.php
  47. +220 −0 includes/editor/MapEditorHTML.php
  48. BIN includes/editor/images/gradient.png
  49. BIN includes/editor/images/rainbow.png
  50. BIN includes/editor/images/trigger.png
  51. +24 −19 includes/editor/js/mapeditor.js
  52. +136 −0 includes/elements/BaseElement.php
  53. +84 −0 includes/elements/Circle.php
  54. +50 −0 includes/elements/ImageOverlay.php
  55. +80 −0 includes/elements/Line.php
  56. +55 −169 includes/{Maps_Location.php → elements/Location.php}
  57. +51 −0 includes/elements/Polygon.php
  58. +108 −0 includes/elements/Rectangle.php
  59. +118 −0 includes/elements/WmsOverlay.php
  60. +2 −2 includes/ext.maps.layers.css
  61. +4 −4 includes/geocoders/Maps_GeonamesGeocoder.php
  62. +5 −5 includes/geocoders/Maps_GoogleGeocoder.php
  63. +5 −3 includes/iMappingService.php
  64. +66 −37 includes/layers/Maps_ImageLayer.php
  65. +0 −113 includes/manipulations/Maps_CommonParameterManipulation.php
  66. +0 −34 includes/manipulations/Maps_ParamCircle.php
  67. +0 −85 includes/manipulations/Maps_ParamDimension.php
  68. +0 −35 includes/manipulations/Maps_ParamFile.php
  69. +0 −125 includes/manipulations/Maps_ParamGeoService.php
  70. +0 −37 includes/manipulations/Maps_ParamImageOverlay.php
  71. +0 −33 includes/manipulations/Maps_ParamLine.php
  72. +0 −80 includes/manipulations/Maps_ParamLocation.php
  73. +0 −27 includes/manipulations/Maps_ParamPolygon.php
  74. +0 −33 includes/manipulations/Maps_ParamRectangle.php
  75. +0 −31 includes/manipulations/Maps_ParamWmsOverlay.php
  76. +0 −39 includes/manipulations/Maps_ParamZoom.php
  77. +31 −47 includes/parserhooks/Maps_Coordinates.php
  78. +50 −47 includes/parserhooks/Maps_DisplayMap.php
  79. +26 −31 includes/parserhooks/Maps_Distance.php
  80. +68 −97 includes/parserhooks/Maps_Finddestination.php
  81. +53 −78 includes/parserhooks/Maps_Geocode.php
  82. +55 −87 includes/parserhooks/Maps_Geodistance.php
  83. +62 −54 includes/parserhooks/Maps_LayerDefinition.php
  84. +24 −27 includes/parserhooks/Maps_MapsDoc.php
  85. +42 −0 includes/parsers/DistanceParser.php
  86. +153 −0 includes/parsers/LineParser.php
  87. +85 −0 includes/parsers/LocationParser.php
  88. +34 −0 includes/parsers/PolygonParser.php
  89. +47 −0 includes/parsers/WmsOverlayParser.php
  90. +61 −59 includes/services/GoogleMaps3/GoogleMaps3.php
  91. +124 −82 includes/services/GoogleMaps3/Maps_GoogleMaps3.php
  92. +0 −26 includes/services/GoogleMaps3/Maps_ParamGMap3Type.php
  93. +0 −37 includes/services/GoogleMaps3/Maps_ParamGMap3Types.php
  94. +0 −26 includes/services/GoogleMaps3/Maps_ParamGMap3Typestyle.php
  95. +0 −26 includes/services/GoogleMaps3/Maps_ParamGMap3Zoomstyle.php
  96. +6 −4 includes/services/GoogleMaps3/jquery.googlemap.js
  97. +70 −0 includes/services/Leaflet/Leaflet.php
  98. +89 −0 includes/services/Leaflet/Maps_Leaflet.php
  99. +18 −0 includes/services/Leaflet/ext.maps.leaflet.js
  100. +213 −0 includes/services/Leaflet/jquery.leaflet.js
  101. BIN includes/services/Leaflet/leaflet/images/layers.png
  102. BIN includes/services/Leaflet/leaflet/images/marker-icon.png
  103. BIN includes/services/Leaflet/leaflet/images/marker-shadow.png
  104. BIN includes/services/Leaflet/leaflet/images/zoom-in.png
  105. BIN includes/services/Leaflet/leaflet/images/zoom-out.png
  106. +379 −0 includes/services/Leaflet/leaflet/leaflet.css
  107. +44 −0 includes/services/Leaflet/leaflet/leaflet.ie.css
  108. +6 −0 includes/services/Leaflet/leaflet/leaflet.js
  109. +0 −80 includes/services/OSM/Maps_OSM.php
  110. +0 −38 includes/services/OSM/Maps_OSMDispMap.php
  111. +0 −49 includes/services/OSM/OSM.php
  112. +49 −28 includes/services/OpenLayers/Maps_OpenLayers.php
  113. +30 −28 includes/services/OpenLayers/OpenLayers.php
  114. BIN includes/services/OpenLayers/OpenLayers/img/east-mini.png
  115. BIN includes/services/OpenLayers/OpenLayers/img/measuring-stick-off.png
  116. BIN includes/services/OpenLayers/OpenLayers/img/measuring-stick-on.png
  117. BIN includes/services/OpenLayers/OpenLayers/img/zoom-minus-mini.png
  118. BIN includes/services/OpenLayers/OpenLayers/img/zoombar.png
  119. BIN includes/services/OpenLayers/OpenLayers/theme/default/img/navigation_history.png
  120. BIN includes/services/OpenLayers/OpenLayers/theme/default/img/view_previous_off.png
  121. BIN includes/services/OpenLayers/OpenLayers/theme/default/img/view_previous_on.png
  122. +3 −2 includes/services/OpenLayers/ext.maps.openlayers.js
  123. +5 −5 includes/services/OpenLayers/jquery.openlayers.js
  124. +14 −169 includes/specials/SpecialMapEditor.php
  125. +0 −41 includes/validators/CircleValidator.php
  126. +0 −30 includes/validators/GeoValidator.php
  127. +0 −55 includes/validators/LineValidator.php
  128. +0 −46 includes/validators/LocationValidator.php
  129. +0 −54 includes/validators/PolygonValidator.php
  130. +0 −44 includes/validators/RectangleValidator.php
  131. +25 −0 phpunit.xml.dist
  132. +19 −0 tests/bootstrap.php
  133. +76 −0 tests/evilMediaWikiBootstrap.php
  134. +72 −0 tests/phpunit/ElementTest.php
  135. +0 −256 tests/phpunit/MapsCoordinateParserTest.php
  136. +1 −15 tests/phpunit/MapsDistanceParserTest.php
  137. +115 −0 tests/phpunit/elements/BaseElementTest.php
  138. +68 −0 tests/phpunit/elements/CircleTest.php
  139. +68 −0 tests/phpunit/elements/ImageOverlayTest.php
  140. +87 −0 tests/phpunit/elements/LineTest.php
  141. +72 −0 tests/phpunit/elements/LocationTest.php
  142. +51 −0 tests/phpunit/elements/PolygonTest.php
  143. +92 −0 tests/phpunit/elements/RectangleTest.php
  144. +72 −17 tests/phpunit/parserhooks/CoordinatesTest.php
  145. +48 −15 tests/phpunit/parserhooks/DisplayMapTest.php
  146. +66 −16 tests/phpunit/parserhooks/DistanceTest.php
  147. +72 −16 tests/phpunit/parserhooks/FinddestinationTest.php
  148. +23 −15 tests/phpunit/parserhooks/GeocodeTest.php
  149. +48 −16 tests/phpunit/parserhooks/GeodistanceTest.php
  150. +24 −15 tests/phpunit/parserhooks/MapsDocTest.php
  151. +77 −18 tests/phpunit/parserhooks/ParserHookTest.php
  152. +68 −0 tests/phpunit/parsers/DistanceParserTest.php
  153. +101 −0 tests/phpunit/parsers/LineParserTest.php
  154. +79 −0 tests/phpunit/parsers/LocationParserTest.php
  155. +76 −0 tests/phpunit/parsers/WmsOverlayParserTest.php
View
4 .coveralls.yml
@@ -0,0 +1,4 @@
+# for php-coveralls
+service_name: travis-ci
+src_dir: includes
+coverage_clover: build/logs/clover.xml
View
8 .gitignore
@@ -1,7 +1,13 @@
.*
*~
*.kate-swp
-.*.swp
!.gitignore
!.gitreview
+
+!.travis.yml
+!.travis.sh
+!.coveralls.yml
+
+composer.phar
+composer.lock
View
34 .travis.sh
@@ -0,0 +1,34 @@
+#! /bin/bash
+
+set -x
+
+originalDirectory=$(pwd)
+
+cd ..
+
+git clone https://gerrit.wikimedia.org/r/p/mediawiki/core.git phase3 --depth 1
+
+cd phase3
+
+mysql -e 'create database its_a_mw;'
+php maintenance/install.php --dbtype mysql --dbuser root --dbname its_a_mw --dbpath $(pwd) --pass nyan TravisWiki admin
+
+cd extensions
+cp -r $originalDirectory Maps
+
+cd Maps
+composer require satooshi/php-coveralls:dev-master
+cd ../..
+
+pwd
+ls -lap
+
+echo 'error_reporting(E_ALL| E_STRICT);' >> LocalSettings.php
+echo 'ini_set("display_errors", 1);' >> LocalSettings.php
+echo '$wgShowExceptionDetails = true;' >> LocalSettings.php
+echo '$wgDevelopmentWarnings = true;' >> LocalSettings.php
+echo "putenv( 'MW_INSTALL_PATH=$(pwd)' );" >> LocalSettings.php
+
+echo 'require_once( __DIR__ . "/extensions/Maps/Maps.php" );' >> LocalSettings.php
+
+php maintenance/update.php --quick
View
23 .travis.yml
@@ -0,0 +1,23 @@
+language: php
+
+php:
+ - 5.3
+ - 5.4
+ - 5.5
+
+before_script:
+ - bash .travis.sh
+
+script:
+ - cd ../phase3/extensions/Maps
+ - phpunit --coverage-clover ../../extensions/Maps/build/logs/clover.xml
+
+after_script:
+ - php vendor/bin/coveralls -v
+
+notifications:
+ email:
+ recipients:
+ - jeroendedauw@gmail.com
+ on_success: change
+ on_failure: always
View
76 Maps.classes.php
@@ -0,0 +1,76 @@
+<?php
+
+$classes = array();
+
+$classes['MapsHooks'] = __DIR__ . '/Maps.hooks.php';
+
+$classes['Maps\Element'] = __DIR__ . '/includes/Element.php';
+$classes['MapsMapper'] = __DIR__ . '/includes/Maps_Mapper.php';
+$classes['MapsDistanceParser'] = __DIR__ . '/includes/Maps_DistanceParser.php';
+$classes['MapsGeoFunctions'] = __DIR__ . '/includes/Maps_GeoFunctions.php';
+$classes['Maps\Geocoders'] = __DIR__ . '/includes/Geocoders.php';
+$classes['Maps\Geocoder'] = __DIR__ . '/includes/Geocoder.php';
+$classes['MapsKMLFormatter'] = __DIR__ . '/includes/Maps_KMLFormatter.php';
+$classes['MapsLayer'] = __DIR__ . '/includes/Maps_Layer.php';
+$classes['MapsLayerPage'] = __DIR__ . '/includes/Maps_LayerPage.php';
+$classes['MapsLayerGroup'] = __DIR__ . '/includes/Maps_LayerGroup.php';
+$classes['MapsLayerTypes'] = __DIR__ . '/includes/Maps_LayerTypes.php';
+$classes['MapsLayers'] = __DIR__ . '/includes/Maps_Layers.php';
+$classes['iMappingService'] = __DIR__ . '/includes/iMappingService.php';
+$classes['MapsMappingServices'] = __DIR__ . '/includes/Maps_MappingServices.php';
+$classes['MapsMappingService'] = __DIR__ . '/includes/Maps_MappingService.php';
+$classes['MapsBaseFillableElement'] = __DIR__ . '/includes/Maps_BaseFillableElement.php';
+$classes['MapsBaseStrokableElement'] = __DIR__ . '/includes/Maps_BaseStrokableElement.php';
+$classes['MapsDisplayMapRenderer'] = __DIR__ . '/includes/Maps_DisplayMapRenderer.php';
+
+$classes['MapEditorHtml'] = __DIR__ . '/includes/editor/MapEditorHTML.php';
+
+$classes['Maps\BaseElement'] = __DIR__ . '/includes/elements/BaseElement.php';
+$classes['Maps\Circle'] = __DIR__ . '/includes/elements/Circle.php';
+$classes['Maps\ImageOverlay'] = __DIR__ . '/includes/elements/ImageOverlay.php';
+$classes['Maps\Line'] = __DIR__ . '/includes/elements/Line.php';
+$classes['Maps\Location'] = __DIR__ . '/includes/elements/Location.php';
+$classes['Maps\Polygon'] = __DIR__ . '/includes/elements/Polygon.php';
+$classes['Maps\Rectangle'] = __DIR__ . '/includes/elements/Rectangle.php';
+$classes['Maps\WmsOverlay'] = __DIR__ . '/includes/elements/WmsOverlay.php';
+
+
+$classes['Maps\Api\Geocode'] = __DIR__ . '/includes/api/ApiGeocode.php';
+
+$classes['Maps\ServiceParam'] = __DIR__ . '/includes/ServiceParam.php';
+
+$classes['MapsCoordinates'] = __DIR__ . '/includes/parserhooks/Maps_Coordinates.php';
+$classes['MapsDisplayMap'] = __DIR__ . '/includes/parserhooks/Maps_DisplayMap.php';
+$classes['MapsDistance'] = __DIR__ . '/includes/parserhooks/Maps_Distance.php';
+$classes['MapsFinddestination'] = __DIR__ . '/includes/parserhooks/Maps_Finddestination.php';
+$classes['MapsGeocode'] = __DIR__ . '/includes/parserhooks/Maps_Geocode.php';
+$classes['MapsGeodistance'] = __DIR__ . '/includes/parserhooks/Maps_Geodistance.php';
+$classes['MapsMapsDoc'] = __DIR__ . '/includes/parserhooks/Maps_MapsDoc.php';
+$classes['MapsLayerDefinition'] = __DIR__ . '/includes/parserhooks/Maps_LayerDefinition.php';
+
+$classes['Maps\DistanceParser'] = __DIR__ . '/includes/parsers/DistanceParser.php';
+$classes['Maps\LineParser'] = __DIR__ . '/includes/parsers/LineParser.php';
+$classes['Maps\LocationParser'] = __DIR__ . '/includes/parsers/LocationParser.php';
+$classes['Maps\PolygonParser'] = __DIR__ . '/includes/parsers/PolygonParser.php';
+$classes['Maps\WmsOverlayParser'] = __DIR__ . '/includes/parsers/WmsOverlayParser.php';
+
+$classes['iBubbleMapElement'] = __DIR__ . '/includes/properties/iBubbleMapElement.php';
+$classes['iFillableMapElement'] = __DIR__ . '/includes/properties/iFillableMapElement.php';
+$classes['iHoverableMapElement'] = __DIR__ . '/includes/properties/iHoverableMapElement.php';
+$classes['iLinkableMapElement'] = __DIR__ . '/includes/properties/iLinkableMapElement.php';
+$classes['iStrokableMapElement'] = __DIR__ . '/includes/properties/iStrokableMapElement.php';
+
+$classes['MapsGeonamesGeocoder'] = __DIR__ . '/includes/geocoders/Maps_GeonamesGeocoder.php';
+$classes['MapsGoogleGeocoder'] = __DIR__ . '/includes/geocoders/Maps_GoogleGeocoder.php';
+
+$classes['MapsImageLayer'] = __DIR__ . '/includes/layers/Maps_ImageLayer.php';
+
+$classes['SpecialMapEditor'] = __DIR__ . '/includes/specials/SpecialMapEditor.php';
+
+$classes['Maps\Test\BaseElementTest'] = __DIR__ . '/tests/phpunit/elements/BaseElementTest.php';
+$classes['Maps\Test\LineTest'] = __DIR__ . '/tests/phpunit/elements/LineTest.php';
+$classes['Maps\Test\RectangleTest'] = __DIR__ . '/tests/phpunit/elements/RectangleTest.php';
+
+$classes['Maps\Test\ParserHookTest'] = __DIR__ . '/tests/phpunit/parserhooks/ParserHookTest.php';
+
+return $classes;
View
35 Maps.hooks.php
@@ -13,6 +13,14 @@
* @author Daniel Werner
*/
final class MapsHooks {
+ /**
+ * Helper flag indicating whether the page has been purged.
+ * @var bool
+ *
+ * TODO: Figure out a better way to do this, not requiring this flag and make sure it works with
+ * later MW versions (purging mechanism got changed somewhat around 1.18).
+ */
+ static $purgedBeforeStore = false;
/**
* Adds a link to Admin Links page.
@@ -52,6 +60,13 @@ public static function addToAdminLinks( ALTree &$admin_links_tree ) {
public static function registerUnitTests( array &$files ) {
// @codeCoverageIgnoreStart
$testFiles = array(
+ 'elements/Circle',
+ 'elements/ImageOverlay',
+ 'elements/Line',
+ 'elements/Location',
+ 'elements/Polygon',
+ 'elements/Rectangle',
+
'parserhooks/Coordinates',
'parserhooks/DisplayMap',
'parserhooks/Distance',
@@ -60,7 +75,12 @@ public static function registerUnitTests( array &$files ) {
'parserhooks/Geodistance',
'parserhooks/MapsDoc',
- 'MapsCoordinateParser',
+ 'parsers/DistanceParser',
+ 'parsers/LineParser',
+ 'parsers/LocationParser',
+ 'parsers/WmsOverlayParser',
+
+ 'Element',
'MapsDistanceParser',
);
@@ -92,15 +112,16 @@ public static function onArticleFromTitle( Title &$title, /* Article */ &$articl
* Adds global JavaScript variables.
*
* @since 1.0
- *
- * @param array &$vars
- *
- * @return boolean
+ * @see http://www.mediawiki.org/wiki/Manual:Hooks/MakeGlobalVariablesScript
+ * @param array &$vars Variables to be added into the output
+ * @param OutputPage $outputPage OutputPage instance calling the hook
+ * @return boolean true in all cases
*/
- public static function onMakeGlobalVariablesScript( array &$vars ) {
+ public static function onMakeGlobalVariablesScript( array &$vars, OutputPage $outputPage ) {
global $egMapsGlobalJSVars;
$vars['egMapsDebugJS'] = $GLOBALS['egMapsDebugJS'];
+ $vars[ 'egMapsAvailableServices' ] = $GLOBALS['egMapsAvailableServices'];
$vars += $egMapsGlobalJSVars;
@@ -181,7 +202,7 @@ public static function onParserAfterTidy( Parser &$parser, &$text ) {
self::processLayersStoreCandidate( $parser->getOutput(), $title );
- // set helper to false immediately so we won't run into jop-processing weirdness:
+ // Set helper to false immediately so we won't run into job-processing weirdness:
self::$purgedBeforeStore = false;
return true;
View
44 Maps.i18n.alias.php
@@ -17,7 +17,7 @@
'MapEditor' => array( 'محرر_الخريطة' ),
);
-/** Assamese (অসমীয়া) */
+/** Assamese (অসমীয়া) */
$specialPageAliases['as'] = array(
'MapEditor' => array( 'মানচিত্ৰ_সম্পাদক' ),
);
@@ -29,14 +29,29 @@
/** Zazaki (Zazaki) */
$specialPageAliases['diq'] = array(
- 'MapEditor' => array( 'VurnerêXerita' ),
+ 'MapEditor' => array( 'VırneréXerita' ),
+);
+
+/** Greek (Ελληνικά) */
+$specialPageAliases['el'] = array(
+ 'MapEditor' => array( 'ΕπεξεργαστήςΧαρτών' ),
+);
+
+/** Persian (فارسی) */
+$specialPageAliases['fa'] = array(
+ 'MapEditor' => array( 'ویرایشگر_نقشه' ),
);
/** Galician (galego) */
$specialPageAliases['gl'] = array(
'MapEditor' => array( 'Editor_do_mapa' ),
);
+/** Italian (italiano) */
+$specialPageAliases['it'] = array(
+ 'MapEditor' => array( 'EditorMappa' ),
+);
+
/** Japanese (日本語) */
$specialPageAliases['ja'] = array(
'MapEditor' => array( '地図編集', 'マップ編集' ),
@@ -47,6 +62,11 @@
'MapEditor' => array( '지도편집기' ),
);
+/** Luxembourgish (Lëtzebuergesch) */
+$specialPageAliases['lb'] = array(
+ 'MapEditor' => array( 'Kaartenediteur' ),
+);
+
/** Macedonian (македонски) */
$specialPageAliases['mk'] = array(
'MapEditor' => array( 'УредникНаКарти' ),
@@ -62,7 +82,27 @@
'MapEditor' => array( 'Kaarteditor' ),
);
+/** Sicilian (sicilianu) */
+$specialPageAliases['scn'] = array(
+ 'MapEditor' => array( 'EditorMappa' ),
+);
+
/** Turkish (Türkçe) */
$specialPageAliases['tr'] = array(
'MapEditor' => array( 'HaritaDüzenleyici', 'HaritaEditörü' ),
+);
+
+/** Vietnamese (Tiếng Việt) */
+$specialPageAliases['vi'] = array(
+ 'MapEditor' => array( 'Sửa_đổi_bản_đồ' ),
+);
+
+/** Simplified Chinese (中文(简体)‎) */
+$specialPageAliases['zh-hans'] = array(
+ 'MapEditor' => array( '地图编辑器' ),
+);
+
+/** Traditional Chinese (中文(繁體)‎) */
+$specialPageAliases['zh-hant'] = array(
+ 'MapEditor' => array( '地圖編輯器' ),
);
View
71 Maps.i18n.magic.php
@@ -51,7 +51,7 @@
'coordinates' => array( 0, 'إحداثيات', 'coordinates' ),
);
-/** Assamese (অসমীয়া) */
+/** Assamese (অসমীয়া) */
$magicWords['as'] = array(
'display_point' => array( 0, 'মানচিত্ৰ_প্ৰদৰ্শন' ),
);
@@ -64,7 +64,7 @@
/** Chechen (нохчийн) */
$magicWords['ce'] = array(
- 'geocode' => array( 0, 'геагишар', 'геокод', 'geocode' ),
+ 'geocode' => array( 0, 'геагишар', 'геокод' ),
);
/** German (Deutsch) */
@@ -109,8 +109,28 @@
/** French (français) */
$magicWords['fr'] = array(
+ 'display_map' => array( 0, 'afficher_carte' ),
+ 'display_point' => array( 0, 'afficher_point' ),
+ 'display_points' => array( 0, 'afficher_points' ),
+ 'display_line' => array( 0, 'afficher_ligne' ),
+ 'geocode' => array( 0, 'codegéo' ),
+ 'geodistance' => array( 0, 'distancegéo' ),
'finddestination' => array( 0, 'trouverdestination' ),
'coordinates' => array( 0, 'coordonnées' ),
+ 'distance' => array( 0, 'distance' ),
+ 'mapsdoc' => array( 0, 'doccartes' ),
+);
+
+/** Hebrew (עברית) */
+$magicWords['he'] = array(
+ 'distance' => array( 0, 'מרחק' ),
+);
+
+/** Indonesian (Bahasa Indonesia) */
+$magicWords['id'] = array(
+ 'finddestination' => array( 0, 'petunjukarah' ),
+ 'coordinates' => array( 0, 'koordinat' ),
+ 'distance' => array( 0, 'jarak' ),
);
/** Igbo (Igbo) */
@@ -123,8 +143,12 @@
'display_map' => array( 0, 'mostra_mappa' ),
'display_point' => array( 0, 'mostra_punto' ),
'display_points' => array( 0, 'mostra_punti' ),
+ 'geocode' => array( 0, 'geocodice' ),
+ 'geodistance' => array( 0, 'geodistanza' ),
+ 'finddestination' => array( 0, 'trovadestinazione' ),
'coordinates' => array( 0, 'coordinate' ),
'distance' => array( 0, 'distanza' ),
+ 'mapsdoc' => array( 0, 'docmappe' ),
);
/** Japanese (日本語) */
@@ -158,6 +182,11 @@
'mapsdoc' => array( 0, '지도문서' ),
);
+/** Kurdish (Latin script) (Kurdî (latînî)‎) */
+$magicWords['ku-latn'] = array(
+ 'coordinates' => array( 0, 'koordînat' ),
+);
+
/** Ladino (Ladino) */
$magicWords['lad'] = array(
'distance' => array( 0, 'distancia', 'distance' ),
@@ -169,6 +198,13 @@
'distance' => array( 0, 'Distanz' ),
);
+/** Minangkabau (Baso Minangkabau) */
+$magicWords['min'] = array(
+ 'finddestination' => array( 0, 'petunjukarah' ),
+ 'coordinates' => array( 0, 'koordinat' ),
+ 'distance' => array( 0, 'jarak' ),
+);
+
/** Macedonian (македонски) */
$magicWords['mk'] = array(
'display_map' => array( 0, 'прикажи_карта' ),
@@ -196,9 +232,14 @@
'distance' => array( 0, 'ദൂരം' ),
);
-/** Nedersaksisch (Nedersaksisch) */
+/** Marathi (मराठी) */
+$magicWords['mr'] = array(
+ 'distance' => array( 0, 'अंतर' ),
+);
+
+/** Low Saxon (Netherlands) (Nedersaksies) */
$magicWords['nds-nl'] = array(
- 'display_map' => array( 0, 'kaorte_weergeven' ),
+ 'display_map' => array( 0, 'kaorte_laoten_zien' ),
'geocode' => array( 0, 'geokoderen' ),
'geodistance' => array( 0, 'geo-aofstaand' ),
'finddestination' => array( 0, 'bestemmingzeuken' ),
@@ -234,20 +275,22 @@
/** Portuguese (português) */
$magicWords['pt'] = array(
- 'display_map' => array( 0, 'mostrar_mapa', 'display_map' ),
- 'display_point' => array( 0, 'mostrar_ponto', 'mostrar_pontos' ),
+ 'display_map' => array( 0, 'mostrar_mapa' ),
+ 'display_point' => array( 0, 'mostrar_ponto' ),
'display_points' => array( 0, 'mostrar_pontos' ),
- 'geocode' => array( 0, 'geocódigo', 'geocode' ),
- 'geodistance' => array( 0, 'geodistância', 'geodistance' ),
- 'finddestination' => array( 0, 'encontrardestino', 'finddestination' ),
- 'coordinates' => array( 0, 'coordenadas', 'coordinates' ),
- 'distance' => array( 0, 'distância', 'distance' ),
+ 'geocode' => array( 0, 'geocódigo' ),
+ 'geodistance' => array( 0, 'geodistância' ),
+ 'finddestination' => array( 0, 'encontrardestino' ),
+ 'coordinates' => array( 0, 'coordenadas' ),
+ 'distance' => array( 0, 'distância' ),
);
/** Russian (русский) */
$magicWords['ru'] = array(
'display_map' => array( 0, 'показать_карту' ),
'display_point' => array( 0, 'показать_точку' ),
+ 'display_points' => array( 0, 'показать_точки' ),
+ 'display_line' => array( 0, 'показать_линию' ),
'geocode' => array( 0, 'геокод' ),
'geodistance' => array( 0, 'георасстояние' ),
'finddestination' => array( 0, 'найти_местоположение' ),
@@ -298,7 +341,13 @@
'distance' => array( 0, 'відстань' ),
);
+/** Uzbek (oʻzbekcha) */
+$magicWords['uz'] = array(
+ 'coordinates' => array( 0, 'koordinatalar' ),
+);
+
/** Vietnamese (Tiếng Việt) */
$magicWords['vi'] = array(
+ 'geocode' => array( 0, 'mãhóađịalý', 'mãhoáđịalý', 'mãhóađịalí', 'mãhoáđịalí' ),
'coordinates' => array( 0, 'tọađộ' ),
);
View
1,810 Maps.i18n.php
1,664 additions, 146 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
521 Maps.php
@@ -15,7 +15,7 @@
*/
/**
- * This documenation group collects source code files belonging to Maps.
+ * This documentation group collects source code files belonging to Maps.
*
* Please do not use this group name for other code. If you have an extension to
* Maps, please use your own group definition.
@@ -27,340 +27,217 @@
die( 'Not an entry point.' );
}
-if ( version_compare( $wgVersion , '1.18c' , '<' ) ) {
- die( '<b>Error:</b> This version of Maps requires MediaWiki 1.18 or above; use Maps 1.0.x for MediaWiki 1.17 and Maps 0.7.x for older versions.' );
+if ( defined( 'Maps_VERSION' ) ) {
+ // Do not initialize more then once.
+ return;
}
-// Include the Validator extension if that hasn't been done yet, since it's required for Maps to work.
-if ( !defined( 'Validator_VERSION' ) ) {
- @include_once( __DIR__ . '/../Validator/Validator.php' );
+define( 'Maps_VERSION' , '3.0 alpha' );
+
+// Include the composer autoloader if it is present.
+if ( is_readable( __DIR__ . '/vendor/autoload.php' ) ) {
+ include_once( __DIR__ . '/vendor/autoload.php' );
+}
+
+// Attempt to include the ParamProcessor lib if that has not been loaded yet.
+if ( !defined( 'ParamProcessor_VERSION' ) && file_exists( __DIR__ . '/../Validator/Validator.php' ) ) {
+ include_once( __DIR__ . '/../Validator/Validator.php' );
+}
+
+// Attempt to include the DataValues lib if that has not been loaded yet.
+if ( !defined( 'DataValues_VERSION' ) && file_exists( __DIR__ . '/../DataValues/DataValues.php' ) ) {
+ include_once( __DIR__ . '/../DataValues/DataValues.php' );
}
// Only initialize the extension when all dependencies are present.
-if ( !defined( 'Validator_VERSION' ) ) {
- die( '<b>Error:</b> You need to have <a href="http://www.mediawiki.org/wiki/Extension:Validator">Validator</a> installed in order to use <a href="http://www.mediawiki.org/wiki/Extension:Maps">Maps</a>.<br />' );
+if ( !defined( 'ParamProcessor_VERSION' ) ) {
+ throw new Exception( 'You need to have ParamProcessor (Validator) 1.0 or later installed in order to use Maps' );
}
-define( 'Maps_VERSION' , '2.1 alpha' );
-
-$wgExtensionCredits['parserhook'][] = array(
- 'path' => __FILE__ ,
- 'name' => 'Maps' ,
- 'version' => Maps_VERSION ,
- 'author' => array(
- '[http://www.mediawiki.org/wiki/User:Jeroen_De_Dauw Jeroen De Dauw]'
- ) ,
- 'url' => 'https://www.mediawiki.org/wiki/Extension:Maps' ,
- 'descriptionmsg' => 'maps-desc'
-);
-
-// The different coordinate notations.
-define( 'Maps_COORDS_FLOAT' , 'float' );
-define( 'Maps_COORDS_DMS' , 'dms' );
-define( 'Maps_COORDS_DM' , 'dm' );
-define( 'Maps_COORDS_DD' , 'dd' );
-
-$egMapsScriptPath = ( $wgExtensionAssetsPath === false ? $wgScriptPath . '/extensions' : $wgExtensionAssetsPath ) . '/Maps';
-$egMapsDir = __DIR__ . '/';
-
-$egMapsStyleVersion = $wgStyleVersion . '-' . Maps_VERSION;
-
-$wgAutoloadClasses['MapsHooks'] = __DIR__ . '/Maps.hooks.php';
-
-// Autoload the "includes/" classes and interfaces.
-$wgAutoloadClasses['MapsMapper'] = __DIR__ . '/includes/Maps_Mapper.php';
-$wgAutoloadClasses['MapsCoordinateParser'] = __DIR__ . '/includes/Maps_CoordinateParser.php';
-$wgAutoloadClasses['MapsDistanceParser'] = __DIR__ . '/includes/Maps_DistanceParser.php';
-$wgAutoloadClasses['MapsGeoFunctions'] = __DIR__ . '/includes/Maps_GeoFunctions.php';
-$wgAutoloadClasses['MapsGeocoders'] = __DIR__ . '/includes/Maps_Geocoders.php';
-$wgAutoloadClasses['MapsGeocoder'] = __DIR__ . '/includes/Maps_Geocoder.php';
-$wgAutoloadClasses['MapsKMLFormatter'] = __DIR__ . '/includes/Maps_KMLFormatter.php';
-$wgAutoloadClasses['MapsLayer'] = __DIR__ . '/includes/Maps_Layer.php';
-$wgAutoloadClasses['MapsLayerPage'] = __DIR__ . '/includes/Maps_LayerPage.php';
-$wgAutoloadClasses['MapsLayerGroup'] = __DIR__ . '/includes/Maps_LayerGroup.php';
-$wgAutoloadClasses['MapsLayerTypes'] = __DIR__ . '/includes/Maps_LayerTypes.php';
-$wgAutoloadClasses['MapsLayers'] = __DIR__ . '/includes/Maps_Layers.php';
-$wgAutoloadClasses['MapsLocation'] = __DIR__ . '/includes/Maps_Location.php';
-$wgAutoloadClasses['MapsLine'] = __DIR__ . '/includes/Maps_Line.php';
-$wgAutoloadClasses['MapsPolygon'] = __DIR__ . '/includes/Maps_Polygon.php';
-$wgAutoloadClasses['MapsCircle'] = __DIR__ . '/includes/Maps_Circle.php';
-$wgAutoloadClasses['MapsRectangle'] = __DIR__ . '/includes/Maps_Rectangle.php';
-$wgAutoloadClasses['MapsImageOverlay'] = __DIR__ . '/includes/Maps_ImageOverlay.php';
-$wgAutoloadClasses['iMappingService'] = __DIR__ . '/includes/iMappingService.php';
-$wgAutoloadClasses['MapsMappingServices'] = __DIR__ . '/includes/Maps_MappingServices.php';
-$wgAutoloadClasses['MapsMappingService'] = __DIR__ . '/includes/Maps_MappingService.php';
-$wgAutoloadClasses['MapsWmsOverlay'] = __DIR__ . '/includes/Maps_WmsOverlay.php';
-$wgAutoloadClasses['MapsBaseElement'] = __DIR__ . '/includes/Maps_BaseElement.php';
-$wgAutoloadClasses['MapsBaseFillableElement'] = __DIR__ . '/includes/Maps_BaseFillableElement.php';
-$wgAutoloadClasses['MapsBaseStrokableElement'] = __DIR__ . '/includes/Maps_BaseStrokableElement.php';
-$wgAutoloadClasses['MapsDisplayMapRenderer'] = __DIR__ . '/includes/Maps_DisplayMapRenderer.php';
-
-$wgAutoloadClasses['ApiGeocode'] = __DIR__ . '/includes/api/ApiGeocode.php';
-
-$wgAutoloadClasses['iBubbleMapElement'] = __DIR__ . '/includes/properties/iBubbleMapElement.php';
-$wgAutoloadClasses['iFillableMapElement'] = __DIR__ . '/includes/properties/iFillableMapElement.php';
-$wgAutoloadClasses['iHoverableMapElement'] = __DIR__ . '/includes/properties/iHoverableMapElement.php';
-$wgAutoloadClasses['iLinkableMapElement'] = __DIR__ . '/includes/properties/iLinkableMapElement.php';
-$wgAutoloadClasses['iStrokableMapElement'] = __DIR__ . '/includes/properties/iStrokableMapElement.php';
-
-// Autoload Geo Validators
-$wgAutoloadClasses['GeoValidator'] = __DIR__ . '/includes/validators/GeoValidator.php';
-$wgAutoloadClasses['LocationValidator'] = __DIR__ . '/includes/validators/LocationValidator.php';
-$wgAutoloadClasses['LineValidator'] = __DIR__ . '/includes/validators/LineValidator.php';
-$wgAutoloadClasses['PolygonValidator'] = __DIR__ . '/includes/validators/PolygonValidator.php';
-$wgAutoloadClasses['RectangleValidator'] = __DIR__ . '/includes/validators/RectangleValidator.php';
-$wgAutoloadClasses['CircleValidator'] = __DIR__ . '/includes/validators/CircleValidator.php';
-
-// Autoload the "includes/criteria/" classes.
-// TODO: migrate to Params
-$wgAutoloadClasses['CriterionIsDistance'] = __DIR__ . '/includes/criteria/CriterionIsDistance.php';
-$wgAutoloadClasses['CriterionIsImage'] = __DIR__ . '/includes/criteria/CriterionIsImage.php';
-$wgAutoloadClasses['CriterionIsLocation'] = __DIR__ . '/includes/criteria/CriterionIsLocation.php';
-$wgAutoloadClasses['CriterionMapDimension'] = __DIR__ . '/includes/criteria/CriterionMapDimension.php';
-$wgAutoloadClasses['CriterionMapLayer'] = __DIR__ . '/includes/criteria/CriterionMapLayer.php';
-$wgAutoloadClasses['CriterionLine'] = __DIR__ . '/includes/criteria/CriterionLine.php';
-$wgAutoloadClasses['CriterionPolygon'] = __DIR__ . '/includes/criteria/CriterionPolygon.php';
-$wgAutoloadClasses['CriterionSearchMarkers'] = __DIR__ . '/includes/criteria/CriterionSearchMarkers.php';
-$wgAutoloadClasses['CriterionIsNonNumeric'] = __DIR__ . '/includes/criteria/CriterionIsNonNumeric.php';
-
-$wgAutoloadClasses['MapsGeonamesGeocoder'] = __DIR__ . '/includes/geocoders/Maps_GeonamesGeocoder.php';
-$wgAutoloadClasses['MapsGoogleGeocoder'] = __DIR__ . '/includes/geocoders/Maps_GoogleGeocoder.php';
-
-$wgAutoloadClasses['MapsImageLayer'] = __DIR__ . '/includes/layers/Maps_ImageLayer.php';
-$wgAutoloadClasses['MapsKMLLayer'] = __DIR__ . '/includes/layers/Maps_KMLLayer.php';
-
-// Autoload the "includes/manipulations/" classes.
-// TODO: migrate to Params
-$manDir = __DIR__ . '/includes/manipulations/';
-$wgAutoloadClasses['MapsCommonParameterManipulation'] = $manDir . 'Maps_CommonParameterManipulation.php';
-$wgAutoloadClasses['MapsParamDimension'] = $manDir . 'Maps_ParamDimension.php';
-$wgAutoloadClasses['MapsParamFile'] = $manDir . 'Maps_ParamFile.php';
-$wgAutoloadClasses['MapsParamGeoService'] = $manDir . 'Maps_ParamGeoService.php';
-$wgAutoloadClasses['MapsParamLocation'] = $manDir . 'Maps_ParamLocation.php';
-$wgAutoloadClasses['MapsParamZoom'] = $manDir . 'Maps_ParamZoom.php';
-$wgAutoloadClasses['MapsParamLine'] = $manDir . 'Maps_ParamLine.php';
-$wgAutoloadClasses['MapsParamPolygon'] = $manDir . 'Maps_ParamPolygon.php';
-$wgAutoloadClasses['MapsParamCircle'] = $manDir . 'Maps_ParamCircle.php';
-$wgAutoloadClasses['MapsParamRectangle'] = $manDir . 'Maps_ParamRectangle.php';
-$wgAutoloadClasses['MapsParamImageOverlay'] = $manDir . 'Maps_ParamImageOverlay.php';
-$wgAutoloadClasses['MapsParamWmsOverlay'] = $manDir . 'Maps_ParamWmsOverlay.php';
-$wgAutoloadClasses['MapsParamLayerDefinition'] = $manDir . 'Maps_ParamLayerDefinition.php';
-$wgAutoloadClasses['MapsParamSwitchIfGreaterThan'] = $manDir . 'Maps_ParamSwitchIfGreaterThan.php';
-unset( $manDir );
-
-$paramDir = __DIR__ . '/includes/params/';
-$wgAutoloadClasses['MapsServiceParam'] = $paramDir . 'Maps_ServiceParam.php';
-unset( $paramDir );
-
-// Autoload the "includes/parserhooks/" classes.
-$wgAutoloadClasses['MapsCoordinates'] = __DIR__ . '/includes/parserhooks/Maps_Coordinates.php';
-$wgAutoloadClasses['MapsDisplayMap'] = __DIR__ . '/includes/parserhooks/Maps_DisplayMap.php';
-$wgAutoloadClasses['MapsDistance'] = __DIR__ . '/includes/parserhooks/Maps_Distance.php';
-$wgAutoloadClasses['MapsFinddestination'] = __DIR__ . '/includes/parserhooks/Maps_Finddestination.php';
-$wgAutoloadClasses['MapsGeocode'] = __DIR__ . '/includes/parserhooks/Maps_Geocode.php';
-$wgAutoloadClasses['MapsGeodistance'] = __DIR__ . '/includes/parserhooks/Maps_Geodistance.php';
-$wgAutoloadClasses['MapsMapsDoc'] = __DIR__ . '/includes/parserhooks/Maps_MapsDoc.php';
-$wgAutoloadClasses['MapsLayerDefinition'] = __DIR__ . '/includes/parserhooks/Maps_LayerDefinition.php';
-
-// Load the special pages
-$wgAutoloadClasses['SpecialMapEditor'] = __DIR__ . '/includes/specials/SpecialMapEditor.php';
-
-$wgAutoloadClasses['Maps\Test\ParserHookTest'] = __DIR__ . '/tests/phpunit/parserhooks/ParserHookTest.php';
-
-$wgExtensionMessagesFiles['Maps'] = __DIR__ . '/Maps.i18n.php';
-$wgExtensionMessagesFiles['MapsMagic'] = __DIR__ . '/Maps.i18n.magic.php';
-$wgExtensionMessagesFiles['MapsNamespaces'] = __DIR__ . '/Maps.i18n.namespaces.php';
-$wgExtensionMessagesFiles['MapsAlias'] = __DIR__ . '/Maps.i18n.alias.php';
-
-
-$wgAPIModules['geocode'] = 'ApiGeocode';
-
-// Register the initialization function of Maps.
-$wgExtensionFunctions[] = 'efMapsSetup';
-
-// Since 0.2
-$wgHooks['AdminLinks'][] = 'MapsHooks::addToAdminLinks';
-
-// Since 0.6.5
-$wgHooks['UnitTestsList'][] = 'MapsHooks::registerUnitTests';
-
-// Since 0.7.1
-$wgHooks['ArticleFromTitle'][] = 'MapsHooks::onArticleFromTitle';
-
-// Since 1.0
-$wgHooks['MakeGlobalVariablesScript'][] = 'MapsHooks::onMakeGlobalVariablesScript';
-
-// Since ??
-$wgHooks['CanonicalNamespaces'][] = 'MapsHooks::onCanonicalNamespaces';
-
-// since dw1:
-$wgHooks['LoadExtensionSchemaUpdates'][] = 'MapsHooks::onLoadExtensionSchemaUpdates';
-$wgHooks['ArticlePurge' ][] = 'MapsHooks::onArticlePurge';
-$wgHooks['LinksUpdateConstructed' ][] = 'MapsHooks::onLinksUpdateConstructed';
-$wgHooks['ParserAfterTidy' ][] = 'MapsHooks::onParserAfterTidy';
-$wgHooks['ParserClearState' ][] = 'MapsHooks::onParserClearState';
-
-$egMapsFeatures = array();
-
-# Parser hooks
-
-# Required for #coordinates.
-$wgHooks['ParserFirstCallInit'][] = 'MapsCoordinates::staticInit';
-# Required for #display_map.
-$wgHooks['ParserFirstCallInit'][] = 'MapsDisplayMap::staticInit';
-# Required for #distance.
-$wgHooks['ParserFirstCallInit'][] = 'MapsDistance::staticInit';
-# Required for #finddestination.
-$wgHooks['ParserFirstCallInit'][] = 'MapsFinddestination::staticInit';
-# Required for #geocode.
-$wgHooks['ParserFirstCallInit'][] = 'MapsGeocode::staticInit';
-# Required for #geodistance.
-$wgHooks['ParserFirstCallInit'][] = 'MapsGeodistance::staticInit';
-# Required for #mapsdoc.
-$wgHooks['ParserFirstCallInit'][] = 'MapsMapsDoc::staticInit';
-# Required for #layer.
-$wgHooks['ParserFirstCallInit'][] = 'MapsLayerDefinition::staticInit';
-$wgHooks['LanguageGetMagic'][] = 'MapsLayerDefinition::staticMagic';
-
-# Geocoders
-
-# Registration of the GeoNames service geocoder.
-$wgHooks['GeocoderFirstCallInit'][] = 'MapsGeonamesGeocoder::register';
-
-# Registration of the Google Geocoding (v2) service geocoder.
-$wgHooks['GeocoderFirstCallInit'][] = 'MapsGoogleGeocoder::register';
-
-# Layers
-
-# Registration of the image layer type.
-$wgHooks['MappingLayersInitialization'][] = 'MapsImageLayer::register';
-
-# Registration of the KML layer type.
-$wgHooks['MappingLayersInitialization'][] = 'MapsKMLLayer::register';
-
-# Mapping services
-
-# Include the mapping services that should be loaded into Maps.
-# Commenting or removing a mapping service will make Maps completely ignore it, and so improve performance.
-
-# Google Maps API v3
-include_once $egMapsDir . 'includes/services/GoogleMaps3/GoogleMaps3.php';
-
-# OpenLayers API
-include_once $egMapsDir . 'includes/services/OpenLayers/OpenLayers.php';
-
-# WMF OSM
-// TODO
-//include_once $egMapsDir . 'includes/services/OSM/OSM.php';
-
-$egMapsSettings = array();
-
-// Include the settings file.
-require_once $egMapsDir . 'Maps_Settings.php';
-
-define( 'Maps_NS_LAYER' , $egMapsNamespaceIndex + 0 );
-define( 'Maps_NS_LAYER_TALK' , $egMapsNamespaceIndex + 1 );
-
-$wgResourceModules['ext.maps.common'] = array(
- 'localBasePath' => __DIR__ . '/includes' ,
- 'remoteBasePath' => $egMapsScriptPath . '/includes' ,
- 'group' => 'ext.maps' ,
- 'messages' => array(
- 'maps-load-failed' ,
- ) ,
- 'scripts' => array(
- 'ext.maps.common.js'
- )
-);
-
-$wgResourceModules['ext.maps.coord'] = array(
- 'localBasePath' => __DIR__ . '/includes' ,
- 'remoteBasePath' => $egMapsScriptPath . '/includes' ,
- 'group' => 'ext.maps' ,
- 'messages' => array(
- 'maps-abb-north' ,
- 'maps-abb-east' ,
- 'maps-abb-south' ,
- 'maps-abb-west' ,
- ) ,
- 'scripts' => array(
- 'ext.maps.coord.js'
- )
-);
-
-$wgResourceModules['ext.maps.resizable'] = array(
- 'dependencies' => 'jquery.ui.resizable'
-);
-
-$wgResourceModules['ext.maps.layers'] = array(
- 'localBasePath' => __dir__ . '/includes',
- 'remoteBasePath' => $egMapsScriptPath . '/includes',
- 'group' => 'ext.maps',
- 'styles' => array(
- 'ext.maps.layers.css'
- )
-);
-
-$wgResourceModules['mapeditor'] = array(
- 'dependencies' => array( 'ext.maps.common','jquery.ui.autocomplete','jquery.ui.slider', 'jquery.ui.dialog' ),
- 'localBasePath' => __DIR__ . '/includes/editor/',
- 'remoteBasePath' => $egMapsScriptPath. '/includes/editor/',
- 'group' => 'mapeditor',
- 'scripts' => array(
- 'js/jquery.miniColors.js',
- 'js/mapeditor.iefixes.js',
- 'js/mapeditor.js',
- ),
- 'styles' => array(
- 'css/jquery.miniColors.css',
- 'css/mapeditor.css'
- ),
- 'messages' => array(
- 'mapeditor-parser-error',
- 'mapeditor-none-text',
- 'mapeditor-done-button',
- 'mapeditor-remove-button',
- 'mapeditor-import-button',
- 'mapeditor-export-button',
- 'mapeditor-import-button2',
- 'mapeditor-select-button',
- 'mapeditor-mapparam-button',
- 'mapeditor-clear-button',
- 'mapeditor-imageoverlay-button'
- )
-);
-
-$wgAvailableRights[] = 'geocode';
-
-# Users that can geocode. By default the same as those that can edit.
-foreach ( $wgGroupPermissions as $group => $rights ) {
- if ( array_key_exists( 'edit' , $rights ) ) {
- $wgGroupPermissions[$group]['geocode'] = $wgGroupPermissions[$group]['edit'];
- }
+// Only initialize the extension when all dependencies are present.
+if ( !defined( 'DataValues_VERSION' ) ) {
+ throw new Exception( 'You need to have DataValues installed in order to use Maps' );
}
-$egMapsGlobalJSVars = array();
+if ( version_compare( $GLOBALS['wgVersion'], '1.18c' , '<' ) ) {
+ throw new Exception( 'This version of Maps requires MediaWiki 1.18 or above; use Maps 1.0.x for MediaWiki 1.17 and Maps 0.7.x for older versions.' );
+}
-/**
- * Initialization function for the Maps extension.
- *
- * @since 0.1
- *
- * @return true
- */
-function efMapsSetup() {
- wfRunHooks( 'MappingServiceLoad' );
- wfRunHooks( 'MappingFeatureLoad' );
+call_user_func( function() {
+ global $wgExtensionCredits, $wgExtensionAssetsPath, $wgScriptPath, $wgAutoloadClasses;
+ global $wgResourceModules, $wgGroupPermissions, $egMapsNamespaceIndex, $wgStyleVersion;
+ global $egMapsScriptPath, $egMapsStyleVersion, $wgHooks, $wgExtensionMessagesFiles;
+
+ $wgExtensionCredits['parserhook'][] = array(
+ 'path' => __FILE__ ,
+ 'name' => 'Maps' ,
+ 'version' => Maps_VERSION ,
+ 'author' => array(
+ '[http://www.mediawiki.org/wiki/User:Jeroen_De_Dauw Jeroen De Dauw]'
+ ) ,
+ 'url' => 'https://www.mediawiki.org/wiki/Extension:Maps' ,
+ 'descriptionmsg' => 'maps-desc'
+ );
+
+ // The different coordinate notations.
+ define( 'Maps_COORDS_FLOAT' , 'float' );
+ define( 'Maps_COORDS_DMS' , 'dms' );
+ define( 'Maps_COORDS_DM' , 'dm' );
+ define( 'Maps_COORDS_DD' , 'dd' );
+
+ $egMapsScriptPath = ( $wgExtensionAssetsPath === false ? $wgScriptPath . '/extensions' : $wgExtensionAssetsPath ) . '/Maps';
+ $egMapsDir = __DIR__ . '/';
+
+ $egMapsStyleVersion = $wgStyleVersion . '-' . Maps_VERSION;
+
+ $wgExtensionMessagesFiles['Maps'] = __DIR__ . '/Maps.i18n.php';
+ $wgExtensionMessagesFiles['MapsMagic'] = __DIR__ . '/Maps.i18n.magic.php';
+ $wgExtensionMessagesFiles['MapsNamespaces'] = __DIR__ . '/Maps.i18n.namespaces.php';
+ $wgExtensionMessagesFiles['MapsAlias'] = __DIR__ . '/Maps.i18n.alias.php';
+
+ $wgAutoloadClasses = array_merge( $wgAutoloadClasses, include 'Maps.classes.php' );
+
+ $wgResourceModules = array_merge( $wgResourceModules, include 'Maps.resources.php' );
+
+ $wgAPIModules['geocode'] = 'Maps\Api\Geocode';
+
+ // Register the initialization function of Maps.
+ $GLOBALS['wgExtensionFunctions'][] = function () {
+ wfRunHooks( 'MappingServiceLoad' );
+ wfRunHooks( 'MappingFeatureLoad' );
+
+ if ( in_array( 'googlemaps3', $GLOBALS['egMapsAvailableServices'] ) ) {
+ global $wgSpecialPages, $wgSpecialPageGroups;
+
+ $wgSpecialPages['MapEditor'] = 'SpecialMapEditor';
+ $wgSpecialPageGroups['MapEditor'] = 'maps';
+ }
+
+ return true;
+ };
+
+ $wgHooks['AdminLinks' ][] = 'MapsHooks::addToAdminLinks';
+ $wgHooks['UnitTestsList' ][] = 'MapsHooks::registerUnitTests';
+ $wgHooks['ArticleFromTitle' ][] = 'MapsHooks::onArticleFromTitle';
+ $wgHooks['MakeGlobalVariablesScript' ][] = 'MapsHooks::onMakeGlobalVariablesScript';
+ $wgHooks['CanonicalNamespaces' ][] = 'MapsHooks::onCanonicalNamespaces';
+ $wgHooks['LoadExtensionSchemaUpdates'][] = 'MapsHooks::onLoadExtensionSchemaUpdates';
+ $wgHooks['ArticlePurge' ][] = 'MapsHooks::onArticlePurge';
+ $wgHooks['LinksUpdateConstructed' ][] = 'MapsHooks::onLinksUpdateConstructed';
+ $wgHooks['ParserAfterTidy' ][] = 'MapsHooks::onParserAfterTidy';
+ $wgHooks['ParserClearState' ][] = 'MapsHooks::onParserClearState';
+
+ // Parser hooks
+
+ // Required for #coordinates.
+ $wgHooks['ParserFirstCallInit'][] = function( Parser &$parser ) {
+ $instance = new MapsCoordinates();
+ return $instance->init( $parser );
+ };
+
+ $wgHooks['ParserFirstCallInit'][] = function( Parser &$parser ) {
+ $instance = new MapsDisplayMap();
+ return $instance->init( $parser );
+ };
+
+ $wgHooks['ParserFirstCallInit'][] = function( Parser &$parser ) {
+ $instance = new MapsDistance();
+ return $instance->init( $parser );
+ };
- if ( in_array( 'googlemaps3', $GLOBALS['egMapsAvailableServices'] ) ) {
- global $wgSpecialPages, $wgSpecialPageGroups;
+ $wgHooks['ParserFirstCallInit'][] = function( Parser &$parser ) {
+ $instance = new MapsFinddestination();
+ return $instance->init( $parser );
+ };
- $wgSpecialPages['MapEditor'] = 'SpecialMapEditor';
- $wgSpecialPageGroups['MapEditor'] = 'maps';
+ $wgHooks['ParserFirstCallInit'][] = function( Parser &$parser ) {
+ $instance = new MapsGeocode();
+ return $instance->init( $parser );
+ };
+
+ $wgHooks['ParserFirstCallInit'][] = function( Parser &$parser ) {
+ $instance = new MapsGeodistance();
+ return $instance->init( $parser );
+ };
+
+ $wgHooks['ParserFirstCallInit'][] = function( Parser &$parser ) {
+ $instance = new MapsMapsDoc();
+ return $instance->init( $parser );
+ };
+
+ $wgHooks['ParserFirstCallInit'][] = function( Parser &$parser ) {
+ $instance = new MapsLayerDefinition();
+ return $instance->init( $parser );
+ };
+
+ // Geocoders
+
+ // Registration of the GeoNames service geocoder.
+ $wgHooks['GeocoderFirstCallInit'][] = 'MapsGeonamesGeocoder::register';
+
+ // Registration of the Google Geocoding (v2) service geocoder.
+ $wgHooks['GeocoderFirstCallInit'][] = 'MapsGoogleGeocoder::register';
+
+ // Layers
+
+ // Registration of the image layer type.
+ $wgHooks['MappingLayersInitialization'][] = 'MapsImageLayer::register';
+
+ // Mapping services
+
+ // Include the mapping services that should be loaded into Maps.
+ // Commenting or removing a mapping service will make Maps completely ignore it, and so improve performance.
+
+ // Google Maps API v3
+ // TODO: improve loading mechanism
+ include_once $egMapsDir . 'includes/services/GoogleMaps3/GoogleMaps3.php';
+
+ // OpenLayers API
+ // TODO: improve loading mechanism
+ include_once $egMapsDir . 'includes/services/OpenLayers/OpenLayers.php';
+
+ // Leaflet API
+ // TODO: improve loading mechanism
+ include_once $egMapsDir . 'includes/services/Leaflet/Leaflet.php';
+
+
+ require_once __DIR__ . '/Maps_Settings.php';
+
+ define( 'Maps_NS_LAYER' , $egMapsNamespaceIndex + 0 );
+ define( 'Maps_NS_LAYER_TALK' , $egMapsNamespaceIndex + 1 );
+
+ $wgAvailableRights[] = 'geocode';
+
+ // Users that can geocode. By default the same as those that can edit.
+ foreach ( $wgGroupPermissions as $group => $rights ) {
+ if ( array_key_exists( 'edit' , $rights ) ) {
+ $wgGroupPermissions[$group]['geocode'] = $wgGroupPermissions[$group]['edit'];
+ }
}
- return true;
-}
+ global $wgParamDefinitions;
+
+ $wgParamDefinitions['mappingservice'] = array(
+ 'definition'=> 'Maps\ServiceParam',
+ );
+
+ $wgParamDefinitions['mapslocation'] = array(
+ 'string-parser' => 'Maps\LocationParser',
+ );
+
+ $wgParamDefinitions['mapsline'] = array(
+ 'string-parser' => 'Maps\LineParser',
+ );
+
+ $wgParamDefinitions['mapspolygon'] = array(
+ 'string-parser' => 'Maps\PolygonParser',
+ );
-$egParamDefinitions['mappingservice'] = 'MapsServiceParam';
+ $wgParamDefinitions['distance'] = array(
+ 'string-parser' => 'Maps\DistanceParser',
+ );
+ $wgParamDefinitions['wmsoverlay'] = array(
+ 'string-parser' => 'Maps\WmsOverlayParser',
+ );
+} );
View
90 Maps.resources.php
@@ -0,0 +1,90 @@
+<?php
+
+/**
+ * Definition of Maps resource loader modules.
+ *
+ * @since 3.0
+ *
+ * @file
+ * @ingroup Maps
+ *
+ * @licence GNU GPL v2+
+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
+ * @author Daniel Werner < daniel.a.r.werner@gmail.com >
+ *
+ * @codeCoverageIgnoreStart
+ */
+return call_user_func( function() {
+
+ $moduleTemplate = array(
+ 'localBasePath' => __DIR__ . '/includes',
+ 'remoteExtPath' => 'Maps/includes',
+ 'group' => 'ext.maps'
+ );
+
+ return array(
+ 'ext.maps.common' => $moduleTemplate + array(
+ 'messages' => array(
+ 'maps-load-failed',
+ ) ,
+ 'scripts' => array(
+ 'ext.maps.common.js',
+ ),
+ ),
+
+ 'ext.maps.layers' => $moduleTemplate + array(
+ 'styles' => array(
+ 'ext.maps.layers.css'
+ )
+ ),
+
+ 'ext.maps.coord' => $moduleTemplate + array(
+ 'messages' => array(
+ 'maps-abb-north',
+ 'maps-abb-east',
+ 'maps-abb-south',
+ 'maps-abb-west',
+ ),
+ 'scripts' => array(
+ 'ext.maps.coord.js'
+ ),
+ ),
+
+ 'ext.maps.resizable' => $moduleTemplate + array(
+ 'dependencies' => 'jquery.ui.resizable',
+ ),
+
+ 'mapeditor' => $moduleTemplate + array(
+ 'scripts' => array(
+ 'editor/js/jquery.miniColors.js',
+ 'editor/js/mapeditor.iefixes.js',
+ 'editor/js/mapeditor.js',
+ ),
+ 'styles' => array(
+ 'editor/css/jquery.miniColors.css',
+ 'editor/css/mapeditor.css',
+ ),
+ 'messages' => array(
+ 'mapeditor-parser-error',
+ 'mapeditor-none-text',
+ 'mapeditor-done-button',
+ 'mapeditor-remove-button',
+ 'mapeditor-import-button',
+ 'mapeditor-export-button',
+ 'mapeditor-import-button2',
+ 'mapeditor-select-button',
+ 'mapeditor-mapparam-button',
+ 'mapeditor-clear-button',
+ 'mapeditor-imageoverlay-button',
+ ),
+ 'dependencies' => array(
+ 'ext.maps.common',
+ 'jquery.ui.autocomplete',
+ 'jquery.ui.slider',
+ 'jquery.ui.dialog',
+ ),
+ ),
+ );
+
+} );
+// @codeCoverageIgnoreEnd
View
247 Maps_Settings.php
@@ -19,97 +19,105 @@
die( 'Not an entry point.' );
}
+global $egMapsAvailableServices, $egMapsDefaultService, $egMapsDefaultServices;
+// Mapping services configuration
-# Mapping services configuration
-
- # Array of String. Array containing all the mapping services that will be made available to the user.
+ // Array of String. Array containing all the mapping services that will be made available to the user.
$egMapsAvailableServices = array(
'googlemaps3',
'openlayers',
- //'osm'
+ 'leaflet',
);
- # String. The default mapping service, which will be used when no default
- # service is present in the $egMapsDefaultServices array for a certain feature.
- # A service that supports all features is recommended. This service needs to be
- # enabled, if not, the first one from the available services will be taken.
+ // String. The default mapping service, which will be used when no default
+ // service is present in the $egMapsDefaultServices array for a certain feature.
+ // A service that supports all features is recommended. This service needs to be
+ // enabled, if not, the first one from the available services will be taken.
$egMapsDefaultService = 'googlemaps3';
- # Array of String. The default mapping service for each feature, which will be
- # used when no valid service is provided by the user. Each service needs to be
- # enabled, if not, the first one from the available services will be taken.
- # Note: The default service needs to be available for the feature you set it
- # for, since it's used as a fallback mechanism.
+ // Array of String. The default mapping service for each feature, which will be
+ // used when no valid service is provided by the user. Each service needs to be
+ // enabled, if not, the first one from the available services will be taken.
+ // Note: The default service needs to be available for the feature you set it
+ // for, since it's used as a fallback mechanism.
$egMapsDefaultServices = array(
'display_map' => $egMapsDefaultService,
);
-# Geocoding
-
- # Array of String. Array containing all the geocoding services that will be
- # made available to the user. Currently Maps provides the following services:
- # geonames, google
- # It is recommended that when using GeoNames you get a GeoNames webservice account
- # at http://www.geonames.org/login and set the username to $egMapsGeoNamesUser below.
- # Not doing this will result into a legacy service being used, which might be
- # disabled at some future point.
+// Geocoding
+
+global $egMapsAvailableGeoServices, $egMapsDefaultGeoService, $egMapsUserGeoOverrides;
+global $egMapsAllowCoordsGeocoding, $egMapsEnableGeoCache, $egMapsGeoNamesUser;
+
+ // Array of String. Array containing all the geocoding services that will be
+ // made available to the user. Currently Maps provides the following services:
+ // geonames, google
+ // It is recommended that when using GeoNames you get a GeoNames webservice account
+ // at http://www.geonames.org/login and set the username to $egMapsGeoNamesUser below.
+ // Not doing this will result into a legacy service being used, which might be
+ // disabled at some future point.
$egMapsAvailableGeoServices = array(
'geonames',
'google',
);
- # String. The default geocoding service, which will be used when no service is
- # is provided by the user. This service needs to be enabled, if not, the first
- # one from the available services will be taken.
+ // String. The default geocoding service, which will be used when no service is
+ // is provided by the user. This service needs to be enabled, if not, the first
+ // one from the available services will be taken.
$egMapsDefaultGeoService = 'geonames';
- # Boolean. Indicates if geocoders can override the default geoservice based on
- # the used mapping service.
+ // Boolean. Indicates if geocoders can override the default geoservice based on
+ // the used mapping service.
$egMapsUserGeoOverrides = true;
- # Boolean. Sets if coordinates should be allowed in geocoding calls.
+ // Boolean. Sets if coordinates should be allowed in geocoding calls.
$egMapsAllowCoordsGeocoding = true;
- # Boolean. Sets if geocoded addresses should be stored in a cache.
+ // Boolean. Sets if geocoded addresses should be stored in a cache.
$egMapsEnableGeoCache = true;
- # String. GeoNames API user/application name.
- # Obtain an account here: http://www.geonames.org/login
- # Do not forget to activate your account for API usage!
+ // String. GeoNames API user/application name.
+ // Obtain an account here: http://www.geonames.org/login
+ // Do not forget to activate your account for API usage!
$egMapsGeoNamesUser = '';
-# Coordinate configuration
+// Coordinate configuration
+
+global $egMapsAvailableCoordNotations, $egMapsCoordinateNotation, $egMapsCoordinateDirectional;
+global $egMapsInternatDirectionLabels;
- # The coordinate notations that should be available.
+ // The coordinate notations that should be available.
$egMapsAvailableCoordNotations = array(
Maps_COORDS_FLOAT,
Maps_COORDS_DMS,
Maps_COORDS_DM,
Maps_COORDS_DD
);
- # Enum. The default output format of coordinates.
- # Possible values: Maps_COORDS_FLOAT, Maps_COORDS_DMS, Maps_COORDS_DM, Maps_COORDS_DD
+ // Enum. The default output format of coordinates.
+ // Possible values: Maps_COORDS_FLOAT, Maps_COORDS_DMS, Maps_COORDS_DM, Maps_COORDS_DD
$egMapsCoordinateNotation = Maps_COORDS_DMS;
- # Boolean. Indicates if coordinates should be outputted in directional notation by default.
- # Recommended to be true for Maps_COORDS_DMS and false for Maps_COORDS_FLOAT.
+ // Boolean. Indicates if coordinates should be outputted in directional notation by default.
+ // Recommended to be true for Maps_COORDS_DMS and false for Maps_COORDS_FLOAT.
$egMapsCoordinateDirectional = true;
- # Boolean. Sets if direction labels should be translated to their equivalent in the wiki language or not.
+ // Boolean. Sets if direction labels should be translated to their equivalent in the wiki language or not.
$egMapsInternatDirectionLabels = true;
-# Distance configuration
-
- # Array. A list of units (keys) and how many meters they represent (value).
- # No spaces! If the unit consists out of multiple words, just write them together.
+// Distance configuration
+
+global $egMapsDistanceUnits, $egMapsDistanceUnit, $egMapsDistanceDecimals;
+
+ // Array. A list of units (keys) and how many meters they represent (value).
+ // No spaces! If the unit consists out of multiple words, just write them together.
$egMapsDistanceUnits = array(
'm' => 1,
'meter' => 1,
@@ -125,35 +133,38 @@
'nauticalmiles' => 1852,
);
- # String. The default unit for distances.
+ // String. The default unit for distances.
$egMapsDistanceUnit = 'm';
- # Integer. The default amount of fractal digits in a distance.
+ // Integer. The default amount of fractal digits in a distance.
$egMapsDistanceDecimals = 2;
-# General map configuration
+// General map configuration
+
+global $egMapsMapWidth, $egMapsMapHeight, $egMapsSizeRestrictions, $egMapsDefaultMapCentre;
+global $egMapsDefaultTitle, $egMapsDefaultLabel, $egMapsResizableByDefault, $egMapsRezoomForKML;
- # Integer or string. The default width and height of a map. These values will
- # only be used when the user does not provide them.
+ // Integer or string. The default width and height of a map. These values will
+ // only be used when the user does not provide them.
$egMapsMapWidth = 'auto';
$egMapsMapHeight = 350;
- # Array. The minimum and maximum width and height for all maps. First min and
- # max for absolute values, then min and max for percentage values. When the
- # height or width exceed their limits, they will be changed to the closest
- # allowed value.
+ // Array. The minimum and maximum width and height for all maps. First min and
+ // max for absolute values, then min and max for percentage values. When the
+ // height or width exceed their limits, they will be changed to the closest
+ // allowed value.
$egMapsSizeRestrictions = array(
'width' => array( 50, 1020, 1, 100 ),
'height' => array( 50, 1000, 1, 100 ),
);
- # String. The default centre for maps. Can be either a set of coordinates or an address.
+ // String. The default centre for maps. Can be either a set of coordinates or an address.
$egMapsDefaultMapCentre = '0, 0';
- # Strings. The default content for all pop-ups. This value will only be used
- # when the user does not provide one.
+ // Strings. The default content for all pop-ups. This value will only be used
+ // when the user does not provide one.
$egMapsDefaultTitle = '';
$egMapsDefaultLabel = '';
@@ -163,41 +174,47 @@
-# Other general configuration
-
- # When true, debugging messages will be logged using mw.log(). Do not use on production wikis.
+// Other general configuration
+
+global $egMapsDebugJS, $egMapsNamespaceIndex, $egMapsAllowExternalImages;
+
+ // When true, debugging messages will be logged using mw.log(). Do not use on production wikis.
$egMapsDebugJS = false;
- # Namespace index start of the mapping namespaces.
+ // Namespace index start of the mapping namespaces.
$egMapsNamespaceIndex = 420;
- # Boolean. Controls if you can specify images using a full path in layers.
+ // Boolean. Controls if you can specify images using a full path in layers.
$egMapsAllowExternalImages = true;
-# Specific mapping service configuration
+// Specific mapping service configuration
- # Google Maps v3
-
- # Integer. The default zoom of a map. This value will only be used when the
- # user does not provide one.
+ // Google Maps v3
+
+global $egMapsGMaps3Zoom, $egMapsGMaps3Types, $egMapsGMaps3Type, $egMapsGMaps3Controls;
+global $egMapsGMaps3DefTypeStyle, $egMapsGMaps3DefZoomStyle, $egMapsGMaps3AutoInfoWindows;
+global $egMapsGMaps3Layers, $egMapsGMaps3DefaultTilt, $egGoogleJsApiKey, $egMapsShowPOI;
+
+ // Integer. The default zoom of a map. This value will only be used when the
+ // user does not provide one.
$egMapsGMaps3Zoom = 14;
- # Array of String. The Google Maps v3 default map types. This value will only
- # be used when the user does not provide one.
+ // Array of String. The Google Maps v3 default map types. This value will only
+ // be used when the user does not provide one.
$egMapsGMaps3Types = array(
'roadmap',
'satellite',
'hybrid',
'terrain'
);
- # String. The default map type. This value will only be used when the user
- # does not provide one.
+ // String. The default map type. This value will only be used when the user
+ // does not provide one.
$egMapsGMaps3Type = 'roadmap';
- # Array. List of controls to display onto maps by default.
+ // Array. List of controls to display onto maps by default.
$egMapsGMaps3Controls = array(
'pan',
'zoom',
@@ -206,45 +223,48 @@
'streetview'
);
- # String. The default style for the type control.
- # horizontal, vertical or default
+ // String. The default style for the type control.
+ // horizontal, vertical or default
$egMapsGMaps3DefTypeStyle = 'default';
- # String. The default style for the zoom control.
- # small, large or default
+ // String. The default style for the zoom control.
+ // small, large or default
$egMapsGMaps3DefZoomStyle = 'default';
- # Boolean. Open the info windows on load by default?
+ // Boolean. Open the info windows on load by default?
$egMapsGMaps3AutoInfoWindows = false;
- # Array. Layers to load by default.
- # traffic and bicycling
+ // Array. Layers to load by default.
+ // traffic and bicycling
$egMapsGMaps3Layers = array();
- # Integer. Default tilt when using Google Maps.
+ // Integer. Default tilt when using Google Maps.
$egMapsGMaps3DefaultTilt = 0;
- # Google JavaScript Loader API key.
- # Can be obtained at: https://code.google.com/apis/loader/signup.html
- # This key is needed when using Google Earth or when using extended
- # limits for displaying maps or geocoding calls.
+ // Google JavaScript Loader API key.
+ // Can be obtained at: https://code.google.com/apis/loader/signup.html
+ // This key is needed when using Google Earth or when using extended
+ // limits for displaying maps or geocoding calls.
$egGoogleJsApiKey = '';
- # Show points of interest or not.
+ // Show points of interest or not.
$egMapsShowPOI = true;
- # OpenLayers
-
- # Integer. The default zoom of a map. This value will only be used when the
- # user does not provide one.
+ // OpenLayers
+
+global $egMapsOpenLayersZoom, $egMapsOLControls, $egMapsOLLayers, $egMapsOLAvailableLayers;
+global $egMapsOLLayerGroups, $egMapsOLLayerDependencies;
+
+ // Integer. The default zoom of a map. This value will only be used when the
+ // user does not provide one.
$egMapsOpenLayersZoom = 13;
- # Array of String. The default controls for Open Layers. This value will only
- # be used when the user does not provide one.
- # Available values: layerswitcher, mouseposition, autopanzoom, panzoom,
- # panzoombar, scaleline, navigation, keyboarddefaults, overviewmap, permalink
+ // Array of String. The default controls for Open Layers. This value will only
+ // be used when the user does not provide one.
+ // Available values: layerswitcher, mouseposition, autopanzoom, panzoom,
+ // panzoombar, scaleline, navigation, keyboarddefaults, overviewmap, permalink
$egMapsOLControls = array(
'layerswitcher',
'mouseposition',
@@ -253,16 +273,18 @@
'navigation'
);
- # Array of String. The default layers for Open Layers. This value will only be
- # used when the user does not provide one.
+ // Array of String. The default layers for Open Layers. This value will only be
+ // used when the user does not provide one.
$egMapsOLLayers = array(
'osm-mapnik',
'osm-cyclemap',
'osmarender'
);
- # The difinitions for the layers that should be available for the user.
- $egMapsOLAvailableLayers = array(
+ // The difinitions for the layers that should be available for the user.
+ $egMapsOLAvailableLayers = array(
+ //'google' => array( 'OpenLayers.Layer.Google("Google Streets")' ),
+
'bing-normal' => array( 'OpenLayers.Layer.VirtualEarth( "Bing Streets", {type: VEMapStyle.Shaded, "sphericalMercator":true} )', 'bing' ),
'bing-satellite' => array( 'OpenLayers.Layer.VirtualEarth( "Bing Satellite", {type: VEMapStyle.Aerial, "sphericalMercator":true} )', 'bing' ),
'bing-hybrid' => array( 'OpenLayers.Layer.VirtualEarth( "Bing Hybrid", {type: VEMapStyle.Hybrid, "sphericalMercator":true} )', 'bing' ),
@@ -284,34 +306,33 @@
{layers: "landsat7", "sphericalMercator":true} )',
);
- # Layer group definitions. Group names must be different from layer names, and
- # must only contain layers that are present in $egMapsOLAvailableLayers.
+ // Layer group definitions. Group names must be different from layer names, and
+ // must only contain layers that are present in $egMapsOLAvailableLayers.
$egMapsOLLayerGroups = array(
'yahoo' => array( 'yahoo-normal', 'yahoo-satellite', 'yahoo-hybrid' ),
'bing' => array( 'bing-normal', 'bing-satellite', 'bing-hybrid' ),
'google' => array( 'google-normal', 'google-satellite', 'google-terrain', 'google-hybrid' ),
'osm' => array( 'osmarender', 'osm-mapnik', 'osm-cyclemap' ),
);
-
- # Layer dependencies
+
+ global $wgJsMimeType;
+
+ // Layer dependencies
$egMapsOLLayerDependencies = array(
'yahoo' => "<style type='text/css'> #controls {width: 512px;}</style><script src='http://api.maps.yahoo.com/ajaxymap?v=3.0&appid=euzuro-openlayers'></script>",
'bing' => "<script type='$wgJsMimeType' src='http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.1'></script>",
'ol-wms' => "<script type='$wgJsMimeType' src='http://clients.multimap.com/API/maps/1.1/metacarta_04'></script>",
'google' => "<script src='http://maps.google.com/maps/api/js?sensor=false'></script>",
);
-
-
-
- # OpenStreetMap
-
- # Integer. The default zoom of a map. This value will only be used when the
- # user does not provide one.
- $egMapsOSMZoom = 13;
-
- # Boolean. Thumbnail pictures on or off.
- $egMapsOSMThumbs = false;
-
- # Boolean. Photos in article pop-ups on or off.
- $egMapsOSMPhotos = false;
+ // Leaflet
+
+global $egMapsLeafletZoom;
+
+ // Integer. The default zoom of a map. This value will only be used when the
+ // user does not provide one.
+ $egMapsLeafletZoom = 14;
+
+
+global $egMapsGlobalJSVars;
+$egMapsGlobalJSVars = array();
View
62 README
@@ -1,62 +0,0 @@
-These is the readme file for the Maps extension.
-
-Extension page on mediawiki.org: https://www.mediawiki.org/wiki/Extension:Maps
-Latest version of the readme file: https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/Maps.git;a=blob;f=README
-
-== About ==
-
-Maps is the MediaWiki extension that provides the ability to visualize geographic data
-with dynamic, JavaScript based, mapping API's such as Google Maps and OpenLayers in your
-wiki pages. It has build in support for geocoding, displaying maps, displaying markers,
-adding pop-ups, and more. Maps allows extensive customization of your maps, either per
-map, or via a general setting affecting all maps on your wiki.
-
-Due to Maps modular build, modifying the mapping service of a map is as easy as changing
-a single map property! These mapping services include Google Maps, Yahoo! Maps, OpenLayers
-and OpenStreetMap. These also allow you to display maps with Google Earth, OpenStreetMaps,
-Bing maps and others.
-
-Notes on installing Maps are found in the file INSTALL.
-
-
-== Contributing ==
-
-If you have bug reports or requests, please add them to the Talk page [0]. You can also
-send them to Jeroen De Dauw, jeroendedauw -at- gmail.com, and Yaron Koren, at yaron57 -at-
-gmail.com.
-
-[0] http://www.mediawiki.org/w/index.php?title=Extension_talk:Maps
-
-For more info, see http://mapping.referata.com/wiki/Mapping_on_MediaWiki
-
-== Credits to other projects ==
-
-=== jQuery ===
-
-This extension uses code from the jQuery library.
-jQuery is dual licensed under the MIT [0] and GPL [1] licenses.
-
-=== OpenLayers ===
-
-This extension includes code from the OpenLayers application.
-OpenLayers is an open-source product released under a BSD-style license [2].
-
-=== geoxml3 ===
-
-This extension includes a copy of the geoxml3 KML processor.
-geoxml3 is released under the Apache License 2.0 license [3].
-
-=== google-maps-utility-library-v3 ===
-
-This extension icnludes code from the google-maps-utility-library-v3 (googleearth.js).
-It is released under the Apache License 2.0 license [3].
-
-=== OpenStreetMap.js ===
-
-This extension includes the OpenStreetMap.js file which can be found here:
-http://www.openstreetmap.org/openlayers/OpenStreetMap.js
-
-[0] http://www.opensource.org/licenses/mit-license.php
-[1] http://www.opensource.org/licenses/gpl-license.php
-[2] http://svn.openlayers.org/trunk/openlayers/license.txt
-[3] http://www.apache.org/licenses/LICENSE-2.0
View
73 README.md
@@ -0,0 +1,73 @@
+# Maps
+
+Maps is the MediaWiki extension that provides the ability to visualize geographic data
+with dynamic, JavaScript based, mapping API's such as Google Maps and OpenLayers in your
+wiki pages. It has build in support for geocoding, displaying maps, displaying markers,
+adding pop-ups, and more. Maps allows extensive customization of your maps, either per
+map, or via a general setting affecting all maps on your wiki.
+
+Due to Maps modular build, modifying the mapping service of a map is as easy as changing
+a single map property! These mapping services include Google Maps, Yahoo! Maps, OpenLayers
+and OpenStreetMap. These also allow you to display maps with Google Earth, OpenStreetMaps,
+Bing maps and others.
+
+[![Build Status](https://secure.travis-ci.org/wikimedia/mediawiki-extensions-Maps.png?branch=master)](http://travis-ci.org/wikimedia/mediawiki-extensions-Maps)
+[![Coverage Status](https://coveralls.io/repos/wikimedia/mediawiki-extensions-Maps/badge.png?branch=master)](https://coveralls.io/r/wikimedia/mediawiki-extensions-Maps?branch=master)
+[![Dependency Status](https://www.versioneye.com/php/mediawiki:maps/dev-master/badge.png)](https://www.versioneye.com/php/mediawiki:maps/dev-master)
+
+On [Packagist](https://packagist.org/packages/mediawiki/maps):
+[![Latest Stable Version](https://poser.pugx.org/mediawiki/maps/version.png)](https://packagist.org/packages/mediawiki/maps)
+[![Download count](https://poser.pugx.org/mediawiki/maps/d/total.png)](https://packagist.org/packages/mediawiki/maps)
+
+Notes on installing Maps are found in the file INSTALL.
+
+## Contributing
+
+If you have bug reports or requests, please add them to
+[the Talk page](https://www.mediawiki.org/wiki/Extension_talk:Maps).
+You can also send them to Jeroen De Dauw, jeroendedauw -at- gmail.com,
+and Yaron Koren, at yaron57 -at- gmail.com.
+
+
+## Credits to other projects
+
+### jQuery
+
+This extension uses code from the jQuery library.
+jQuery is dual licensed under the
+[MIT](http://www.opensource.org/licenses/mit-license.php)
+and
+[GPL](http://www.opensource.org/licenses/gpl-license.php)
+licenses.
+
+### OpenLayers
+
+This extension includes code from the OpenLayers application.
+OpenLayers is an open-source product released under a
+[BSD-style license](http://svn.openlayers.org/trunk/openlayers/license.txt).
+
+### geoxml3
+
+This extension includes a copy of the geoxml3 KML processor.
+geoxml3 is released under the
+[Apache License 2.0 license](http://www.apache.org/licenses/LICENSE-2.0).
+
+### google-maps-utility-library-v3
+
+This extension includes code from the google-maps-utility-library-v3 (googleearth.js).
+It is released under the
+[Apache License 2.0 license](http://www.apache.org/licenses/LICENSE-2.0).
+
+### OpenStreetMap.js
+
+This extension includes the OpenStreetMap.js file which can be found here:
+http://www.openstreetmap.org/openlayers/OpenStreetMap.js
+
+## Links
+
+* [Maps examples](https://semantic-mediawiki.org/wiki/Maps_examples)
+* [Maps on Ohloh](https://www.ohloh.net/p/maps)
+* [Maps on MediaWiki.org](https://www.mediawiki.org/wiki/Extension:Maps)
+* [Maps on Packagist](https://packagist.org/packages/mediawiki/maps)
+* [TravisCI build status](https://travis-ci.org/wikimedia/mediawiki-extensions-Maps)
+* [Semantic Maps on MediaWiki.org](https://www.mediawiki.org/wiki/Extension:Semantic_Maps)
View
34 RELEASE-NOTES
@@ -4,12 +4,37 @@ Extension page on mediawiki.org: https://www.mediawiki.org/wiki/Extension:Maps
Latest version of the release notes: https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/Maps.git;a=blob;f=RELEASE-NOTES
-=== Maps 2.1 ===
+=== Maps 3.0 ===
(dev)
+In this version a big part of the PHP codebase has been rewritten to decrease technical debt and thus
+facilatete maintenance, new feature delopment and debugging. Many tests have been added and a lot of
+bugs have been found and fixed. No big new features have been added.
+
+; Compatibility changes
+
+* Changed minimum Validator version from 0.5 to 1.0.
+* DataValues is now required. Version 0.1 or later.
+* ValueParsers is now required. Version 0.1 or later.
+* ValueFormatters is now required. Version 0.1 or later.
+
+; New features
+
+* Added leaflet service
+
+; Breaking internal changes
+
+* Moved classes into Maps namespace
+* Removed all Criteria classes