diff --git a/.gitignore b/.gitignore
index e6124c968..18089b7cf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,13 +1,11 @@
-.*
*~
*.kate-swp
-!.gitignore
-!.gitreview
+!.*
+.idea/
-!.travis.yml
-!.travis.sh
-!.coveralls.yml
+vendor/
+extensions/
composer.phar
composer.lock
\ No newline at end of file
diff --git a/.scrutinizer.yml b/.scrutinizer.yml
new file mode 100644
index 000000000..e455f06ba
--- /dev/null
+++ b/.scrutinizer.yml
@@ -0,0 +1,12 @@
+inherit: true
+
+tools:
+ php_code_coverage: false
+ php_code_sniffer: true
+ php_cpd: true
+ php_cs_fixer: true
+ php_loc: true
+ php_mess_detector: true
+ php_pdepend: true
+ php_analyzer: true
+ sensiolabs_security_checker: true
\ No newline at end of file
diff --git a/.travis.yml b/.travis.yml
index 7bfc4e4ad..3f84e908f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,23 +1,32 @@
language: php
-php:
- - 5.3
- - 5.4
- - 5.5
+env:
+ - THENEEDFORTHIS=FAIL
-before_script:
- - bash .travis.sh
+matrix:
+ include:
+ - env: DBTYPE=mysql; MW=master
+ php: 5.3
+ - env: DBTYPE=mysql; MW=1.19.0
+ php: 5.4
+ - env: DBTYPE=mysql; MW=1.21.0
+ php: 5.5
+ - env: DBTYPE=sqlite; MW=master
+ php: 5.4
+ - env: DBTYPE=sqlite; MW=1.19.0
+ php: 5.5
+ exclude:
+ - env: THENEEDFORTHIS=FAIL
-script:
- - cd ../phase3/extensions/Maps
- - phpunit --coverage-clover ../../extensions/Maps/build/logs/clover.xml
+before_script: bash ./build/travis/before_script.sh
-after_script:
- - php vendor/bin/coveralls -v
+script: bash ./build/travis/script.sh
+
+after_success: bash ./build/travis/after_success.sh
notifications:
- email:
- recipients:
- - jeroendedauw@gmail.com
- on_success: change
- on_failure: always
\ No newline at end of file
+ irc:
+ channels:
+ - "chat.freenode.net#semantic-mediawiki"
+ on_success: never
+ on_failure: always
diff --git a/INSTALL b/INSTALL
deleted file mode 100644
index a2f7100cf..000000000
--- a/INSTALL
+++ /dev/null
@@ -1,46 +0,0 @@
-This is the install file for the Maps extension.
-
-Extension page on mediawiki.org: https://www.mediawiki.org/wiki/Extension:Maps
-Latest version of the install file: https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/Maps.git;a=blob;f=INSTALL
-
-
-== Requirements ==
-
-Maps requires:
-
-* MediaWiki 1.18 or above
-* PHP 5.3 or above
-* Validator 0.4.13 or above
-
-Not up to specs yet? Maybe you can use Maps 1.0.x which requires:
-
-* MediaWiki 1.17 or above
-* PHP 5.2 or above
-* Validator 0.4.11 or above
-
-== Download ==
-
-You can find the current version of Maps on the Google Code download page [0],
-as well as a list of legacy downloads [1].
-
-[0] https://code.google.com/p/mwmaps/downloads/list
-[1] https://code.google.com/p/mwmaps/downloads/list?can=1
-
-You can also get the code directly from SVN. Tags can be obtained via
-
- svn checkout http://svn.wikimedia.org/svnroot/mediawiki/tags/extensions/Maps/REL_version
-
-Where 'version' is the version number of the tag, such as 0_1
-(see the available tags at http://svn.wikimedia.org/svnroot/mediawiki/tags/extensions/Maps/).
-
-The latest code can be obtained from trunk:
-
- svn checkout http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/Maps/
-
-== Installation ==
-
-Once you have downloaded the code, place the ''Maps'' directory within your MediaWiki
-'extensions' directory. Then add the following code to your [[Manual:LocalSettings.php|LocalSettings.php]] file:
-
-# Maps
-require_once( "$IP/extensions/Maps/Maps.php" );
\ No newline at end of file
diff --git a/Maps.classes.php b/Maps.classes.php
deleted file mode 100644
index a5b7acc75..000000000
--- a/Maps.classes.php
+++ /dev/null
@@ -1,76 +0,0 @@
-
* @author Daniel Werner
@@ -47,51 +44,6 @@ public static function addToAdminLinks( ALTree &$admin_links_tree ) {
return true;
}
- /**
- * Hook to add PHPUnit test cases.
- * @see https://www.mediawiki.org/wiki/Manual:Hooks/UnitTestsList
- *
- * @since 0.7
- *
- * @param array &$files
- *
- * @return boolean
- */
- 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',
- 'parserhooks/Finddestination',
- 'parserhooks/Geocode',
- 'parserhooks/Geodistance',
- 'parserhooks/MapsDoc',
-
- 'parsers/DistanceParser',
- 'parsers/LineParser',
- 'parsers/LocationParser',
- 'parsers/WmsOverlayParser',
-
- 'Element',
- 'MapsDistanceParser',
- );
-
- foreach ( $testFiles as $file ) {
- $files[] = __DIR__ . '/tests/phpunit/' . $file . 'Test.php';
- }
-
- return true;
- // @codeCoverageIgnoreEnd
- }
-
/**
* Intercept pages in the Layer namespace to handle them correctly.
*
diff --git a/Maps.i18n.alias.php b/Maps.i18n.alias.php
index ee89d8414..36e1806d4 100644
--- a/Maps.i18n.alias.php
+++ b/Maps.i18n.alias.php
@@ -4,6 +4,7 @@
/** English
* @author netbrain
*/
+// @codingStandardsIgnoreFile
$specialPageAliases = array();
diff --git a/Maps.i18n.magic.php b/Maps.i18n.magic.php
index 9173d13bd..563d98a7f 100644
--- a/Maps.i18n.magic.php
+++ b/Maps.i18n.magic.php
@@ -1,9 +1,7 @@
array( 0, 'عرض_الخريطه', 'عرض_الخريطة', 'display_map' ),
- 'geocode' => array( 0, 'كود_جغرافي', 'geocode' ),
- 'geodistance' => array( 0, 'مسافه_جغرافيه', 'مسافة_جغرافية', 'geodistance' ),
- 'finddestination' => array( 0, 'إيجاد_الوجهه', 'إيجاد_الوجهة', 'finddestination' ),
- 'coordinates' => array( 0, 'إحداثيات', 'coordinates' ),
+ 'display_map' => array( 0, 'عرض_الخريطه', 'عرض_الخريطة' ),
+ 'geocode' => array( 0, 'كود_جغرافي' ),
+ 'geodistance' => array( 0, 'مسافه_جغرافيه', 'مسافة_جغرافية' ),
+ 'finddestination' => array( 0, 'إيجاد_الوجهه', 'إيجاد_الوجهة' ),
+ 'coordinates' => array( 0, 'إحداثيات' ),
);
/** Assamese (অসমীয়া) */
@@ -83,16 +81,16 @@
/** Zazaki (Zazaki) */
$magicWords['diq'] = array(
- 'display_map' => array( 0, 'aseniya_xerita' ),
+ 'display_map' => array( 0, 'aseniya_ğerita' ),
'display_point' => array( 0, 'aseniya_dewti' ),
'display_points' => array( 0, 'aseniya_dawıtan' ),
- 'display_line' => array( 0, 'aseniya_xeter' ),
+ 'display_line' => array( 0, 'aseniya_ğeter' ),
'geocode' => array( 0, 'herunkodi' ),
'geodistance' => array( 0, 'heruna_mesafi' ),
'finddestination' => array( 0, 'menzilvinayış' ),
'coordinates' => array( 0, 'koordinati' ),
'distance' => array( 0, 'mesafe' ),
- 'mapsdoc' => array( 0, 'dokumanêxerita' ),
+ 'mapsdoc' => array( 0, 'dokumanéğerita' ),
);
/** Esperanto (Esperanto) */
@@ -348,6 +346,6 @@
/** 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độ' ),
+ 'geocode' => array( 0, 'mã_hóa_địa_lý', 'mãhóađịalý', 'mã_hoá_địa_lý', 'mãhoáđịalý', 'mã_hóa_địa_lí', 'mãhóađịalí', 'mã_hoá_địa_lí', 'mãhoáđịalí' ),
+ 'coordinates' => array( 0, 'tọa_độ', 'tọađộ' ),
);
\ No newline at end of file
diff --git a/Maps.i18n.php b/Maps.i18n.php
index 01ed10575..2b565a6c4 100644
--- a/Maps.i18n.php
+++ b/Maps.i18n.php
@@ -2,9 +2,6 @@
/**
* Internationalization file for the Maps extension.
*
- * @file Maps.i18n.php
- * @ingroup Maps
- *
* @author Jeroen De Dauw
*/
@@ -16,17 +13,19 @@
*/
$messages['en'] = array(
// General
- 'maps-desc' => "Enables embedding of dynamic maps into wiki pages, geocoding of addresses and other geographical operations. ([http://www.semantic-mediawiki.org/wiki/Maps more info...])",
+ 'maps-desc' => "Enables embedding of dynamic maps into wiki pages, geocoding of addresses and other geographical operations. ([https://www.semantic-mediawiki.org/wiki/Maps more info...])",
'right-geocode' => 'Geocode',
'maps_map' => 'Map',
+ 'maps-tracking-category' => 'Pages with a map rendered by the Maps extension',
'maps-loading-map' => 'Loading map...',
'maps-load-failed' => 'Could not load the map!',
'maps-markers' => 'Markers',
'maps-copycoords-prompt' => 'CTRL+C, ENTER',
'maps-searchmarkers-text' => 'Filter markers',
'maps-others' => 'others',
+ 'maps-kml-parsing-failed' => 'Failed parsing one or more KML files, usually due to retrieval failure or malformed XML.',
//TODO: move to namespaces i18n
'maps-ns-layer' => 'Layer',
'maps-ns-layer-talk' => 'Layer talk',
@@ -131,6 +130,10 @@
'maps-displaymap-par-static' => 'If the map should be static',
'maps-displaymap-par-wmsoverlay' => 'Use a WMS overlay',
+ 'maps-fullscreen-button' => 'Toggle fullscreen',
+ 'maps-fullscreen-button-tooltip' => 'View the map as fullscreen or embedded.',
+ 'maps-googlemaps3-par-enable-fullscreen' => 'Enable fullscreen button',
+
// Validation
'validation-error-invalid-location' => 'Parameter "$1" must be a valid location.',
'validation-error-invalid-locations' => 'Parameter "$1" must be one or more valid locations.',
@@ -265,8 +268,14 @@
'maps-desc' => '{{desc|name=Maps|url=http://www.mediawiki.org/wiki/Extension:Maps}}',
'right-geocode' => '{{doc-right|geocode}}',
'maps_map' => '{{Identical|Map}}',
- 'maps-copycoords-prompt' => 'text displayed in javascript prompt to indicate first press ctrl+c to copy text, and press enter to close prompt',
+ 'maps-tracking-category' => 'The name of a category for all pages which use the display_map parser extension function or tag.
+
+The category is automatically added unless the feature is disabled.',
+ 'maps-copycoords-prompt' => 'text displayed in JavaScript prompt to indicate first press ctrl+c to copy text, and press enter to close prompt',
+ 'maps-searchmarkers-text' => 'Used as default value for input box of the Search form. (Looks like placeholder.)',
'maps-others' => '{{Identical|Other}}',
+ 'maps-kml-parsing-failed' => 'text displayed in the event of parsing failure of kml file(s).',
+ 'maps-ns-layer' => '{{Identical|Layer}}',
'maps-layer-property' => '{{Identical|Property}}',
'maps-layer-value' => '{{Identical|Value}}',
'maps-layer-errors' => '{{Identical|Error}}',
@@ -288,6 +297,11 @@
'maps-layer-type-supported-by' => 'Parameters:
* $1 - list of supported services (geonames and/or google). not localized.
* $2 - number of supported services',
+ 'maps-fullscreen-button' => 'Text displayed in the map as a button to toggle fullscreen view.
+
+Tooltip for this button is {{msg-mw|Maps-fullscreen-button-tooltip}}.',
+ 'maps-fullscreen-button-tooltip' => 'Text displayed when hovering over the button which is labeled {{msg-mw|Maps-fullscreen-button}}.',
+ 'maps-googlemaps3-par-enable-fullscreen' => '{{maps-par|googlemaps3|enablefullscreen}}',
'validation-error-invalid-location' => 'Parameters:
* $1 - parameter name
{{Related|Maps-validation}}',
@@ -406,7 +420,8 @@
'mapeditor-form-field-fillopcaity' => 'Form field name',
'mapeditor-form-field-showonhover' => 'Checkbox text',
'mapeditor-mapparam-title' => 'Title of dialogue',
- 'mapeditor-mapparam-defoption' => 'Default option in map parameters select list',
+ 'mapeditor-mapparam-defoption' => 'Default option in map parameters select list.
+{{Identical|Select parameter}}',
'mapeditor-imageoverlay-button' => 'Button text that starts the "add image overlay process"',
'mapeditor-form-field-image' => 'Form field name.
{{Identical|Image}}',
@@ -533,15 +548,17 @@
* @author Xuacu
*/
$messages['ast'] = array(
- 'maps-desc' => 'Activa inxertar mapes dinámicos nes páxines wiki, xeocodificación de direiciones y otres operaciones xeográfiques. ([http://www.semantic-mediawiki.org/wiki/Maps más información...])',
+ 'maps-desc' => 'Activa inxertar mapes dinámicos nes páxines wiki, xeocodificación de direiciones y otres operaciones xeográfiques. ([https://www.semantic-mediawiki.org/wiki/Maps más información...])',
'right-geocode' => 'Xeocódigu',
'maps_map' => 'Mapa',
+ 'maps-tracking-category' => 'Páxines con un mapa renderizáu pola estensión Maps',
'maps-loading-map' => "Cargando'l mapa...",
'maps-load-failed' => '¡Nun se pudo cargar el mapa!',
'maps-markers' => 'Marcadores',
'maps-copycoords-prompt' => 'CTRL+C, Intro',
'maps-searchmarkers-text' => 'Peñerar marcadores',
'maps-others' => 'otros',
+ 'maps-kml-parsing-failed' => "Falló l'analís d'un ficheru KML o más, de vezu debío a un fallu na recuperación o a un XML con mal formatu.",
'maps-ns-layer' => 'Capa',
'maps-ns-layer-talk' => 'Alderique de capa',
'maps-layer-property' => 'Propiedá',
@@ -598,7 +615,7 @@
Esto pue afeutar al valor predetermináu del serviciu de xeocodificación.",
'maps-displaymap-par-mappingservice' => "Permite configurar el serviciu de mapes que s'usará pa xenerar el mapa.",
'maps-displaymap-par-coordinates' => "El llugar onde apaecerá'l centru'l mapa nel aniciu.",
- 'maps-displaymap-par-visitedicon' => "El llocal d'un ficheru a usar como iconu de visitáu",
+ 'maps-displaymap-par-visitedicon' => "El nome d'una imaxe a usar pa los iconos de marcador dempués de facer clic nellos",
'maps-displaymap-par-zoom' => "Permite configurar el nivel de zoom do mapa.
Cuando nun se da y hai múltiples marcadores presentes nel mapa, se tomará'l zoom que meyor axuste, non el valor configurable predetermináu.",
'maps-displaymap-par-centre' => 'Permite configurar les coordenaes del centru do mapa pa display_point(s).
@@ -617,6 +634,9 @@
'maps-displaymap-par-rectangles' => 'Rectángulos a amosar',
'maps-displaymap-par-static' => "Si'l mapa tien de ser estáticu",
'maps-displaymap-par-wmsoverlay' => 'Usar una superposición WMS',
+ 'maps-fullscreen-button' => 'Conmutar pantalla completa',
+ 'maps-fullscreen-button-tooltip' => 'Ver el mapa como pantalla completa o incrustáu.',
+ 'maps-googlemaps3-par-enable-fullscreen' => 'Activar el botón de pantalla completa',
'validation-error-invalid-location' => 'El parámetru $1 tien de ser un llugar válidu.',
'validation-error-invalid-locations' => 'El parámetru $1 tien de ser un o más llugares válidos.',
'validation-error-invalid-width' => 'El parámetru $1 tien de ser un anchor válidu.',
@@ -761,12 +781,12 @@
'maps-layer-value' => 'Значэньне',
'maps-layer-errors' => 'Памылкі',
'maps-error-invalid-layerdef' => 'Гэтае вызначэньне слою — няслушнае.',
- 'maps-error-invalid-layertype' => 'Няма слаёў тыпу «$1». Падтрымліваецца толькі {{PLURAL:$3|гэты тып|гэтыя тыпы}}: $2',
- 'maps-error-no-layertype' => 'Вам неабходна вызначыць тып слою. {{PLURAL:$2|Падтрымліваецца толькі гэты тып|Падтрымліваюцца толькі гэтыя тыпы}}: $1',
+ 'maps-error-invalid-layertype' => 'Няма слаёў тыпу «$1». Падтрымліваецца толькі {{PLURAL:$3|1=гэты тып|гэтыя тыпы}}: $2', # Fuzzy
+ 'maps-error-no-layertype' => 'Вам неабходна вызначыць тып слою. {{PLURAL:$2|1=Падтрымліваецца толькі гэты тып|Падтрымліваюцца толькі гэтыя тыпы}}: $1', # Fuzzy
'validation-error-invalid-layer' => 'Парамэтар $1 мусіць быць слушным слоем.',
'validation-error-invalid-layers' => 'Парамэтар $1 мусіць быць адным ці болей слушнымі слаямі.',
'maps-layer-of-type' => 'Слой тыпу $1',
- 'maps-layer-type-supported-by' => 'Гэты тып слою можа быць выкарыстаны толькі з {{PLURAL:$2|сэрвісам мапаў $1|сэрвісамі мапаў: $1}}.',
+ 'maps-layer-type-supported-by' => 'Гэты тып слою можа быць выкарыстаны толькі з {{PLURAL:$2|1=сэрвісам мапаў $1|сэрвісамі мапаў: $1}}.', # Fuzzy
'maps-coordinates-description' => 'Перахопнік парсэру для фарматаваньня каардынатаў, з і ў любыя фарматы, якія падтрымліваюцца.',
'maps-displaymap-description' => 'Паказвае геаграфічныя мапы без аніякіх вікі-пазнакаў на іх.',
'maps-displaypoint-description' => 'Паказвае геаграфічныя мапы з адной ці болей вікі-пазнакамі на іх.',
@@ -842,13 +862,13 @@
'maps-longitude' => 'Даўгата:',
'maps-invalid-coordinates' => 'Значэньне $1 зьяўляецца недапушчальным наборам каардынатаў.',
'maps_coordinates_missing' => 'Каардынаты для мапы не пазначаныя.',
- 'maps_geocoding_failed' => '{{PLURAL:$2|Наступны адрас ня можа быць геакадаваны|Наступныя адрасы ня могуць быць геакадаваныя}}: $1.
-Мапа ня можа быць паказана.',
- 'maps_geocoding_failed_for' => '{{PLURAL:$2|Наступны адрас ня можа быць геакадаваны і быў выдалены|Наступныя адрасы ня могуць быць геакадаваны і былі выдаленыя}} з мапы:
-$1',
- 'maps_unrecognized_coords' => 'Наступныя {{PLURAL:$2|каардыната не была распазнаная|каардынаты не былі распазнаныя}}: $1.',
- 'maps_unrecognized_coords_for' => '{{PLURAL:$2|Наступная каардыната не была апазнаная|Наступныя каардынаты не былі апазнаныя}} і {{PLURAL:$2|яна не паказаная|яны не паказаныя}}:
-$1',
+ 'maps_geocoding_failed' => '{{PLURAL:$2|1=Наступны адрас ня можа быць геакадаваны|Наступныя адрасы ня могуць быць геакадаваныя}}: $1.
+Мапа ня можа быць паказана.', # Fuzzy
+ 'maps_geocoding_failed_for' => '{{PLURAL:$2|1=Наступны адрас ня можа быць геакадаваны і быў выдалены|Наступныя адрасы ня могуць быць геакадаваны і былі выдаленыя}} з мапы:
+$1', # Fuzzy
+ 'maps_unrecognized_coords' => 'Наступныя {{PLURAL:$2|1=каардыната не была распазнаная|каардынаты не былі распазнаныя}}: $1.', # Fuzzy
+ 'maps_unrecognized_coords_for' => '{{PLURAL:$2|1=Наступная каардыната не была апазнаная|Наступныя каардынаты не былі апазнаныя}} і {{PLURAL:$2|1=яна не паказаная|яны не паказаныя}}:
+$1', # Fuzzy
'maps_map_cannot_be_displayed' => 'Мапа ня можа быць паказаная.',
'maps-geocoder-not-available' => 'Магчымасьць геаграфічнага кадаваньня для мапаў недаступная. Вашае месцазнаходжаньне ня можа быць геаграфічна закадаванае.',
'maps_click_to_activate' => 'Націсьніце для актывацыі мапы',
@@ -929,8 +949,10 @@
'maps-latitude' => 'Географска ширина:',
'maps-longitude' => 'Географска дължина:',
'maps-googlemaps3-incompatbrowser' => 'Вашият браузър не е съвместим с Google Maps v3.',
+ 'mapeditor-done-button' => 'Готово',
'mapeditor-remove-button' => 'Премахване',
'mapeditor-import-button2' => 'Внасяне',
+ 'mapeditor-code-title' => 'Уики код',
'mapeditor-link-title-switcher-link-text' => 'Препратка',
'mapeditor-form-field-title' => 'Заглавие',
'mapeditor-form-field-text' => 'Текст',
@@ -1015,6 +1037,7 @@
'maps-displaymap-par-maxzoom' => 'Live zoum uhelañ',
'maps-displaymap-par-minzoom' => 'Live zoum izelañ',
'maps-displaymap-par-polygons' => 'Lieskornegoù da ziskwel',
+ 'maps-fullscreen-button' => 'Gweredekaat ar skramm leun',
'validation-error-invalid-location' => "Rankout a ra an arventenn $1 bezañ evit ul lec'hiadur reizh.",
'validation-error-invalid-locations' => "Rankout a ra an arventenn $1 bezañ evit ul lec'hiadur reizh, da nebeutañ.",
'validation-error-invalid-width' => 'Rankout a ra an arventenn $1 bezañ evit ul ledander reizh.',
@@ -1141,13 +1164,17 @@
* @author Умар
*/
$messages['ce'] = array(
+ 'maps-others' => 'кхин',
'maps-layer-value' => 'МаьӀна',
- 'mapeditor-link-title-switcher-link-text' => 'Хьажориг',
+ 'maps-abb-east' => 'Цу',
+ 'mapeditor-link-title-switcher-link-text' => 'Хьажораг',
'mapeditor-form-field-title' => 'ЦӀе',
- 'mapeditor-form-field-link' => 'Хьажориг',
+ 'mapeditor-form-field-link' => 'Хьажораг',
+ 'mapeditor-form-field-image' => 'Сурт',
+ 'mapeditor-imageoverlay-title' => 'Сурт',
);
-/** Czech (česky)
+/** Czech (čeština)
* @author Mormegil
* @author Vks
*/
@@ -1222,7 +1249,7 @@
'mapeditor-form-field-visitedicon' => 'Navštívená ikona',
);
-/** Church Slavic (словѣ́ньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ)
+/** Church Slavic (словѣньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ)
* @author ОйЛ
*/
$messages['cu'] = array(
@@ -1230,13 +1257,16 @@
);
/** Danish (dansk)
+ * @author Christian List
* @author Peter Alberti
*/
$messages['da'] = array(
+ 'maps-ns-layer' => 'Lag',
'maps-abb-north' => 'N',
'maps-abb-east' => 'Ø',
'maps-abb-south' => 'S',
'maps-abb-west' => 'V',
+ 'mapeditor-form-field-text' => 'Tekst',
);
/** German (Deutsch)
@@ -1252,12 +1282,14 @@
'maps-desc' => 'Ermöglicht die Einbindung dynamischer Karten in Wikiseiten, die Georeferenzierung von Adressen und andere geographische Operationen ([https://www.semantic-mediawiki.org/wiki/Maps Weitere Informationen …])',
'right-geocode' => 'Georeferenzieren',
'maps_map' => 'Karte',
+ 'maps-tracking-category' => 'Seiten mit einer von der Maps-Erweiterung gerenderten Karte',
'maps-loading-map' => 'Die Karte wird geladen …',
'maps-load-failed' => 'Die Karte konnte nicht geladen werden.',
'maps-markers' => 'Markierungen',
'maps-copycoords-prompt' => 'STRG+C, ENTER',
'maps-searchmarkers-text' => 'Markierungen zum Filtern',
'maps-others' => 'andere',
+ 'maps-kml-parsing-failed' => 'Das Parsen einer oder mehrerer KML-Dateien ist fehlgeschlagen, normalerweise aufgrund eines Abfragefehlers oder aufgrund von fehlerhaftem XML.',
'maps-ns-layer' => 'Ebene',
'maps-ns-layer-talk' => 'Ebene Diskussion',
'maps-layer-property' => 'Attribut',
@@ -1336,16 +1368,19 @@
'maps-displaymap-par-rectangles' => 'Anzuzeigende Rechtecke',
'maps-displaymap-par-static' => 'Soll die Karte statisch sein',
'maps-displaymap-par-wmsoverlay' => 'Eine WMS-Überlagerung verwenden',
- 'validation-error-invalid-location' => 'Parameter „$1“ muss einem gültigen Standort entsprechen.',
- 'validation-error-invalid-locations' => 'Parameter „$1“ muss einem oder mehreren gültigen Standorten entsprechen.',
- 'validation-error-invalid-width' => 'Parameter„$1“ muss einer gültigen Breite entsprechen.',
- 'validation-error-invalid-height' => 'Parameter „$1“ muss einer gültigen Höhe entsprechen.',
- 'validation-error-invalid-distance' => 'Parameter „$1“ muss einer gültigen Entfernung entsprechen.',
- 'validation-error-invalid-distances' => 'Parameter „$1“ muss einer oder mehreren gültigen Entfernungen entsprechen.',
- 'validation-error-invalid-image' => 'Parameter „$1“ muss einem gültigen Bild entsprechen.',
- 'validation-error-invalid-images' => 'Parameter „$1“ muss einem oder mehreren gültigen Bildern entsprechen.',
- 'validation-error-invalid-goverlay' => 'Parameter „$1“ muss einer gültigen Überlagerung entsprechen.',
- 'validation-error-invalid-goverlays' => 'Parameter „$1“ muss einer oder mehreren gültigen Überlagerungen entsprechen.',
+ 'maps-fullscreen-button' => 'Auf Vollbild umschalten',
+ 'maps-fullscreen-button-tooltip' => 'Die Karte als Vollbild oder eingebettet darstellen.',
+ 'maps-googlemaps3-par-enable-fullscreen' => 'Vollbildbutton aktivieren',
+ 'validation-error-invalid-location' => 'Parameter $1 muss einem gültigen Standort entsprechen.',
+ 'validation-error-invalid-locations' => 'Parameter $1 muss einem oder mehreren gültigen Standorten entsprechen.',
+ 'validation-error-invalid-width' => 'Parameter $1 muss einer gültigen Breite entsprechen.',
+ 'validation-error-invalid-height' => 'Parameter $1 muss einer gültigen Höhe entsprechen.',
+ 'validation-error-invalid-distance' => 'Parameter $1 muss einer gültigen Entfernung entsprechen.',
+ 'validation-error-invalid-distances' => 'Parameter $1 muss einer oder mehreren gültigen Entfernungen entsprechen.',
+ 'validation-error-invalid-image' => 'Parameter $1 muss einem gültigen Bild entsprechen.',
+ 'validation-error-invalid-images' => 'Parameter $1 muss einem oder mehreren gültigen Bildern entsprechen.',
+ 'validation-error-invalid-goverlay' => 'Parameter $1 muss einer gültigen Überlagerung entsprechen.',
+ 'validation-error-invalid-goverlays' => 'Parameter $1 muss einer oder mehreren gültigen Überlagerungen entsprechen.',
'validation-error-invalid-line-param' => 'Der Parameter „lines“ wurde falsch angegeben.',
'validation-error-invalid-polyline-param' => 'Der Parameter „polylines“ wurde falsch angegeben.',
'validation-error-invalid-searchmarkers-param' => 'Ungültiger Wert für die Markierungen zum Filtern. Er sollte entweder „all“ oder „title“ lauten.',
@@ -1434,6 +1469,7 @@
/** Zazaki (Zazaki)
* @author Erdemaslancan
+ * @author Gorizon
* @author Mirzali
*/
$messages['diq'] = array(
@@ -1453,7 +1489,7 @@
'specialpages-group-maps' => 'Xeritey',
'mapeditor-none-text' => 'Çıniyo',
'mapeditor-done-button' => 'Qeyd ke',
- 'mapeditor-remove-button' => 'Wedarne',
+ 'mapeditor-remove-button' => 'Hewad',
'mapeditor-import-button2' => 'Azare de',
'mapeditor-code-title' => 'Wiki kode',
'mapeditor-form-title' => 'Detaya timar ke',
@@ -1470,7 +1506,7 @@
* @author Michawiki
*/
$messages['dsb'] = array(
- 'maps-desc' => 'Zmóžnijo zasajźowanje dynamiskich kórtow do wikibokow, geokoděrowanje adresow a druge geografiske akcije. ([http://www.semantic-mediawiki.org/wiki/Maps dalšne informacije...])',
+ 'maps-desc' => 'Zmóžnijo zasajźowanje dynamiskich kórtow do wikibokow, geokoděrowanje adresow a druge geografiske akcije. ([https://www.semantic-mediawiki.org/wiki/Maps dalšne informacije...])',
'maps_map' => 'Karta',
'maps-loading-map' => 'Kórta se zacytujo...',
'maps-markers' => 'Marki',
@@ -1523,13 +1559,14 @@
);
/** Greek (Ελληνικά)
+ * @author Evropi
* @author Glavkos
* @author Omnipaedista
* @author Protnet
* @author ZaDiak
*/
$messages['el'] = array(
- 'maps-desc' => 'Επιτρέπει την ενσωμάτωση δυναμικών χαρτών σε σελίδες wiki, γεωκωδικοποίηση διευθύνσεων και άλλες γεωγραφικές λειτουργίες. ([http://www.semantic-mediawiki.org/wiki/Maps περισσότερες πληροφορίες...])',
+ 'maps-desc' => 'Επιτρέπει την ενσωμάτωση δυναμικών χαρτών σε σελίδες wiki, γεωκωδικοποίηση διευθύνσεων και άλλες γεωγραφικές λειτουργίες. ([https://www.semantic-mediawiki.org/wiki/Maps περισσότερες πληροφορίες...])',
'right-geocode' => 'Γεωκωδικοποίηση',
'maps_map' => 'Χάρτης',
'maps-loading-map' => 'Φόρτωση χάρτη...',
@@ -1538,6 +1575,7 @@
'maps-copycoords-prompt' => 'CTRL+C, ENTER',
'maps-searchmarkers-text' => 'Φιλτράρισμα σημαδιών',
'maps-others' => 'άλλοι',
+ 'maps-ns-layer' => 'Στρώμα',
'maps-layer-property' => 'Ιδιότητα',
'maps-layer-value' => 'Τιμή',
'maps-layer-errors' => 'Σφάλματα',
@@ -1679,6 +1717,7 @@
* @author Crazymadlover
* @author Dferg
* @author Diego Grez
+ * @author Fitoschido
* @author Imre
* @author Locos epraix
* @author MarcoAurelio
@@ -1689,13 +1728,14 @@
* @author Vivaelcelta
*/
$messages['es'] = array(
- 'maps-desc' => 'Habilita la inserción de mapas dinámicos en páginas wikis, la geocodificación de direcciones y otras operaciones geográficas. ([http://www.semantic-mediawiki.org/wiki/Maps Más información...])',
+ 'maps-desc' => 'Habilita la inserción de mapas dinámicos en páginas wikis, la geocodificación de direcciones y otras operaciones geográficas. ([https://www.semantic-mediawiki.org/wiki/Maps Más información...])',
'right-geocode' => 'Geocodificar',
'maps_map' => 'Mapa',
- 'maps-loading-map' => 'Cargando mapa...',
- 'maps-load-failed' => '¡No se pudo cargar el mapa!',
+ 'maps-tracking-category' => 'Páginas con un mapa de la extensión Maps',
+ 'maps-loading-map' => 'Cargando el mapa…',
+ 'maps-load-failed' => 'No se pudo cargar el mapa.',
'maps-markers' => 'Marcadores',
- 'maps-copycoords-prompt' => 'CTRL + C, ESCRIBA',
+ 'maps-copycoords-prompt' => 'Ctrl+C, Intro',
'maps-searchmarkers-text' => 'Marcadores de filtro',
'maps-others' => 'otros',
'maps-ns-layer' => 'Capa',
@@ -1755,7 +1795,7 @@
Esto puede afectar al valor predeterminado del servicio de geocodificación.',
'maps-displaymap-par-mappingservice' => 'Permite configurar el servicio de cartografía que se utilizará para generar el mapa.',
'maps-displaymap-par-coordinates' => 'La localización respecto de la cual el mapa aparecerá inicialmente centrado.',
- 'maps-displaymap-par-visitedicon' => 'El disco local de un archivo para ser utilizado como icono visitado',
+ 'maps-displaymap-par-visitedicon' => 'El disco local de un archivo para ser utilizado como icono visitado', # Fuzzy
'maps-displaymap-par-zoom' => 'Permite configurar el nivel de zoom del mapa.
Cuando no se proporciona y varios marcadores están presentes en el mapa, se tomará el mejor ajuste de zoom, y no el valor configurado por defecto.',
'maps-displaymap-par-centre' => 'Permite establecer las coordenadas del centro del mapa mediante display_point(s).
@@ -1774,6 +1814,9 @@
'maps-displaymap-par-rectangles' => 'Rectángulos a mostrar',
'maps-displaymap-par-static' => 'Si el mapa debe ser estático',
'maps-displaymap-par-wmsoverlay' => 'Utilizar una superposición WMS',
+ 'maps-fullscreen-button' => 'Activar o desactivar pantalla completa',
+ 'maps-fullscreen-button-tooltip' => 'Ver el mapa en toda la pantalla o incrustado.',
+ 'maps-googlemaps3-par-enable-fullscreen' => 'Activar el botón «Pantalla completa»',
'validation-error-invalid-location' => 'El parámetro $1 deber ser una ubicación válida.',
'validation-error-invalid-locations' => 'Parámetro $1 debe ser una o más ubicaciones válidas.',
'validation-error-invalid-width' => 'El parámetro $1 debe ser un ancho válido.',
@@ -1934,12 +1977,13 @@
);
/** Persian (فارسی)
+ * @author Ebraminio
* @author Mjbmr
* @author ZxxZxxZ
*/
$messages['fa'] = array(
'maps_map' => 'نقشه',
- 'maps-loading-map' => 'در حال بارگذاری نقشه...',
+ 'maps-loading-map' => 'در حال بارگیری نقشه...',
'maps-load-failed' => 'قادر به بارگیری نقشه نبود!',
'maps-markers' => 'نشانگرها',
'maps-others' => 'دیگران',
@@ -1986,7 +2030,7 @@
* @author ZeiP
*/
$messages['fi'] = array(
- 'maps-desc' => 'Mahdollistaa dynaamisten karttojen upottamisen wikisivuille, osoitteiden geokoodauksen ja muita karttoihin liittyviä toimintoja ([http://www.semantic-mediawiki.org/wiki/Maps lisätietoja]).',
+ 'maps-desc' => 'Mahdollistaa dynaamisten karttojen upottamisen wikisivuille, osoitteiden geokoodauksen ja muita karttoihin liittyviä toimintoja ([https://www.semantic-mediawiki.org/wiki/Maps lisätietoja]).',
'right-geocode' => 'Geokoodata',
'maps_map' => 'Kartta',
'maps-loading-map' => 'Ladataan karttaa...',
@@ -1995,6 +2039,7 @@
'maps-copycoords-prompt' => 'CTRL+C, ENTER',
'maps-searchmarkers-text' => 'Suodatuksen kohdemerkit', # Fuzzy
'maps-others' => 'muut',
+ 'maps-kml-parsing-failed' => 'Yhden tai useamman kml-tiedoston jäsentäminen epäonnistui. Todennäköinen syy on lataamisen epäonnistuminen tai viallinen XML-syntaksi.',
'maps-ns-layer' => 'Taso',
'maps-ns-layer-talk' => 'Keskustelu tasosta',
'maps-layer-property' => 'Ominaisuus',
@@ -2049,6 +2094,9 @@
'maps-displaymap-par-polygons' => 'Näytettävät monikulmiot',
'maps-displaymap-par-rectangles' => 'Näytettävät suorakulmiot',
'maps-displaymap-par-static' => 'Onko kartan on oltava staattinen',
+ 'maps-fullscreen-button' => 'Koko näytön tila',
+ 'maps-fullscreen-button-tooltip' => 'Näytä kartta koko näytön tilassa tai upotettuna.',
+ 'maps-googlemaps3-par-enable-fullscreen' => 'Koko näytön tila -painike',
'validation-error-invalid-location' => 'Parametrin $1 on oltava sallittu sijainti.',
'validation-error-invalid-locations' => 'Parametrin $1 on oltava yksi tai useampi sallittu sijainti.',
'validation-error-invalid-width' => 'Parametrin $1 on oltava sallittu leveys.',
@@ -2145,15 +2193,17 @@
* @author Wyz
*/
$messages['fr'] = array(
- 'maps-desc' => "Permet d’afficher des cartes dynamiques dans les pages du wiki, des adresses géocodées et d'autres opérations géographiques. ([http://www.semantic-mediawiki.org/wiki/Maps more info...])",
+ 'maps-desc' => "Permet d’afficher des cartes dynamiques dans les pages du wiki, des adresses géocodées et d'autres opérations géographiques. ([https://www.semantic-mediawiki.org/wiki/Maps more info...])",
'right-geocode' => 'Géocode',
'maps_map' => 'Carte',
+ 'maps-tracking-category' => 'Pages avec une carte provenant de l’extension Maps',
'maps-loading-map' => 'Chargement de la carte...',
'maps-load-failed' => 'Impossible de charger la carte !',
'maps-markers' => 'Marqueurs',
'maps-copycoords-prompt' => 'CTRL+C, ENTRÉE',
'maps-searchmarkers-text' => 'Marqueurs de filtre',
'maps-others' => 'autres',
+ 'maps-kml-parsing-failed' => 'Échec de l’analyse d’un ou plusieurs fichiers KML, le plus souvent à cause d’échecs de récupération ou de XML mal formé.',
'maps-ns-layer' => 'Couche',
'maps-ns-layer-talk' => 'Discussion couche',
'maps-layer-property' => 'Propriété',
@@ -2230,6 +2280,9 @@
'maps-displaymap-par-rectangles' => 'Rectangles à afficher',
'maps-displaymap-par-static' => 'Si la carte doit être statique',
'maps-displaymap-par-wmsoverlay' => 'Utiliser une superposition WMS',
+ 'maps-fullscreen-button' => 'Basculer en plein écran',
+ 'maps-fullscreen-button-tooltip' => 'Visualiser la carte en plein écran ou incorporé.',
+ 'maps-googlemaps3-par-enable-fullscreen' => 'Activer le bouton plein écran',
'validation-error-invalid-location' => 'Le paramètre $1 doit être un emplacement valide.',
'validation-error-invalid-locations' => 'Le paramètre $1 doit être un ou plusieurs emplacement(s) valide(s).',
'validation-error-invalid-width' => 'Le paramètre $1 doit être une largeur valide.',
@@ -2429,15 +2482,17 @@
* @author Toliño
*/
$messages['gl'] = array(
- 'maps-desc' => 'Permite incorporar mapas dinámicos, enderezos xeocodificados e outras operacións xeográficas ([http://www.semantic-mediawiki.org/wiki/Maps máis información...])',
+ 'maps-desc' => 'Permite incorporar mapas dinámicos, enderezos xeocodificados e outras operacións xeográficas ([https://www.semantic-mediawiki.org/wiki/Maps máis información...])',
'right-geocode' => 'Xeocodificar',
'maps_map' => 'Mapa',
+ 'maps-tracking-category' => 'Páxinas cun mapa renderizado coa extensión Maps',
'maps-loading-map' => 'Cargando o mapa...',
'maps-load-failed' => 'Non se puido cargar o mapa!',
'maps-markers' => 'Marcadores',
'maps-copycoords-prompt' => 'CTRL+C, ENTER',
'maps-searchmarkers-text' => 'Filtrar os marcadores',
'maps-others' => 'outros',
+ 'maps-kml-parsing-failed' => 'Erro ao analizar un ou máis ficheiros KML. Normalmente, isto débese a un erro de recuperación ou a que o XML non ten o formato axeitado.',
'maps-ns-layer' => 'Capa',
'maps-ns-layer-talk' => 'Conversa capa',
'maps-layer-property' => 'Propiedade',
@@ -2514,6 +2569,9 @@
'maps-displaymap-par-rectangles' => 'Rectángulos a mostrar',
'maps-displaymap-par-static' => 'Se o mapa debe ser estático',
'maps-displaymap-par-wmsoverlay' => 'Utilizar unha sobreposición WMS',
+ 'maps-fullscreen-button' => 'Activar ou desactivar a pantalla completa',
+ 'maps-fullscreen-button-tooltip' => 'Mostrar o mapa en pantalla completa ou incrustado.',
+ 'maps-googlemaps3-par-enable-fullscreen' => 'Activar o botón de pantalla completa',
'validation-error-invalid-location' => 'O parámetro $1 debe ser unha localización válida.',
'validation-error-invalid-locations' => 'O parámetro $1 debe ser unha ou máis localizacións válidas.',
'validation-error-invalid-width' => 'O parámetro $1 debe ser un largo válido.',
@@ -2884,15 +2942,17 @@
* @author Michawiki
*/
$messages['hsb'] = array(
- 'maps-desc' => 'Zmóžnja zasadźenje dynamiskich kartow do wikistronow, geokodowanje adresow a druhe geografiske podawki ([http://www.semantic-mediawiki.org/wiki/Maps dalše informacije...])',
+ 'maps-desc' => 'Zmóžnja zasadźenje dynamiskich kartow do wikistronow, geokodowanje adresow a druhe geografiske podawki ([https://www.semantic-mediawiki.org/wiki/Maps dalše informacije...])',
'right-geocode' => 'Geokodowanje',
'maps_map' => 'Karta',
+ 'maps-tracking-category' => 'Strony z kartu rysowanej přez rozšěrjenje Maps',
'maps-loading-map' => 'Karta so začituje...',
'maps-load-failed' => 'Karta njeda so začitać!',
'maps-markers' => 'Marki',
'maps-copycoords-prompt' => 'STRG+C, ENTER',
'maps-searchmarkers-text' => 'Filtrowy marki',
'maps-others' => 'druhe',
+ 'maps-kml-parsing-failed' => 'Parsowanje jedneje KML-dataje abo wjacorych KML-datajow je so naprašowanskeho zmylka abo zmylneho XML njeporadźiło.',
'maps-ns-layer' => 'Runina',
'maps-ns-layer-talk' => 'Diskusija runiny',
'maps-layer-property' => 'Kajkosć',
@@ -2905,8 +2965,14 @@
'validation-error-invalid-layers' => 'Parameter $1 dyrbi jedna runina abo wjacore runiny być.',
'maps-layer-of-type' => 'Runina typa $1',
'maps-layer-type-supported-by' => 'Tutón typ runiny móže so {{PLURAL:$2|jenož z kartografiskej słužbu $1|z tutej kartografiskimaj słužbomaj: $1|z tutymi kartografiskimi słužbami: $1|z tutymi kartografiskimi słužbami: $1}}.wužiwać.',
+ 'maps-coordinates-description' => 'Parserowa hóčka za formatowanje koordinatow z a do podpěranych formatow.',
'maps-displaymap-description' => 'Geografiske karty bjez we wikiju definowanych markow na nich zwobraznić.',
'maps-displaypoint-description' => 'Geografiske karty z jednym we wikiju definowanej marku abo wjace markow na nich zwobraznić.',
+ 'maps-distance-description' => 'Konwertuj distancu z pomocu wěsteje podpěraneje jednotki do jeje ekwiwalenta z pomocu druheje jednotki.',
+ 'maps-finddestination-description' => 'Cil z pomocu podateho startoweho dypka (kotryž móže w někajkim z podpěranych formatow być), spočatneho nasměrjenja a zdalenosće pytać.',
+ 'maps-geocode-description' => 'Zmóžnja geokodowanje adresow, hinak prajene, přetworja wot čłowjeka čitajomne městna do sadźbow koordinatow. Je podpěra za wjacore geokodowanske słužby, kotrež njeměli so z kartowymi słužbami zaměnić.',
+ 'maps-geodistance-description' => 'Wulič geografisku zdalenosć mjez dwěmaj dypkomaj, z a do podpěranych formatow.',
+ 'maps-mapsdoc-description' => 'Tabelu z parametrami za podatu kartěrowansku słužbu hromadźe z jich standardnymi hódnotami a wopisanjemi zwobraznić.',
'maps-mapsdoc-par-service' => 'Kartografiska słužba, za kotrejež parametery dokumentacija ma so zwobraznić.',
'maps-mapsdoc-par-language' => 'Rěč, w kotrejž dokumentacija ma so zwobraznić. Jeli přełožk k dispoziciji njesteji, budźe so jendźelšćina wužiwać.',
'maps-coordinates-par-location' => 'Koordinaty, kotrež chceš formatować.',
@@ -2933,7 +2999,7 @@
'maps-geodistance-par-mappingservice' => 'Geokodowanska słužba, kotraž ma so za geokodowanje wšěch adresow wužiwać.',
'maps-displaymap-par-mappingservice' => 'Zmóžnja nastajenje kartografiskeje słužby, kotraž ma so za generowanje karty wužiwać,',
'maps-displaymap-par-coordinates' => 'Městno, na kotrež ma so karta spočatnje centrować.',
- 'maps-displaymap-par-visitedicon' => 'Městno dataje ze symbolom za wopytane wotkazy',
+ 'maps-displaymap-par-visitedicon' => 'Mjeno wobraza, kotrež ma so za markowe symbole wužiwać, po tym zo je so na nje kliknyło.',
'maps-displaymap-par-icon' => 'Zmóžnja postajenje symbola, kotryž ma so za wšě marki wužiwać.',
'maps-displaymap-par-circles' => 'Kruhi, kotrejž maja so zwobraznić',
'maps-displaymap-par-lines' => 'Linije, kotrež maja so zwobraznić',
@@ -2943,6 +3009,9 @@
'maps-displaymap-par-rectangles' => 'Praworóžki, kotrež maja so zwobraznić',
'maps-displaymap-par-static' => 'Jeli karta ma statiska być',
'maps-displaymap-par-wmsoverlay' => 'WMS-naworštowanje wužiwać',
+ 'maps-fullscreen-button' => 'Połnu wobrazowku přepinać',
+ 'maps-fullscreen-button-tooltip' => 'Kartu jako połnu wobrazowku abo zasadźenu pokazać',
+ 'maps-googlemaps3-par-enable-fullscreen' => 'Tłóčatko połneje wobrazowki zmóžnić',
'validation-error-invalid-location' => 'Parameter $1 dyrbi płaćiwe městno być.',
'validation-error-invalid-locations' => 'Parameter $1 dyrbi jedne městno abo wjacore městna być.',
'validation-error-invalid-width' => 'Parameter $1 dyrbi płaćiwa šěrokosć być.',
@@ -2955,6 +3024,7 @@
'validation-error-invalid-goverlays' => 'Parameter $1 dyrbi jedna woršta abo wjacore woršty być.',
'validation-error-invalid-line-param' => 'Njepłaćiwy parameter "lines" podaty.',
'validation-error-invalid-polyline-param' => 'Njepłaćiwy parameter "polylines" podaty.',
+ 'validation-error-invalid-searchmarkers-param' => 'Njepłaćiwa hódnota za pytanske marki, wona měła pak "all" abo "title" być.',
'maps-abb-north' => 'S',
'maps-abb-east' => 'W',
'maps-abb-south' => 'J',
@@ -2971,6 +3041,7 @@
'maps-geocoder-not-available' => 'Funkcija geokodowanja Kartow k dispoziciji njesteji, twoje městno njehodźi so geokodować.',
'maps_click_to_activate' => 'Klikń, zo by kartu aktiwizował',
'maps_centred_on' => 'Karta na $1, $2 centrowana.',
+ 'maps-par-mappingservice' => 'Zmóžnja nastajenje kartografiskeje słužby, kotraž ma so za wutworjenje karty wužiwać,',
'maps-par-geoservice' => 'Geokodowanska słužba, kotraž ma so za konwertowanje adresow do koordinatow wužiwać.',
'maps-par-centre' => 'Městno, hdźež karta ma so centrować',
'maps-googlemaps3-incompatbrowser' => 'Twój wobhladowak njeje kompatibelny z Google Maps v3.',
@@ -2995,6 +3066,7 @@
'mapeditor-import-button2' => 'Importować',
'mapeditor-export-button' => 'Do wikikoda eksportować',
'mapeditor-import-button' => 'Z wikikoda importować',
+ 'mapeditor-select-button' => 'Tutón wjeleróžk wubrać',
'mapeditor-mapparam-button' => 'Kartowe parametry wobdźěłać',
'mapeditor-clear-button' => 'Kartu wuprózdnić',
'mapeditor-code-title' => 'Wikikod',
@@ -3007,6 +3079,7 @@
'mapeditor-form-field-link' => 'Wotkaz',
'mapeditor-form-field-icon' => 'Symbol',
'mapeditor-form-field-group' => 'Skupina',
+ 'mapeditor-form-field-inlinelabel' => 'Zasadźene pomjenjowanje',
'mapeditor-form-field-strokecolor' => 'Barba smužkow',
'mapeditor-form-field-strokeopacity' => 'Opaknosć smužkow',
'mapeditor-form-field-strokeweight' => 'Smužkowa tołstosć',
@@ -3115,7 +3188,7 @@
* @author McDutchie
*/
$messages['ia'] = array(
- 'maps-desc' => 'Permitte le incorporation de cartas dynamic in paginas wiki, le geocodification de adresses e altere operationes geographic. ([http://www.semantic-mediawiki.org/wiki/Maps plus info...])',
+ 'maps-desc' => 'Permitte le incorporation de cartas dynamic in paginas wiki, le geocodification de adresses e altere operationes geographic. ([https://www.semantic-mediawiki.org/wiki/Maps plus info...])',
'right-geocode' => 'Geocodificar',
'maps_map' => 'Carta',
'maps-loading-map' => 'Cargamento del carta…',
@@ -3454,7 +3527,7 @@
* @author Viscontino
*/
$messages['it'] = array(
- 'maps-desc' => 'Fornisce la possibilità di includere mappe dinamiche nelle pagine wiki, la geocodifica di indirizzi ed altre operazioni geografiche. ([http://www.semantic-mediawiki.org/wiki/Maps maggiori informazioni...])',
+ 'maps-desc' => 'Fornisce la possibilità di includere mappe dinamiche nelle pagine wiki, la geocodifica di indirizzi ed altre operazioni geografiche. ([https://www.semantic-mediawiki.org/wiki/Maps maggiori informazioni...])',
'right-geocode' => 'Effettua la geocodifica',
'maps_map' => 'Mappa',
'maps-loading-map' => 'Caricamento mappa ...',
@@ -3485,7 +3558,7 @@
'maps-finddestination-par-distance' => 'La distanza da percorrere.',
'maps-geocode-par-format' => 'Il formato per le coordinate risultanti.',
'maps-displaymap-par-coordinates' => 'Uno o più luoghi da mostrare sulla mappa. Verranno indicati con un marcatore.',
- 'maps-displaymap-par-visitedicon' => 'Il locale di un file da utilizzare come icona visitata',
+ 'maps-displaymap-par-visitedicon' => "Il nome di un'immagine da utilizzare come icone per i marcatori dopo che sono stati selezionati",
'maps-displaymap-par-lines' => 'Linee da visualizzare',
'maps-displaymap-par-maxzoom' => 'Il livello massimo di zoom',
'maps-displaymap-par-minzoom' => 'Il livello minimo di zoom',
@@ -3571,15 +3644,17 @@
* @author 青子守歌
*/
$messages['ja'] = array(
- 'maps-desc' => 'ウィキページへの動的な地図の埋め込み、住所の座標データへの変換、その他の地図関連の操作ができるようにする ([http://www.semantic-mediawiki.org/wiki/Maps 詳細情報...])',
+ 'maps-desc' => 'ウィキページへの動的な地図の埋め込み、住所の座標データへの変換、その他の地図関連の操作ができるようにする ([https://www.semantic-mediawiki.org/wiki/Maps 詳細情報...])',
'right-geocode' => 'ジオコーディング',
'maps_map' => '地図',
+ 'maps-tracking-category' => 'Maps拡張機能がレンダリングした地図があるページ',
'maps-loading-map' => '地図を読み込み中...',
'maps-load-failed' => '地図を読み込めませんでした。',
'maps-markers' => 'マーカー',
'maps-copycoords-prompt' => 'Ctrl+C、Enter',
'maps-searchmarkers-text' => 'マーカーを絞り込む',
'maps-others' => 'その他',
+ 'maps-kml-parsing-failed' => '1 件以上の kml ファイルを構文解析できませんでした。これは通常、取得失敗または XML の破損で発生します。',
'maps-ns-layer' => 'レイヤー',
'maps-ns-layer-talk' => 'レイヤー・トーク',
'maps-layer-property' => 'プロパティ',
@@ -3606,6 +3681,9 @@
'maps-displaymap-par-polygons' => '表示する多角形',
'maps-displaymap-par-rectangles' => '表示する矩形',
'maps-displaymap-par-wmsoverlay' => 'WMS オーバーレイを使用',
+ 'maps-fullscreen-button' => '全画面表示を切り替え',
+ 'maps-fullscreen-button-tooltip' => '地図の表示を全画面または埋め込みに切り替えます。',
+ 'maps-googlemaps3-par-enable-fullscreen' => '全画面表示のボタンを有効にする',
'validation-error-invalid-location' => '引数 $1 には有効な場所を指定してください。',
'validation-error-invalid-locations' => '引数 $1 には有効な場所を 1 つ以上指定してください。',
'validation-error-invalid-width' => '引数 $1 には有効な幅を指定してください。',
@@ -3779,17 +3857,18 @@
);
/** Korean (한국어)
+ * @author Hym411
* @author 아라
*/
$messages['ko'] = array(
- 'maps-desc' => '위키 문서에 동적 지도를 포함하고, 주소의 좌표화와 다른 지리적 작업을 할 수 있습니다. ([http://www.semantic-mediawiki.org/wiki/Maps 자세한 정보...])',
+ 'maps-desc' => '위키 문서에 동적 지도를 포함하고, 주소의 좌표화와 다른 지리적 작업을 할 수 있습니다. ([https://www.semantic-mediawiki.org/wiki/Maps 자세한 정보...])',
'right-geocode' => '좌표화',
'maps_map' => '지도',
'maps-loading-map' => '지도를 불러오는 중...',
'maps-load-failed' => '지도를 불러올 수 없습니다!',
'maps-markers' => '표시',
'maps-copycoords-prompt' => 'CTRL+C, ENTER',
- 'maps-searchmarkers-text' => '표시 필터',
+ 'maps-searchmarkers-text' => '표시를 필터',
'maps-others' => '기타',
'maps-ns-layer' => '레이어',
'maps-ns-layer-talk' => '레이어 토론',
@@ -3847,7 +3926,7 @@
기본 좌표화 서비스 값에 영향을 줄 수 있습니다.',
'maps-displaymap-par-mappingservice' => '지도를 생성하는데 사용될 매핑 서비스를 설정할 수 있습니다.',
'maps-displaymap-par-coordinates' => '지도에 보여줄 하나 이상의 위치입니다. 표시로 표시됩니다.',
- 'maps-displaymap-par-visitedicon' => '방문한 아이콘으로 사용할 파일의 로컬',
+ 'maps-displaymap-par-visitedicon' => '방문한 아이콘으로 사용할 파일의 로컬', # Fuzzy
'maps-displaymap-par-zoom' => '지도의 확대 수준을 설정할 수 있습니다.
제공하지 않고 여러 표시가 지도에 존재하지 않으면 설정한 기본값이 아닌 최고의 맞춤 확대로 설정됩니다.',
'maps-displaymap-par-centre' => 'display_point에 대한 지도의 중심 좌표를 설정할 수 있습니다.
@@ -3866,6 +3945,7 @@
'maps-displaymap-par-rectangles' => '보려줄 네모',
'maps-displaymap-par-static' => '지도는 정적이어야 할 때',
'maps-displaymap-par-wmsoverlay' => 'WMS 오버레이 사용',
+ 'maps-googlemaps3-par-enable-fullscreen' => '전체 화면 버튼 활성화',
'validation-error-invalid-location' => '$1 변수는 올바른 위치여야 합니다.',
'validation-error-invalid-locations' => '$1 변수는 하나 이상의 올바른 위치여야 합니다.',
'validation-error-invalid-width' => '$1 변수는 올바른 너비여야 합니다.',
@@ -3878,7 +3958,7 @@
'validation-error-invalid-goverlays' => '$1 변수는 하나 이상의 올바른 오버레이여야 합니다.',
'validation-error-invalid-line-param' => '"lines" 변수를 잘못 지정했습니다.',
'validation-error-invalid-polyline-param' => '"polylines" 변수를 잘못 지정했습니다.',
- 'validation-error-invalid-searchmarkers-param' => '찾기표시 값이 잘못되었으며 "all"이나 "title" 중 하나여야 합니다',
+ 'validation-error-invalid-searchmarkers-param' => '검색표시 값이 잘못되었으며 "all"이나 "title" 중 하나여야 합니다',
'maps-abb-north' => '북',
'maps-abb-east' => '동',
'maps-abb-south' => '남',
@@ -3952,7 +4032,7 @@
'mapeditor-form-field-strokeweight' => '선 굵기',
'mapeditor-form-field-fillcolor' => '채우기 색',
'mapeditor-form-field-fillopcaity' => '채우기 투명도',
- 'mapeditor-form-field-showonhover' => '가리켰을 때에만 표시',
+ 'mapeditor-form-field-showonhover' => '가리켰을 때에만 보이기',
'mapeditor-mapparam-title' => '지도 변수 편집',
'mapeditor-mapparam-defoption' => '-변수 선택-',
'mapeditor-imageoverlay-button' => '그림 배치 추가',
@@ -4032,9 +4112,10 @@
/** Luxembourgish (Lëtzebuergesch)
* @author Robby
+ * @author Soued031
*/
$messages['lb'] = array(
- 'maps-desc' => "Gëtt d'Méiglechkeet fir d'Date vun de Koordinaten op Kaarten a Geocode Adressen an aner geografesch Operatiounen ze weisen. ([http://www.semantic-mediawiki.org/wiki/Maps fir méi Informatiounen...])",
+ 'maps-desc' => "Gëtt d'Méiglechkeet fir d'Date vun de Koordinaten op Kaarten a Geocode Adressen an aner geographesch Operatiounen ze weisen. ([https://www.semantic-mediawiki.org/wiki/Maps fir méi Informatiounen...])",
'right-geocode' => 'Geocode',
'maps_map' => 'Kaart',
'maps-loading-map' => "D'Kaart gëtt gelueden…",
@@ -4046,13 +4127,15 @@
'maps-layer-property' => 'Eegeschaft',
'maps-layer-value' => 'Wäert',
'maps-layer-errors' => 'Feeler',
- 'maps-geodistance-description' => 'Déi geografesch Distanz tëschent zwee Punkte berechnen, vun an an iergend eent vun den ënnerstëtzte Formater.',
+ 'maps-geodistance-description' => 'Déi geographesch Distanz tëscht zwéi Punkte berechnen, vun an an iergendeent vun den ënnerstëtzte Formater.',
'maps-mapsdoc-par-language' => "D'Sprooch an där d'Dokumentatioun gewise gi soll. Wann déi Iwwersetzung net disponibel ass, da gëtt Englesch an där Plaz benotzt.",
'maps-coordinates-par-location' => "D'Koordinaten déi Dir formatéiere wëllt.",
'maps-coordinates-par-format' => "D'Zilformat vun de Koordinaten.",
'maps-distance-par-decimals' => 'Déi maximal Zuel vu Kommastellen déi am Resultat benotzt gi soll.',
+ 'maps-distance-par-unit' => "D'Eenheet fir d'Distanz.",
'maps-finddestination-par-location' => 'Déi initial Plaz.',
'maps-finddestination-par-distance' => "D'Distanz vun der Rees.",
+ 'maps-finddestination-par-format' => "D'Format an deem d'Zil gewise soll ginn.",
'maps-geocode-par-location' => "D'Adress déi Dir geocodéiere wëllt.",
'maps-geocode-par-format' => "De Format fir d'Koordinaten.",
'maps-geodistance-par-location1' => 'Den éischte Punkt vun deem aus eng Distanz berechent gi soll.',
@@ -4089,11 +4172,12 @@
'maps_unrecognized_coords_for' => 'Dës {{PLURAL:$2|Koordinate|Koordinate}} goufen net erkannt a vun der Kaart ignoréiert:
$1',
'maps_map_cannot_be_displayed' => "D'Kaart kann net gewise ginn.",
- 'maps-geocoder-not-available' => "D'Fonctioun vun der Geocodéierung vu Kaarten ass net disponibel. Äre Standuert konnt net geocodéiert ginn.",
+ 'maps-geocoder-not-available' => "D'Funktioun vun der Geocodéierung vu Kaarten ass net disponibel. Äre Standuert konnt net geocodéiert ginn.",
'maps_click_to_activate' => "Klickt fir d'kaart z'aktivéieren",
'maps_centred_on' => "D'Kaart ass zentréiert op $1, $2",
'maps-googlemaps3-incompatbrowser' => 'Äre Browser ass net mat Google Maps v3 kompatibel.',
'maps-googlemaps3-par-type' => 'Den Typ vu Kaart den am Ufank gewise gëtt.',
+ 'maps-googlemaps3-par-autoinfowindows' => "Automatesch all Fënstere mat Informatiounen opmaachen nodeem d'Säit geluede gouf.",
'maps-googlemaps3-par-kml' => "KML-Fichieren déi op d'Kaart musse geluede ginn.",
'maps-googlemaps3-par-poi' => 'Kuckeswäertes weisen',
'maps-osm-par-thumbs' => 'Miniaturbiller weisen',
@@ -4178,15 +4262,17 @@
* @author McDutchie
*/
$messages['mk'] = array(
- 'maps-desc' => 'Дава можност за вметнување на динамички карти во викистраници, геокодирање на адреси и други географски операции. ([http://www.semantic-mediawiki.org/wiki/Maps?uselang=mk повеќе информации...])',
+ 'maps-desc' => 'Дава можност за вметнување на динамички карти во викистраници, геокодирање на адреси и други географски операции. ([https://www.semantic-mediawiki.org/wiki/Maps?uselang=mk повеќе информации...])',
'right-geocode' => 'Геокод',
'maps_map' => 'Карта',
+ 'maps-tracking-category' => 'Страници со карта исцртана со додатокот „Карти“',
'maps-loading-map' => 'Ја вчитувам картата...',
'maps-load-failed' => 'Не можев да ја вчитам картата!',
'maps-markers' => 'Обележувачи',
'maps-copycoords-prompt' => 'Стиснете CTRL+C, па ENTER',
'maps-searchmarkers-text' => 'Филтрирање на одбележувачи',
'maps-others' => 'други',
+ 'maps-kml-parsing-failed' => 'Не можев да испарсирам една или повеќе KML-податотеки. Ова обично се должи на нивна недопстапност или лошо обликуван XML.',
'maps-ns-layer' => 'Слој',
'maps-ns-layer-talk' => 'Разговор за слој',
'maps-layer-property' => 'Својство',
@@ -4262,6 +4348,9 @@
'maps-displaymap-par-rectangles' => 'Правоаголници за приказ',
'maps-displaymap-par-static' => 'Дали картата да биде неподвижна',
'maps-displaymap-par-wmsoverlay' => 'Користи WMS-облога',
+ 'maps-fullscreen-button' => 'Префрли на широк екран',
+ 'maps-fullscreen-button-tooltip' => 'Поглед на картата на цел екран или вгнездено.',
+ 'maps-googlemaps3-par-enable-fullscreen' => 'Овозможи копче за цел екран',
'validation-error-invalid-location' => 'Параметарот $1 мора да претставува важечка местоположба.',
'validation-error-invalid-locations' => 'Параметарот $1 мора да претставува една или повеќе важечки местоположби.',
'validation-error-invalid-width' => 'Параметарот $1 мора да претставува важечка ширина.',
@@ -4293,7 +4382,7 @@
'maps_map_cannot_be_displayed' => 'Картата не може да се прикаже.',
'maps-geocoder-not-available' => 'Функцијата за геокодирање на Карти е недостапна. Вашата местоположба не може да се геокодира.',
'maps_googlemaps3' => 'Google Карти вер. 2',
- 'maps_click_to_activate' => 'Кликнете за активирање на картата',
+ 'maps_click_to_activate' => 'Стиснете за активирање на картата',
'maps_centred_on' => 'Средиште на картата во $1, $2.',
'maps-par-mappingservice' => 'Овозможува назначување на картографска служба што ќе се користи за создавање на картата.',
'maps-par-resizable' => 'Дава можност за менување на големината на картите со влечење на долниот десен агол.',
@@ -4384,7 +4473,7 @@
* @author Anakmalaysia
*/
$messages['ms'] = array(
- 'maps-desc' => 'Membolehkan pembenaman petak dinamik pada laman wiki, pembuatan geokod alamat dan bermacam-macam lagi operasi geografi. ([http://www.semantic-mediawiki.org/wiki/Maps maklumat lanjut...])',
+ 'maps-desc' => 'Membolehkan pembenaman petak dinamik pada laman wiki, pembuatan geokod alamat dan bermacam-macam lagi operasi geografi. ([https://www.semantic-mediawiki.org/wiki/Maps maklumat lanjut...])',
'right-geocode' => 'Geokod',
'maps_map' => 'Peta',
'maps-loading-map' => 'Peta sedang dimuatkan...',
@@ -4450,7 +4539,7 @@
Ini boleh mempengaruhi nilai asali perkhidmatan geokod.',
'maps-displaymap-par-mappingservice' => 'Membolehkan penetapan perkhidmatan pemetaan yang akan digunakan untuk menghasilkan peta.',
'maps-displaymap-par-coordinates' => 'Lokasi yang akan dijadikan pusat peta pada mulanya.',
- 'maps-displaymap-par-visitedicon' => 'Lokal fail untuk digunakan sebagai ikon dilawat',
+ 'maps-displaymap-par-visitedicon' => 'Lokal fail untuk digunakan sebagai ikon dilawat', # Fuzzy
'maps-displaymap-par-zoom' => 'Membolehkan penetapan tahap zum peta.
Apabila tidak diberikan sementara wujudnya berbilang penanda pada peta, zom yang paling muat akan diambil, bukan nilai asali yang terkonfigurasi.',
'maps-displaymap-par-centre' => 'Membolehkan penetapan koordinat pusat peta untuk display_point.
@@ -4778,17 +4867,20 @@
* @author Konovalov
* @author SPQRobin
* @author Siebrand
+ * @author Sjoerddebruin
*/
$messages['nl'] = array(
- 'maps-desc' => 'Biedt de mogelijkheid om locatiegegevens weer te geven op kaarten en adressen om te zetten naar coördinaten ([http://www.semantic-mediawiki.org/wiki/Maps meer...])',
+ 'maps-desc' => 'Biedt de mogelijkheid om locatiegegevens weer te geven op kaarten en adressen om te zetten naar coördinaten ([https://www.semantic-mediawiki.org/wiki/Maps meer...])',
'right-geocode' => 'Geocoderen',
'maps_map' => 'Kaart',
+ 'maps-tracking-category' => "Pagina's met een kaart die gerenderd is door de uitbreiding Maps",
'maps-loading-map' => 'Bezig met het laden van de kaart...',
'maps-load-failed' => 'De kaart kon niet geladen worden!',
'maps-markers' => 'Markeringen',
'maps-copycoords-prompt' => 'CTRL+C, ENTER',
'maps-searchmarkers-text' => 'Filtermarkeringen',
'maps-others' => 'anderen',
+ 'maps-kml-parsing-failed' => 'Eén of meer KML-bestanden konden niet verwerkt worden. Dit is meestal te wijten aan het niet kunnen ophalen van het bestand of ongeldige XML.',
'maps-ns-layer' => 'Laag',
'maps-ns-layer-talk' => 'Overleg_laag',
'maps-layer-property' => 'Eigenschap',
@@ -4846,7 +4938,7 @@
Dit kan invloed hebben op de standaardwaarde voor de geocoderingsdienst.',
'maps-displaymap-par-mappingservice' => 'Maakt het mogelijk om de kaartdienst in te stellen die wordt gebruikt om de kaart te maken.',
'maps-displaymap-par-coordinates' => 'De locatie die zich bij de eerste keer laden in het centrum van de kaart bevindt.',
- 'maps-displaymap-par-visitedicon' => 'De locatie van een bestand om te gebruiken als bezocht pictogram',
+ 'maps-displaymap-par-visitedicon' => 'De naam van een te gebruiken afbeeldingen voor markeericonen nadat ze zijn aangeklikt',
'maps-displaymap-par-zoom' => 'Maakt het mogelijk het schaalniveau van de kaart in te stellen.
Als deze waarde niet wordt ingesteld en er staan meerdere markers op de kaart, dan wordt het best passende schaalniveau gekozen, niet het instelbare standaardniveau.',
'maps-displaymap-par-centre' => 'Maakt het mogelijk de coördinaten voor het midden van de kaart in te stellen voor display_point(s).
@@ -4855,7 +4947,7 @@
'maps-displaymap-par-title' => 'Maakt het mogelijk om tekst in te stellen die wordt weergegeven in de pop-ups van alle markeringen zonder gespecificeerde naam.
Als dit samen met een label wordt gebruikt, wordt de titel vetgedrukt en onderstreept weergegeven.',
'maps-displaymap-par-label' => 'Maakt het mogelijk om tekst in te stellen die wordt weergegeven in de pop-ups van alle markeringen zonder gespecificeerd label.',
- 'maps-displaymap-par-icon' => 'Maakt het mogelijk het icoon voor alle markers in te stellen.',
+ 'maps-displaymap-par-icon' => 'Maakt het mogelijk het pictogram voor alle markers in te stellen.',
'maps-displaymap-par-circles' => 'Weer te geven cirkels',
'maps-displaymap-par-copycoords' => 'Of een dialoog waarvan de coördinaten van een locatie weergegeven moeten worden bij het klikken op iets',
'maps-displaymap-par-lines' => 'Weer te geven regels',
@@ -4865,6 +4957,9 @@
'maps-displaymap-par-rectangles' => 'Weer te geven rechthoeken',
'maps-displaymap-par-static' => 'Of de kaart statisch moet zijn',
'maps-displaymap-par-wmsoverlay' => 'WMS-overlay gebruiken',
+ 'maps-fullscreen-button' => 'Volledig scherm in- of uitschakelen',
+ 'maps-fullscreen-button-tooltip' => 'De kaart als volledig scherm of ingesloten bekijken.',
+ 'maps-googlemaps3-par-enable-fullscreen' => 'Knop voor volledig scherm inschakelen',
'validation-error-invalid-location' => 'Parameter $1 moet een geldige locatie zijn.',
'validation-error-invalid-locations' => 'Parameter $1 moet een of meer geldige locaties zijn.',
'validation-error-invalid-width' => 'Parameter $1 moet een geldige breedte zijn.',
@@ -4944,7 +5039,7 @@
'mapeditor-form-field-title' => 'Titel',
'mapeditor-form-field-text' => 'Tekst',
'mapeditor-form-field-link' => 'Koppeling',
- 'mapeditor-form-field-icon' => 'Icoon',
+ 'mapeditor-form-field-icon' => 'Pictogram',
'mapeditor-form-field-group' => 'Groep',
'mapeditor-form-field-inlinelabel' => 'Inline label',
'mapeditor-form-field-strokecolor' => 'Lijnkleur',
@@ -4958,7 +5053,7 @@
'mapeditor-imageoverlay-button' => 'Afbeeldingslaag toevoegen',
'mapeditor-form-field-image' => 'Afbeelding',
'mapeditor-imageoverlay-title' => 'Gegevens over afbeeldingslaag',
- 'mapeditor-form-field-visitedicon' => 'Icoon voor bezocht',
+ 'mapeditor-form-field-visitedicon' => 'Pictogram voor bezocht',
);
/** Nederlands (informeel) (Nederlands (informeel))
@@ -4995,7 +5090,7 @@
* @author Cedric31
*/
$messages['oc'] = array(
- 'maps-desc' => "Permet d'afichar de mapas dinamicas dins las paginas del wiki, d'adreças geoencodadas e d'autras operacions geograficas. ([http://www.semantic-mediawiki.org/wiki/Maps mai d'info...])",
+ 'maps-desc' => "Permet d'afichar de mapas dinamicas dins las paginas del wiki, d'adreças geoencodadas e d'autras operacions geograficas. ([https://www.semantic-mediawiki.org/wiki/Maps mai d'info...])",
'right-geocode' => 'Geocòde',
'maps_map' => 'Mapa',
'maps-loading-map' => 'Cargament de la mapa...',
@@ -5179,10 +5274,11 @@
* @author BeginaFelicysym
* @author Chrumps
* @author Sp5uhe
+ * @author Ty221
* @author Yarl
*/
$messages['pl'] = array(
- 'maps-desc' => 'Umożliwia zamieszczanie na stronach wiki dynamicznych map, geograficznie kodowanych adresów i innych danych geograficznych. ([http://www.semantic-mediawiki.org/wiki/Maps more info...])',
+ 'maps-desc' => 'Umożliwia zamieszczanie na stronach wiki dynamicznych map, geograficznie kodowanych adresów i innych danych geograficznych. ([https://www.semantic-mediawiki.org/wiki/Maps more info...])',
'right-geocode' => 'Geokodowanie',
'maps_map' => 'Mapa',
'maps-loading-map' => 'Wczytywanie mapy…',
@@ -5190,6 +5286,7 @@
'maps-markers' => 'Zaznaczenia',
'maps-copycoords-prompt' => 'CTRL+C, ENTER',
'maps-others' => 'inne',
+ 'maps-kml-parsing-failed' => 'Błąd podczas parsowania jednego lub więcej plików KML, najczęściej jest to wynik błędnego XML',
'maps-ns-layer' => 'Warstwa',
'maps-ns-layer-talk' => 'Dyskusja warstwy',
'maps-layer-property' => 'Własność',
@@ -5222,6 +5319,9 @@
'maps-finddestination-par-bearing' => 'Kierunek początkowy.',
'maps-finddestination-par-distance' => 'Odległość podróży.',
'maps-geocode-par-location' => 'Adres, który chcesz geokodować.',
+ 'maps-geocode-par-format' => 'Format wynikowych współrzędnych.',
+ 'maps-displaymap-par-maxzoom' => 'Maksymalny poziom powiększenia',
+ 'maps-displaymap-par-minzoom' => 'Minimalny poziom powiększenia',
'validation-error-invalid-location' => 'Parametr $1 musi wskazywać prawidłową lokalizację.',
'validation-error-invalid-locations' => 'Parametr $1 musi wskazywać jedną lub więcej prawidłowych lokalizacji.',
'validation-error-invalid-width' => 'Parametr $1 musi określać prawidłową szerokość.',
@@ -5282,7 +5382,7 @@
* @author පසිඳු කාවින්ද
*/
$messages['pms'] = array(
- 'maps-desc' => "A abìlita l'anseriment ëd carte dinàmiche ant le pàgine ëd la wiki, dj'adrësse geocodificà e d'àutre operassion geogràfiche ([http://www.semantic-mediawiki.org/wiki/Maps për savèjne ëd pi...])",
+ 'maps-desc' => "A abìlita l'anseriment dle carte dinàmiche ant le pàgine ëd la wiki, dj'adrësse geocodificà e d'àutre operassion geogràfiche ([https://www.semantic-mediawiki.org/wiki/Maps për savèjne ëd pi...])",
'right-geocode' => 'Geocodìfica',
'maps_map' => 'Pian',
'maps-loading-map' => 'Cariament ëd la carta...',
@@ -5348,7 +5448,7 @@
Sòn a peul anfluensé ël valor dël sërvissi ëd geocodìfica predefinì.",
'maps-displaymap-par-mappingservice' => "A përmët d'amposté ël sërvissi ëd cartografìa che a sarà dovrà për generé la carta.",
'maps-displaymap-par-coordinates' => 'Un-a o pi locassion da smon-e an sla carta. A saran mostrà con na marca.',
- 'maps-displaymap-par-visitedicon' => "L'element local ëd n'archivi da dovré com plancia visità",
+ 'maps-displaymap-par-visitedicon' => "L'element local ëd n'archivi da dovré com plancia visità", # Fuzzy
'maps-displaymap-par-zoom' => "A përmët d'amposté ël livel d'angrandiment ëd la carta.
Quand nen dàit e pi marche a son presente an sla carta, a sarà dovrà ël mej angrandiment, pa la configurassion predefinìa.",
'maps-displaymap-par-centre' => "A përmët d'amposté le coordinà dël sénter ëd la carta për display_point(s).
@@ -5628,7 +5728,7 @@
* @author 555
*/
$messages['pt-br'] = array(
- 'maps-desc' => 'Permite a incorporação de mapas dinâmicos em páginas wiki, geocodificação de endereços e outras operações geográficas. ([http://www.semantic-mediawiki.org/wiki/Maps mais informações...])',
+ 'maps-desc' => 'Permite a incorporação de mapas dinâmicos em páginas wiki, geocodificação de endereços e outras operações geográficas. ([https://www.semantic-mediawiki.org/wiki/Maps mais informações...])',
'maps_map' => 'Mapa',
'maps-loading-map' => 'Carregando mapa...',
'maps-markers' => 'Marcadores',
@@ -5705,7 +5805,7 @@
* @author Stelistcristi
*/
$messages['ro'] = array(
- 'maps-desc' => 'Permite încorporarea hărților dinamice în paginile wiki, precum și geocodificarea adreselor ori efectuarea altor operațiuni de ordin geografic. ([http://www.semantic-mediawiki.org/wiki/Maps mai multe informații...])',
+ 'maps-desc' => 'Permite încorporarea hărților dinamice în paginile wiki, precum și geocodificarea adreselor ori efectuarea altor operațiuni de ordin geografic. ([https://www.semantic-mediawiki.org/wiki/Maps mai multe informații...])',
'right-geocode' => 'Geocod',
'maps_map' => 'Hartă',
'maps-loading-map' => 'Se încarcă harta...',
@@ -5800,7 +5900,7 @@
* @author Joetaras
*/
$messages['roa-tara'] = array(
- 'maps-desc' => "Dèje l'abbilità a sckaffà le mappe dinameche 'ngapsulate jndr'à le pàggene de Uicchi, geocodificate e indirizzate a otre operaziune sciugrafeche. ([http://www.semantic-mediawiki.org/wiki/Maps cchiù 'mbormaziune...])",
+ 'maps-desc' => "Dèje l'abbilità a sckaffà le mappe dinameche 'ngapsulate jndr'à le pàggene de Uicchi, geocodificate e indirizzate a otre operaziune sciugrafeche. ([https://www.semantic-mediawiki.org/wiki/Maps cchiù 'mbormaziune...])",
'right-geocode' => 'Geocodece',
'maps_map' => 'Mappe',
'maps-loading-map' => "Stoche a careche 'a mappe...",
@@ -5847,30 +5947,34 @@
* @author Lockal
* @author MaxSem
* @author McDutchie
+ * @author Okras
* @author Yuriy Apostol
* @author Александр Сигачёв
*/
$messages['ru'] = array(
- 'maps-desc' => 'Позволяет встраивать динамические карты в вики-страницы, геокодировать адреса, выполнять другие географические действия. ([http://www.semantic-mediawiki.org/wiki/Maps подробнее...])',
+ 'maps-desc' => 'Позволяет встраивать динамические карты в вики-страницы, геокодировать адреса, выполнять другие географические действия. ([https://www.semantic-mediawiki.org/wiki/Maps подробнее...])',
'right-geocode' => 'геокодирование',
'maps_map' => 'Карта',
+ 'maps-tracking-category' => 'Страницы с картой, сгенерированной расширением Maps',
'maps-loading-map' => 'Идёт загрузка карты…',
'maps-load-failed' => 'Невозможно загрузить карту!',
'maps-markers' => 'Отметки',
'maps-copycoords-prompt' => 'CTRL+C, ENTER',
+ 'maps-searchmarkers-text' => 'Маркеры фильтра',
'maps-others' => 'другие',
+ 'maps-kml-parsing-failed' => 'Не удалось выполнить разбор одного или нескольких KML-файлов, обычно вследствие отказа в получении или некорректного XML.',
'maps-ns-layer' => 'Слой',
'maps-ns-layer-talk' => 'Обсуждение слоя',
'maps-layer-property' => 'Свойство',
'maps-layer-value' => 'Значение',
'maps-layer-errors' => 'Ошибки',
'maps-error-invalid-layerdef' => 'Это определение слоя неверно.',
- 'maps-error-invalid-layertype' => 'Не существует слоя типа «$1». {{PLURAL:$3|Поддерживается только следующий тип|Поддерживаются только следующие типы}}: $2',
- 'maps-error-no-layertype' => 'Вам нужно указать тип слоя. {{PLURAL:$2|Поддерживается только следующий тип|Поддерживаются следующие типы}}: $1',
+ 'maps-error-invalid-layertype' => 'Не существует слоя типа «$1». {{PLURAL:$3|1=Поддерживается только следующий тип|Поддерживаются только следующие типы}}: $2', # Fuzzy
+ 'maps-error-no-layertype' => 'Вам нужно указать тип слоя. {{PLURAL:$2|1=Поддерживается только следующий тип|Поддерживаются следующие типы}}: $1', # Fuzzy
'validation-error-invalid-layer' => 'Параметр $1 должен быть корректным слоем.',
'validation-error-invalid-layers' => 'Параметр $1 должен содержать один или несколько корректных слоёв.',
'maps-layer-of-type' => 'Слой типа $1',
- 'maps-layer-type-supported-by' => 'Этот тип слоя может быть использован {{PLURAL:$2|только с картографической службой|только со следующими картографическими службами:}} $1',
+ 'maps-layer-type-supported-by' => 'Этот тип слоя может быть использован {{PLURAL:$2|1=только с картографической службой|только со следующими картографическими службами:}} $1', # Fuzzy
'maps-coordinates-description' => 'Перехватчик синтаксического анализатора для форматирования координат из любого и в любой поддерживаемый формат.',
'maps-displaymap-description' => 'Отображение географических карт без каких-либо вики-маркеров на них.',
'maps-displaypoint-description' => 'Отображение географических карт с одним или несколькими вики-маркерами на них.',
@@ -5878,6 +5982,7 @@
'maps-finddestination-description' => 'Найти место назначения от заданной начальной точки (может быть в любом формате из поддерживаемых), начальное направление и расстояние.',
'maps-geocode-description' => 'Включает геокодирование адресов. Иными словами, преобразует понятные человеку названия мест в наборы координат. Поддерживается несколько сервисов геокодирования, которые не следует путать с картографическими сервисами.',
'maps-geodistance-description' => 'Рассчитать географическое расстояние между двумя точками, из любого и в любой поддерживаемый формат.',
+ 'maps-mapsdoc-par-language' => 'Язык, на котором отображается документация. Если перевод не доступен, вместо него будет использоваться английский язык.',
'maps-coordinates-par-location' => 'Координаты, которые требуется отформатировать.',
'maps-coordinates-par-format' => 'Целевой формат координат.',
'maps-coordinates-par-directional' => 'Указывает, должны ли координаты выводиться непосредственно или нет.',
@@ -5910,12 +6015,20 @@
'maps-geodistance-par-decimals' => 'Наибольшее количество цифр в дробной части результата.',
'maps-geodistance-par-mappingservice' => 'Служба геокодирования, используемая для кодирования любого адреса.',
'maps-displaymap-par-mappingservice' => 'Позволяет выбрать сервис карт, который будет использоваться.',
+ 'maps-displaymap-par-coordinates' => 'Одно или несколько мест для отображения на карте. Они будут обозначаться маркером.',
+ 'maps-displaymap-par-visitedicon' => 'Имя изображения, которое будет используется для значков-маркеров после того, как на них нажмут',
'maps-displaymap-par-icon' => 'Позволяет установить значок, используемый для всех маркеров.',
'maps-displaymap-par-circles' => 'Кружки для отображения',
'maps-displaymap-par-lines' => 'Линии для отображения',
'maps-displaymap-par-maxzoom' => 'Максимальный уровень масштабирования',
'maps-displaymap-par-minzoom' => 'Минимальный уровень масштабирования',
+ 'maps-displaymap-par-polygons' => 'Полигоны для отображения',
+ 'maps-displaymap-par-rectangles' => 'Прямоугольники для отображения',
'maps-displaymap-par-static' => 'Если карта должна быть статичной',
+ 'maps-displaymap-par-wmsoverlay' => 'Использовать слой WMS',
+ 'maps-fullscreen-button' => 'Переключить полноэкранный режим',
+ 'maps-fullscreen-button-tooltip' => 'Посмотреть карту в полноэкранном или встроенном режиме.',
+ 'maps-googlemaps3-par-enable-fullscreen' => 'Включить кнопку полноэкранного режима',
'validation-error-invalid-location' => 'Параметр $1 должен быть корректным местоположением.',
'validation-error-invalid-locations' => 'Параметр $1 должен содержать одно или несколько корректных местоположений.',
'validation-error-invalid-width' => 'Параметр $1 должен быть корректной шириной.',
@@ -5926,6 +6039,8 @@
'validation-error-invalid-images' => 'Параметр $1 должен содержать одно или несколько корректных изображений.',
'validation-error-invalid-goverlay' => 'Параметр $1 должен быть корректным наложением.',
'validation-error-invalid-goverlays' => 'Параметр $1 должен содержать одно или несколько корректных наложений.',
+ 'validation-error-invalid-line-param' => 'Указан неверный параметр «lines».',
+ 'validation-error-invalid-polyline-param' => 'Указан недопустимый параметр «polylines».',
'maps-abb-north' => 'С',
'maps-abb-east' => 'В',
'maps-abb-south' => 'Ю',
@@ -5934,23 +6049,34 @@
'maps-longitude' => 'Долгота:',
'maps-invalid-coordinates' => 'Значение $1 не признано допустимым набором координат.',
'maps_coordinates_missing' => 'Не указаны координаты для карты.',
- 'maps_geocoding_failed' => '{{PLURAL:$2|Следующий адрес не может быть геокодирован|Следующие адреса не могут быть геокодированы}}: $1.
-Карта не может быть отображена.',
- 'maps_geocoding_failed_for' => '{{PLURAL:$2|Следующий адрес не может быть геокодирован и был удалён|Следующие адреса не могут быть геокодированы и были удалены}} с карты:
-$1',
- 'maps_unrecognized_coords' => 'Следующие {{PLURAL:$2|координаты|координаты}} не были опознаны: $1.',
- 'maps_unrecognized_coords_for' => 'Следующие координаты не были опознаны, {{PLURAL:$2|они|они}} не показаны на карте:
-$1',
+ 'maps_geocoding_failed' => '{{PLURAL:$2|1=Следующий адрес не может быть геокодирован|Следующие адреса не могут быть геокодированы}}: $1.
+Карта не может быть отображена.', # Fuzzy
+ 'maps_geocoding_failed_for' => '{{PLURAL:$2|1=Следующий адрес не может быть геокодирован и был удалён|Следующие адреса не могут быть геокодированы и были удалены}} с карты:
+$1', # Fuzzy
+ 'maps_unrecognized_coords' => 'Следующие {{PLURAL:$2|1=координаты|координаты}} не были опознаны: $1.', # Fuzzy
+ 'maps_unrecognized_coords_for' => 'Следующие координаты не были опознаны, {{PLURAL:$2|1=они|они}} не показаны на карте:
+$1', # Fuzzy
'maps_map_cannot_be_displayed' => 'Карта не может быть показана.',
'maps-geocoder-not-available' => 'Функция геокодирования карт недоступна, ваше местоположение не может быть геокодировано.',
'maps_click_to_activate' => 'Нажмите для активации карты',
'maps_centred_on' => 'Центр карты — $1, $2.',
'maps-par-mappingservice' => 'Позволяет выбрать сервис карт, который будет использоваться.',
+ 'maps-par-resizable' => 'Даёт возможность изменять размер карты, потащив её за правый нижний угол.',
+ 'maps-par-centre' => 'Расположение на карте, по которому она должна быть отцентрована',
'maps-googlemaps3-incompatbrowser' => 'Ваш браузер несовместим с Google Maps v3.',
+ 'maps-googlemaps3-par-type' => 'Тип карты для начального отображения.',
+ 'maps-googlemaps3-par-types' => 'Типы карты, которые будут доступны через элемент управления типом карты.',
'maps-googlemaps3-par-layers' => 'Специальные слои для загрузки на карту.',
+ 'maps-googlemaps3-par-controls' => 'Элементы управления для размещения на карте.',
+ 'maps-googlemaps3-par-zoomstyle' => 'Стиль элемента управления масштабом.',
+ 'maps-googlemaps3-par-autoinfowindows' => 'Автоматически открывает все информационные окна после загрузки страницы.',
'maps-googlemaps3-par-kml' => 'KML файлы для загрузки на карту.',
'maps-googlemaps3-par-gkml' => 'KML файлы, хранящиеся в Google для загрузки на карту.',
+ 'maps-googlemaps3-par-fusiontables' => 'Идентификаторы Сводных таблиц Google, которые должны быть загружены на карту.',
+ 'maps-googlemaps3-par-tilt' => 'Наклон карты при использовании Google Maps.',
+ 'maps-googlemaps3-par-kmlrezoom' => 'Перемасштабировать карту после загрузки слоёв KML.',
'maps-googlemaps3-par-poi' => 'Показать достопримечательности.',
+ 'maps-openlayers-par-controls' => 'Элементы управления для размещения на карте.',
'maps-osm-par-thumbs' => 'Показать превью',
'maps-osm-par-photos' => 'Показать фото',
'mapeditor' => 'Редактор карт',
@@ -5962,6 +6088,7 @@
'mapeditor-import-button2' => 'Импортировать',
'mapeditor-export-button' => 'Экспортировать в викитекст',
'mapeditor-import-button' => 'Импортировать из викитекста',
+ 'mapeditor-select-button' => 'Выберите этот полигон',
'mapeditor-mapparam-button' => 'Править параметры карты',
'mapeditor-clear-button' => 'Очистить карту',
'mapeditor-code-title' => 'Викитекст',
@@ -6127,14 +6254,19 @@
/** Slovenian (slovenščina)
* @author Dbc334
+ * @author Eleassar
* @author Lesko987
*/
$messages['sl'] = array(
- 'maps-desc' => 'Omogoča vključevanje dinamičnih zemljevidov na wikistrani, geokodiranje naslovov in druge geografske operacije. ([http://www.semantic-mediawiki.org/wiki/Maps Več informacij ...])',
+ 'maps-desc' => 'Omogoča vključevanje dinamičnih zemljevidov na wikistrani, geokodiranje naslovov in druge geografske operacije. ([https://www.semantic-mediawiki.org/wiki/Maps Več informacij ...])',
'right-geocode' => 'Geokodiranje',
'maps_map' => 'Zemljevid',
'maps-loading-map' => 'Nakladanje zemljevida...',
'maps-load-failed' => 'Zemljevid ni bilo mogoče naložiti.',
+ 'maps-kml-parsing-failed' => 'Razčlenjevanje ene ali več datotek KML ni uspelo. Navadno je vzrok neuspešen priklic ali slabo oblikovan XML.',
+ 'maps-fullscreen-button' => 'Vklopi celozaslonski prikaz',
+ 'maps-fullscreen-button-tooltip' => 'Celozaslonski ali vključeni prikaz zemljevida.',
+ 'maps-googlemaps3-par-enable-fullscreen' => 'Omogoči gumb za celozaslonski prikaz',
'maps-abb-north' => 'S',
'maps-abb-east' => 'V',
'maps-abb-south' => 'J',
@@ -6209,7 +6341,7 @@
* @author WikiPhoenix
*/
$messages['sv'] = array(
- 'maps-desc' => 'Ger möjlighet att bädda in dynamiska kartor i wiki-sidor, geokoding av adresser och andra geografiska åtgärder. ([http://www.semantic-mediawiki.org/wiki/Maps mer information...]).',
+ 'maps-desc' => 'Ger möjlighet att bädda in dynamiska kartor i wiki-sidor, geokoding av adresser och andra geografiska åtgärder. ([https://www.semantic-mediawiki.org/wiki/Maps mer information...]).',
'right-geocode' => 'Geokod',
'maps_map' => 'Karta',
'maps-loading-map' => 'Laddar karta ...',
@@ -6235,19 +6367,26 @@
'maps-mapsdoc-par-language' => 'Språket som du vill visa dokumentationen i. Om det finns någon sådan översättning kommer engelska att användas istället.',
'maps-coordinates-par-location' => 'Koordinaterna du vill formatera.',
'maps-coordinates-par-format' => 'Målformatet för koordinaterna.',
+ 'maps-distance-par-unit' => 'Enheten för utmatning av avståndet.',
'maps-finddestination-par-location' => 'Startplats',
'maps-finddestination-par-bearing' => 'Inledande bäring.',
'maps-finddestination-par-distance' => 'Reseavståndet.',
+ 'maps-finddestination-par-format' => 'Formatet för utmatning av destinationen.',
'maps-finddestination-par-allowcoordinates' => 'Indikerar om koordinater bör tillåtas. Om nej anges kommer endast adresser att accepteras.',
'maps-geocode-par-location' => 'Adressen som du vill geokoda.',
'maps-geocode-par-mappingservice' => 'Geokodningstjänsten du vill använda. Se de tillgängliga geokodningtjänsterna.',
'maps-geocode-par-format' => 'Formatet för de resulterande koordinaterna.',
+ 'maps-geodistance-par-unit' => 'Enheten för utmatning av avståndet.',
'maps-displaymap-par-circles' => 'Cirklar att visa',
'maps-displaymap-par-lines' => 'Rader att visa',
'maps-displaymap-par-maxzoom' => 'Maximala zoomnivån',
'maps-displaymap-par-minzoom' => 'Minimala zoomnivån',
'maps-displaymap-par-polygons' => 'Polygoner att visa',
'maps-displaymap-par-rectangles' => 'Rektanglar att visa',
+ 'maps-displaymap-par-static' => 'Om kartan borde vara statisk',
+ 'maps-fullscreen-button' => 'Växla fullskärmsläge',
+ 'maps-fullscreen-button-tooltip' => 'Visa kartan i helskärm eller som inbäddad.',
+ 'maps-googlemaps3-par-enable-fullscreen' => 'Aktivera helskärmsknappen',
'validation-error-invalid-location' => 'Parameter $1 måste vara en giltig plats.',
'validation-error-invalid-locations' => 'Parameter $1 måste vara en eller flera giltiga platser.',
'validation-error-invalid-width' => 'Parameter $1 måste vara en giltig bredd.',
@@ -6277,6 +6416,7 @@
'maps_centred_on' => 'Karta centrerad på $1, $2.',
'maps-par-centre' => 'Platsen där kartan ska vara centrerad',
'maps-googlemaps3-incompatbrowser' => 'Din webbläsare är inte kompatibel med Google Maps v3.',
+ 'maps-googlemaps3-par-type' => 'Karttyp att visa initialt',
'maps-googlemaps3-par-controls' => 'Kontroller att placera på kartan.',
'maps-googlemaps3-par-autoinfowindows' => 'Öppna automatiskt alla informationsfönster när sidan har lästs in.',
'maps-googlemaps3-par-kml' => 'KML-filer att ladda upp på kartan.',
@@ -6640,27 +6780,29 @@
* @author Тест
*/
$messages['uk'] = array(
- 'maps-desc' => 'Дає змогу вбудовування динамічних карт у сторінки вікі, геокодування адрес та інші географічні операції. ([http://www.semantic-mediawiki.org/wiki/Maps детальніше...])',
+ 'maps-desc' => 'Дає змогу вбудовування динамічних карт у сторінки вікі, геокодування адрес та інші географічні операції. ([https://www.semantic-mediawiki.org/wiki/Maps детальніше...])',
'right-geocode' => 'Геокод',
'maps_map' => 'Мапа',
+ 'maps-tracking-category' => 'Сторінки з картою, створеною розширенням карти',
'maps-loading-map' => 'Завантаження мапи...',
'maps-load-failed' => 'Неможливо завантажити карту!',
'maps-markers' => 'Відмітки',
'maps-copycoords-prompt' => 'CTRL+C, ENTER',
'maps-searchmarkers-text' => 'Фільтрувати маркери',
'maps-others' => 'інші',
+ 'maps-kml-parsing-failed' => 'Помилка аналізу одного або декількох файлів kml, як правило, через отриманий несправний або некоректний XML.',
'maps-ns-layer' => 'Шар',
'maps-ns-layer-talk' => 'Обговорення шару',
'maps-layer-property' => 'Властивість',
'maps-layer-value' => 'Значення',
'maps-layer-errors' => 'Помилки',
'maps-error-invalid-layerdef' => 'Це визначення шару невірне.',
- 'maps-error-invalid-layertype' => 'Не існують шари типу «$1». {{PLURAL:$3|Підтримується лише наступний тип|Підтримуються лише наступні типи}}: $2',
- 'maps-error-no-layertype' => 'Вам потрібно вказати тип шару. {{PLURAL:$2|Тільки такий тип|Такі типи}} підтримуються: $1',
+ 'maps-error-invalid-layertype' => 'Не існують шари типу «$1». {{PLURAL:$3|1=Підтримується лише наступний тип|Підтримуються лише наступні типи}}: $2',
+ 'maps-error-no-layertype' => 'Вам потрібно вказати тип шару. {{PLURAL:$2|1=Тільки такий тип|Такі типи}} підтримуються: $1',
'validation-error-invalid-layer' => 'Параметр $1 повинен бути коректним шаром.',
'validation-error-invalid-layers' => 'Параметри $1 повинні містити один чи більше коректних шарів.',
'maps-layer-of-type' => 'Шар типу $1',
- 'maps-layer-type-supported-by' => 'Цей тип шару може бути використано {{PLURAL:$2|лише із картографічним сервісом|лише із наступними картографічними сервісами:}} $1',
+ 'maps-layer-type-supported-by' => 'Цей тип шару може бути використано {{PLURAL:$2|1=лише із картографічним сервісом|лише із наступними картографічними сервісами:}} $1',
'maps-coordinates-description' => 'Перехопиник парсеру для форматування координат із будь-якого у будьякий формат, що підтримується.',
'maps-displaymap-description' => 'Відображення географічних карт без жодних вікі-маркерів на них.',
'maps-displaypoint-description' => 'Показ географічних карт із одією або декількома вікі-позначками на них.',
@@ -6725,6 +6867,9 @@
'maps-displaymap-par-rectangles' => 'Прямокутники для показу',
'maps-displaymap-par-static' => 'Якщо карта повинна бути нерухомою',
'maps-displaymap-par-wmsoverlay' => 'Використовувати накладення WMS',
+ 'maps-fullscreen-button' => 'Перемкнути повноекранний режим',
+ 'maps-fullscreen-button-tooltip' => 'Переглянути мапу на весь екран або як вбудовану.',
+ 'maps-googlemaps3-par-enable-fullscreen' => 'Увімкнути кнопку повноекранного режиму',
'validation-error-invalid-location' => 'Параметр $1 повинен бути коректним місцем розташування.',
'validation-error-invalid-locations' => 'Параметр $1 повинен бути одним або більше коректних місць розташування.',
'validation-error-invalid-width' => 'Параметр $1 повинен бути коректною шириною.',
@@ -6746,12 +6891,12 @@
'maps-longitude' => 'Довгота:',
'maps-invalid-coordinates' => 'Значення $1 не є дійсним набором координат.',
'maps_coordinates_missing' => 'Не вказані координати для мапи.',
- 'maps_geocoding_failed' => '{{PLURAL:$2|Ця адреса не може бути геокодована|Ці адреси не можуть бути геокодовані}}: $1.
+ 'maps_geocoding_failed' => '{{PLURAL:$2|1=Ця адреса не може бути геокодована|Ці адреси не можуть бути геокодовані}}: $1.
Мапа не може бути відображена.',
- 'maps_geocoding_failed_for' => '{{PLURAL:$2|Наступна адреса не може бути геокодована та була видалена|Наступні адреси не можуть бути геокодовані та були видалені}} з мапи:
+ 'maps_geocoding_failed_for' => '{{PLURAL:$2|1=Наступна адреса не може бути геокодована та була видалена|Наступні адреси не можуть бути геокодовані та були видалені}} з мапи:
$1',
- 'maps_unrecognized_coords' => 'Ці {{PLURAL:$2|координати|координати}} не були розпізнані: $1.',
- 'maps_unrecognized_coords_for' => 'Наступні координати не були розпізнані, {{PLURAL:$2|вони|вони}} не показані на мапі:
+ 'maps_unrecognized_coords' => 'Ці {{PLURAL:$2|1=координати|координати}} не були розпізнані: $1.',
+ 'maps_unrecognized_coords_for' => 'Наступні координати не були розпізнані, {{PLURAL:$2|1=вони|вони}} не показані на мапі:
$1',
'maps_map_cannot_be_displayed' => 'Мапа не може бути відображена.',
'maps-geocoder-not-available' => 'Функція геокодування мап недоступна. Ваше місце розташування не може бути геокодоване.',
@@ -6881,7 +7026,7 @@
* @author Vinhtantran
*/
$messages['vi'] = array(
- 'maps-desc' => 'Cung cấp khả năng nhúng bản đồ vào trang wiki, mã hóa địa lý các địa chỉ, và thực hiện các tác vụ địa lý khác ([http://www.semantic-mediawiki.org/wiki/Maps?uselang=vi thêm chi tiết])',
+ 'maps-desc' => 'Cung cấp khả năng nhúng bản đồ vào trang wiki, mã hóa địa lý các địa chỉ, và thực hiện các tác vụ địa lý khác ([https://www.semantic-mediawiki.org/wiki/Maps?uselang=vi thêm chi tiết])',
'right-geocode' => 'Mã hóa địa lý',
'maps_map' => 'Bản đồ',
'maps-loading-map' => 'Đang tải bản đồ…',
@@ -7012,13 +7157,16 @@
/** Simplified Chinese (中文(简体))
* @author Hydra
+ * @author Hzy980512
* @author Kuailong
+ * @author Liuxinyu970226
* @author PhiLiP
+ * @author Qiyue2001
* @author Xiaomingyan
* @author Yfdyh000
*/
$messages['zh-hans'] = array(
- 'maps-desc' => '允许嵌入动态地图到wiki页面、地址的地理编码等地理学操作。([http://www.semantic-mediawiki.org/wiki/地图更多信息...])',
+ 'maps-desc' => '允许嵌入动态地图到wiki页面、地址的地理编码等地理学操作。([https://www.semantic-mediawiki.org/wiki/地图更多信息...])',
'right-geocode' => '地理编码',
'maps_map' => '地图',
'maps-loading-map' => '载入地图中……',
@@ -7034,6 +7182,16 @@
'maps-error-invalid-layerdef' => '这一层定义不是有效的。',
'maps-finddestination-par-location' => '初始位置。',
'maps-finddestination-par-bearing' => '最初的影响。',
+ 'maps-geodistance-par-unit' => '要输出的距离单位。',
+ 'maps-displaymap-par-lines' => '要显示的行',
+ 'maps-displaymap-par-maxzoom' => '最大缩放级别',
+ 'maps-displaymap-par-minzoom' => '最小缩放级别',
+ 'maps-displaymap-par-polygons' => '要显示的多边形',
+ 'maps-displaymap-par-rectangles' => '要显示的矩形',
+ 'maps-displaymap-par-static' => '如果地图应该是静态',
+ 'maps-displaymap-par-wmsoverlay' => '使用一个WMS覆盖',
+ 'maps-fullscreen-button' => '切换全屏显示',
+ 'maps-googlemaps3-par-enable-fullscreen' => '启用全屏按钮',
'validation-error-invalid-location' => '参数 $1 必须是一个有效的位置。',
'validation-error-invalid-locations' => '参数 $1 必须有一个或多个有效的位置。',
'validation-error-invalid-width' => '参数 $1 必须是一个有效的宽度。',
@@ -7044,6 +7202,7 @@
'validation-error-invalid-images' => '参数 $1 必须是一个或多个有效的图像。',
'validation-error-invalid-goverlay' => '参数 $1 必须是一个有效的重叠。',
'validation-error-invalid-goverlays' => '参数 $1 必须是一个或多个有效重叠。',
+ 'validation-error-invalid-line-param' => '指定了无效的“线”参数。',
'maps-abb-north' => '北',
'maps-abb-east' => '东',
'maps-abb-south' => '南',
@@ -7051,24 +7210,38 @@
'maps-latitude' => '纬度:',
'maps-longitude' => '经度:',
'maps_map_cannot_be_displayed' => '该地图无法显示。',
+ 'maps_click_to_activate' => '点击激活地图',
+ 'maps-googlemaps3-incompatbrowser' => '您的浏览器不兼容Google Maps v3。',
'maps-osm-par-thumbs' => '显示大拇指',
'maps-osm-par-photos' => '显示图片',
'mapeditor' => '地图编辑器',
'specialpages-group-maps' => '地图',
'mapeditor-none-text' => '无',
'mapeditor-done-button' => '完成',
+ 'mapeditor-remove-button' => '移除',
'mapeditor-import-button2' => '汇入',
'mapeditor-export-button' => '汇出到 wiki 代码',
+ 'mapeditor-code-title' => '维基代码',
+ 'mapeditor-import-title' => '导入维基代码',
'mapeditor-form-title' => '编辑详情',
'mapeditor-link-title-switcher-link-text' => '链接',
'mapeditor-form-field-title' => '标题',
'mapeditor-form-field-text' => '文字',
'mapeditor-form-field-link' => '链接',
'mapeditor-form-field-icon' => '图标',
+ 'mapeditor-form-field-group' => '组',
+ 'mapeditor-form-field-inlinelabel' => '内联标签',
+ 'mapeditor-form-field-strokecolor' => '描边颜色',
+ 'mapeditor-form-field-strokeopacity' => '描线不透明度',
+ 'mapeditor-form-field-strokeweight' => '描边粗细',
+ 'mapeditor-form-field-fillcolor' => '填充颜色',
+ 'mapeditor-form-field-fillopcaity' => '填充不透明度',
+ 'mapeditor-mapparam-title' => '编辑地图参数',
'mapeditor-form-field-image' => '图片',
);
/** Traditional Chinese (中文(繁體))
+ * @author Cwlin0416
* @author Horacewai2
* @author Justincheng12345
* @author Mark85296341
@@ -7077,7 +7250,7 @@
* @author Waihorace
*/
$messages['zh-hant'] = array(
- 'maps-desc' => '容許嵌入動態地圖到維基頁面、地址地理編碼及其他地理操作。([http://www.semantic-mediawiki.org/wiki/Maps 更多資訊…])',
+ 'maps-desc' => '容許嵌入動態地圖到維基頁面、地址地理編碼及其他地理操作。([https://www.semantic-mediawiki.org/wiki/Maps 更多資訊…])',
'right-geocode' => '地理編碼',
'maps_map' => '地圖',
'maps-loading-map' => '載入中...',
@@ -7093,6 +7266,9 @@
'maps-error-invalid-layerdef' => '這一層定義不是有效的。',
'maps-finddestination-par-location' => '初始位置。',
'maps-finddestination-par-bearing' => '最初的影響。',
+ 'maps-fullscreen-button' => '切換全螢幕',
+ 'maps-fullscreen-button-tooltip' => '檢視地圖使用全螢幕或嵌入式', # Fuzzy
+ 'maps-googlemaps3-par-enable-fullscreen' => '開啟全螢幕的按鈕',
'validation-error-invalid-location' => '參數 $1 必須是一個有效的位置。',
'validation-error-invalid-locations' => '參數 $1 必須有一個或多個有效的位置。',
'validation-error-invalid-width' => '參數 $1 必須是一個有效的寬度。',
diff --git a/Maps.php b/Maps.php
index 2360453c2..65fd650e9 100644
--- a/Maps.php
+++ b/Maps.php
@@ -2,61 +2,31 @@
/**
* Initialization file for the Maps extension.
- *
- * On MediaWiki.org: http://www.mediawiki.org/wiki/Extension:Maps
- * Official documentation: http://mapping.referata.com/wiki/Maps
- * Examples/demo's: http://mapping.referata.com/wiki/Maps_examples
- *
- * @file Maps.php
- * @ingroup Maps
+ * https://github.com/JeroenDeDauw/Maps
*
* @licence GNU GPL v2+
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
-/**
- * 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.
- *
- * @defgroup Maps Maps
- */
-
if ( !defined( 'MEDIAWIKI' ) ) {
die( 'Not an entry point.' );
}
if ( defined( 'Maps_VERSION' ) ) {
- // Do not initialize more then once.
- return;
+ // Do not initialize more than once.
+ return 1;
}
-define( 'Maps_VERSION' , '3.0 alpha' );
+define( 'Maps_VERSION' , '3.0-RC1' );
// 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( 'ParamProcessor_VERSION' ) ) {
- throw new Exception( 'You need to have ParamProcessor (Validator) 1.0 or later installed in order to use Maps' );
-}
-
-// 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' );
+if ( !defined( 'Validator_VERSION' ) ) {
+ throw new Exception( 'You need to have Validator installed in order to use Maps' );
}
if ( version_compare( $GLOBALS['wgVersion'], '1.18c' , '<' ) ) {
@@ -64,9 +34,9 @@
}
call_user_func( function() {
- global $wgExtensionCredits, $wgExtensionAssetsPath, $wgScriptPath, $wgAutoloadClasses;
+ global $wgExtensionCredits;
global $wgResourceModules, $wgGroupPermissions, $egMapsNamespaceIndex, $wgStyleVersion;
- global $egMapsScriptPath, $egMapsStyleVersion, $wgHooks, $wgExtensionMessagesFiles;
+ global $egMapsStyleVersion, $wgHooks, $wgExtensionMessagesFiles;
$wgExtensionCredits['parserhook'][] = array(
'path' => __FILE__ ,
@@ -85,7 +55,6 @@
define( 'Maps_COORDS_DM' , 'dm' );
define( 'Maps_COORDS_DD' , 'dd' );
- $egMapsScriptPath = ( $wgExtensionAssetsPath === false ? $wgScriptPath . '/extensions' : $wgExtensionAssetsPath ) . '/Maps';
$egMapsDir = __DIR__ . '/';
$egMapsStyleVersion = $wgStyleVersion . '-' . Maps_VERSION;
@@ -95,8 +64,6 @@
$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';
@@ -116,16 +83,14 @@
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';
+ $wgHooks['AdminLinks'][] = 'MapsHooks::addToAdminLinks';
+ $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
@@ -178,6 +143,9 @@
// Registration of the Google Geocoding (v2) service geocoder.
$wgHooks['GeocoderFirstCallInit'][] = 'MapsGoogleGeocoder::register';
+ // Registration of the geocoder.us service geocoder.
+ $wgHooks['GeocoderFirstCallInit'][] = 'MapsGeocoderusGeocoder::register';
+
// Layers
// Registration of the image layer type.
@@ -229,6 +197,14 @@
'string-parser' => 'Maps\LineParser',
);
+ $wgParamDefinitions['mapscircle'] = array(
+ 'string-parser' => 'Maps\CircleParser',
+ );
+
+ $wgParamDefinitions['mapsrectangle'] = array(
+ 'string-parser' => 'Maps\RectangleParser',
+ );
+
$wgParamDefinitions['mapspolygon'] = array(
'string-parser' => 'Maps\PolygonParser',
);
diff --git a/Maps.resources.php b/Maps.resources.php
index 16eccf6a7..698e9a225 100644
--- a/Maps.resources.php
+++ b/Maps.resources.php
@@ -5,9 +5,6 @@
*
* @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 >
@@ -18,7 +15,7 @@
$moduleTemplate = array(
'localBasePath' => __DIR__ . '/includes',
- 'remoteExtPath' => 'Maps/includes',
+ 'remoteExtPath' => '..' . substr( __DIR__, strlen( $GLOBALS['IP'] ) ) . '/includes',
'group' => 'ext.maps'
);
diff --git a/Maps_Settings.php b/Maps_Settings.php
index fd52d053b..a6caa82e8 100644
--- a/Maps_Settings.php
+++ b/Maps_Settings.php
@@ -1,98 +1,87 @@
$egMapsDefaultService,
+ $GLOBALS['egMapsDefaultServices'] = array(
+ 'display_map' => $GLOBALS['egMapsDefaultService'],
);
// 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.
+ // at http://www.geonames.org/login and set the username to $GLOBALS['egMapsGeoNamesUser'] below.
// Not doing this will result into a legacy service being used, which might be
// disabled at some future point.
- $egMapsAvailableGeoServices = array(
+ $GLOBALS['egMapsAvailableGeoServices'] = array(
'geonames',
'google',
+ 'geocoderus',
);
// 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';
+ $GLOBALS['egMapsDefaultGeoService'] = 'geonames';
// Boolean. Indicates if geocoders can override the default geoservice based on
// the used mapping service.
- $egMapsUserGeoOverrides = true;
+ $GLOBALS['egMapsUserGeoOverrides'] = true;
// Boolean. Sets if coordinates should be allowed in geocoding calls.
- $egMapsAllowCoordsGeocoding = true;
+ $GLOBALS['egMapsAllowCoordsGeocoding'] = true;
// Boolean. Sets if geocoded addresses should be stored in a cache.
- $egMapsEnableGeoCache = true;
+ $GLOBALS['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!
- $egMapsGeoNamesUser = '';
+ $GLOBALS['egMapsGeoNamesUser'] = '';
// Coordinate configuration
-global $egMapsAvailableCoordNotations, $egMapsCoordinateNotation, $egMapsCoordinateDirectional;
-global $egMapsInternatDirectionLabels;
// The coordinate notations that should be available.
- $egMapsAvailableCoordNotations = array(
+ $GLOBALS['egMapsAvailableCoordNotations'] = array(
Maps_COORDS_FLOAT,
Maps_COORDS_DMS,
Maps_COORDS_DM,
@@ -101,24 +90,23 @@
// 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;
+ $GLOBALS['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.
- $egMapsCoordinateDirectional = true;
+ $GLOBALS['egMapsCoordinateDirectional'] = true;
// Boolean. Sets if direction labels should be translated to their equivalent in the wiki language or not.
- $egMapsInternatDirectionLabels = true;
+ $GLOBALS['egMapsInternatDirectionLabels'] = true;
// 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(
+ $GLOBALS['egMapsDistanceUnits'] = array(
'm' => 1,
'meter' => 1,
'meters' => 1,
@@ -134,58 +122,53 @@
);
// String. The default unit for distances.
- $egMapsDistanceUnit = 'm';
+ $GLOBALS['egMapsDistanceUnit'] = 'm';
// Integer. The default amount of fractal digits in a distance.
- $egMapsDistanceDecimals = 2;
+ $GLOBALS['egMapsDistanceDecimals'] = 2;
// 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.
- $egMapsMapWidth = 'auto';
- $egMapsMapHeight = 350;
+ $GLOBALS['egMapsMapWidth'] = 'auto';
+ $GLOBALS['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.
- $egMapsSizeRestrictions = array(
+ $GLOBALS['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.
- $egMapsDefaultMapCentre = '0, 0';
+ $GLOBALS['egMapsDefaultMapCentre'] = '0, 0';
// Strings. The default content for all pop-ups. This value will only be used
// when the user does not provide one.
- $egMapsDefaultTitle = '';
- $egMapsDefaultLabel = '';
+ $GLOBALS['egMapsDefaultTitle'] = '';
+ $GLOBALS['egMapsDefaultLabel'] = '';
- $egMapsResizableByDefault = false;
+ $GLOBALS['egMapsResizableByDefault'] = false;
- $egMapsRezoomForKML = false;
+ $GLOBALS['egMapsRezoomForKML'] = false;
// 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;
+ $GLOBALS['egMapsDebugJS'] = false;
// Namespace index start of the mapping namespaces.
- $egMapsNamespaceIndex = 420;
+ $GLOBALS['egMapsNamespaceIndex'] = 420;
// Boolean. Controls if you can specify images using a full path in layers.
- $egMapsAllowExternalImages = true;
+ $GLOBALS['egMapsAllowExternalImages'] = true;
@@ -193,17 +176,13 @@
// 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;
+ $GLOBALS['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.
- $egMapsGMaps3Types = array(
+ $GLOBALS['egMapsGMaps3Types'] = array(
'roadmap',
'satellite',
'hybrid',
@@ -212,10 +191,10 @@
// String. The default map type. This value will only be used when the user
// does not provide one.
- $egMapsGMaps3Type = 'roadmap';
+ $GLOBALS['egMapsGMaps3Type'] = 'roadmap';
// Array. List of controls to display onto maps by default.
- $egMapsGMaps3Controls = array(
+ $GLOBALS['egMapsGMaps3Controls'] = array(
'pan',
'zoom',
'type',
@@ -225,47 +204,44 @@
// String. The default style for the type control.
// horizontal, vertical or default
- $egMapsGMaps3DefTypeStyle = 'default';
+ $GLOBALS['egMapsGMaps3DefTypeStyle'] = 'default';
// String. The default style for the zoom control.
// small, large or default
- $egMapsGMaps3DefZoomStyle = 'default';
+ $GLOBALS['egMapsGMaps3DefZoomStyle'] = 'default';
// Boolean. Open the info windows on load by default?
- $egMapsGMaps3AutoInfoWindows = false;
+ $GLOBALS['egMapsGMaps3AutoInfoWindows'] = false;
// Array. Layers to load by default.
// traffic and bicycling
- $egMapsGMaps3Layers = array();
+ $GLOBALS['egMapsGMaps3Layers'] = array();
// Integer. Default tilt when using Google Maps.
- $egMapsGMaps3DefaultTilt = 0;
+ $GLOBALS['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.
- $egGoogleJsApiKey = '';
+ $GLOBALS['egGoogleJsApiKey'] = '';
// Show points of interest or not.
- $egMapsShowPOI = true;
+ $GLOBALS['egMapsShowPOI'] = true;
// 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;
+ $GLOBALS['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
- $egMapsOLControls = array(
+ $GLOBALS['egMapsOLControls'] = array(
'layerswitcher',
'mouseposition',
'autopanzoom',
@@ -275,14 +251,14 @@
// Array of String. The default layers for Open Layers. This value will only be
// used when the user does not provide one.
- $egMapsOLLayers = array(
+ $GLOBALS['egMapsOLLayers'] = array(
'osm-mapnik',
'osm-cyclemap',
'osmarender'
);
// The difinitions for the layers that should be available for the user.
- $egMapsOLAvailableLayers = array(
+ $GLOBALS['egMapsOLAvailableLayers'] = array(
//'google' => array( 'OpenLayers.Layer.Google("Google Streets")' ),
'bing-normal' => array( 'OpenLayers.Layer.VirtualEarth( "Bing Streets", {type: VEMapStyle.Shaded, "sphericalMercator":true} )', 'bing' ),
@@ -307,8 +283,8 @@
);
// Layer group definitions. Group names must be different from layer names, and
- // must only contain layers that are present in $egMapsOLAvailableLayers.
- $egMapsOLLayerGroups = array(
+ // must only contain layers that are present in $GLOBALS['egMapsOLAvailableLayers'].
+ $GLOBALS['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' ),
@@ -318,7 +294,7 @@
global $wgJsMimeType;
// Layer dependencies
- $egMapsOLLayerDependencies = array(
+ $GLOBALS['egMapsOLLayerDependencies'] = array(
'yahoo' => "",
'bing' => "",
'ol-wms' => "",
@@ -327,12 +303,10 @@
// 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;
+ $GLOBALS['egMapsLeafletZoom'] = 14;
-global $egMapsGlobalJSVars;
-$egMapsGlobalJSVars = array();
\ No newline at end of file
+$GLOBALS['egMapsGlobalJSVars'] = array();
diff --git a/README.md b/README.md
index ecacb28e4..535ab5ab8 100644
--- a/README.md
+++ b/README.md
@@ -1,33 +1,49 @@
# 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.
-
-[](http://travis-ci.org/wikimedia/mediawiki-extensions-Maps)
-[](https://coveralls.io/r/wikimedia/mediawiki-extensions-Maps?branch=master)
+Maps is a [MediaWiki](https://www.mediawiki.org) extension to work with and visualise geographical
+information.
+
+Features:
+
+* Powerful #display_map parser hook for embedding highly customizable dynamic maps into wiki pages.
+* Support for multiple mapping services: Google Maps, [OpenLayers](http://www.openlayers.org/),
+[OpenStreetMap](www.openstreetmap.org/) and [Leaflet](http://leafletjs.com/).
+* Coordinate formatting and format conversion via the #coordinates parser function.
+* Geocoding via several supported services with the #geocode parser function.
+* Geospatial operations
+ * Calculating the distance between two points with #geodistance
+ * Finding a destination given a starting point, bearing and distance with #finddestination
+* Distance formatting and format conversion via the #distance parser function.
+* Visual map editor (Special:MapEditor) to edit #display_map wikitext.
+* Structured data support provided by the [Semantic Maps extension]
+(https://www.mediawiki.org/wiki/Extension:Semantic_Maps).
+
+View the [release notes](docs/RELEASE-NOTES.md) for recent changes to Maps.
+
+### User manual
+
+* [Installation and configuration](docs/INSTALL.md)
+* [Usage instructions and examples](https://semantic-mediawiki.org/wiki/Maps)
+
+## Project status
+
+[](http://travis-ci.org/JeroenDeDauw/Maps)
+[](https://coveralls.io/r/JeroenDeDauw/Maps?branch=master)
+[](https://scrutinizer-ci.com/g/JeroenDeDauw/Maps/)
[](https://www.versioneye.com/php/mediawiki:maps/dev-master)
On [Packagist](https://packagist.org/packages/mediawiki/maps):
[](https://packagist.org/packages/mediawiki/maps)
[](https://packagist.org/packages/mediawiki/maps)
-Notes on installing Maps are found in the file INSTALL.
+* [Maps on Ohloh](https://www.ohloh.net/p/maps/)
+* [Blog posts about Maps](http://www.bn2vs.com/blog/tag/maps)
+* [Open bugs and feature requests](https://bugzilla.wikimedia.org/buglist.cgi?list_id=254461&resolution=---&query_format=advanced&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=PATCH_TO_REVIEW&bug_status=REOPENED&component=Maps)
## 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.
-
+Feel free to fork the [code on GitHub](https://github.com/JeroenDeDauw/Maps) and to submit pull
+requests.
## Credits to other projects
@@ -60,8 +76,8 @@ It is released under the
### OpenStreetMap.js
-This extension includes the OpenStreetMap.js file which can be found here:
-http://www.openstreetmap.org/openlayers/OpenStreetMap.js
+This extension includes the OpenStreetMap.js file which can be found
+[here](http://www.openstreetmap.org/openlayers/OpenStreetMap.js).
## Links
@@ -69,5 +85,5 @@ http://www.openstreetmap.org/openlayers/OpenStreetMap.js
* [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)
\ No newline at end of file
+* [TravisCI build status](https://travis-ci.org/JeroenDeDauw/Maps)
+* [Semantic Maps on MediaWiki.org](https://www.mediawiki.org/wiki/Extension:Semantic_Maps)
diff --git a/ROADMAP b/ROADMAP
deleted file mode 100644
index 7eccace2b..000000000
--- a/ROADMAP
+++ /dev/null
@@ -1,10 +0,0 @@
-This is the roadmap and release schedule for the Maps extension.
-
-Extension page on mediawiki.org: https://www.mediawiki.org/wiki/Extension:Maps
-Latest version of the roadmap: https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/Maps.git;a=blob;f=ROADMAP
-
-== Maps 2.1 ==
-
-End 2012
-
-* Migrate parameters to Validator >=0.5 style definitions
\ No newline at end of file
diff --git a/build/travis/after_success.sh b/build/travis/after_success.sh
new file mode 100644
index 000000000..658a44f11
--- /dev/null
+++ b/build/travis/after_success.sh
@@ -0,0 +1,10 @@
+#! /bin/bash
+
+set -x
+
+if [ "$MW-$DBTYPE" == "master-mysql" ]
+then
+ cd ../../extensions/Maps
+ composer require satooshi/php-coveralls:dev-master
+ php vendor/bin/coveralls -v
+fi
\ No newline at end of file
diff --git a/.travis.sh b/build/travis/before_script.sh
similarity index 68%
rename from .travis.sh
rename to build/travis/before_script.sh
index be8deae4a..34ed971f2 100644
--- a/.travis.sh
+++ b/build/travis/before_script.sh
@@ -6,22 +6,27 @@ originalDirectory=$(pwd)
cd ..
-git clone https://gerrit.wikimedia.org/r/p/mediawiki/core.git phase3 --depth 1
+wget https://github.com/wikimedia/mediawiki-core/archive/$MW.tar.gz
+tar -zxf $MW.tar.gz
+mv mediawiki-core-$MW phase3
cd phase3
+git checkout $MW
+
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
+php maintenance/install.php --dbtype $DBTYPE --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
+composer install
+
cd ../..
-pwd
-ls -lap
+echo 'require_once( __DIR__ . "/extensions/Maps/Maps.php" );' >> LocalSettings.php
echo 'error_reporting(E_ALL| E_STRICT);' >> LocalSettings.php
echo 'ini_set("display_errors", 1);' >> LocalSettings.php
@@ -29,6 +34,4 @@ 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
diff --git a/build/travis/script.sh b/build/travis/script.sh
new file mode 100644
index 000000000..8021072ee
--- /dev/null
+++ b/build/travis/script.sh
@@ -0,0 +1,12 @@
+#! /bin/bash
+
+set -x
+
+cd ../phase3/extensions/Maps
+
+if [ "$MW-$DBTYPE" == "master-mysql" ]
+then
+ phpunit --coverage-clover ../../extensions/Maps/build/logs/clover.xml
+else
+ phpunit
+fi
\ No newline at end of file
diff --git a/composer.json b/composer.json
index c5d95cd7d..3f8bfe953 100644
--- a/composer.json
+++ b/composer.json
@@ -1,8 +1,17 @@
{
"name": "mediawiki/maps",
+ "type": "mediawiki-extension",
"description": "Adds various mapping features to MediaWiki",
- "keywords": ["MediaWiki", "Semantic MediaWiki", "Maps", "Google Maps", "OpenLayers", "OSM", "OpenStreetMap"],
- "homepage": "https://www.mediawiki.org/wiki/Extension:Maps",
+ "keywords": [
+ "MediaWiki",
+ "Semantic MediaWiki",
+ "Maps",
+ "Google Maps",
+ "OpenLayers",
+ "OSM",
+ "OpenStreetMap"
+ ],
+ "homepage": "https://github.com/JeroenDeDauw/Maps",
"license": "GPL-2.0+",
"authors": [
{
@@ -16,14 +25,24 @@
"email": "semediawiki-user@lists.sourceforge.net",
"issues": "https://bugzilla.wikimedia.org/",
"irc": "irc://irc.freenode.net/mediawiki",
- "forum": "https://www.mediawiki.org/wiki/Extension_talk:Maps",
- "wiki": "https://www.mediawiki.org/wiki/Extension:Maps",
- "source": "https://github.com/wikimedia/mediawiki-extensions-Maps"
+ "source": "https://github.com/JeroenDeDauw/Maps"
},
"require": {
- "php": ">=5.3.0",
- "param-processor/param-processor": "dev-master",
- "data-values/data-values": "dev-master"
+ "php": ">=5.3.2",
+ "composer/installers": ">=1.0.1",
+ "mediawiki/validator": "1.*,>1.0",
+ "data-values/geo": "0.*,>=0.1.1"
},
- "minimum-stability" : "dev"
+ "autoload": {
+ "files" : [
+ "Maps.php"
+ ],
+ "classmap": [
+ "src/",
+ "includes/",
+ "Maps.hooks.php",
+ "tests/phpunit/elements/",
+ "tests/phpunit/parserhooks/ParserHookTest.php"
+ ]
+ }
}
diff --git a/docs/INSTALL.md b/docs/INSTALL.md
new file mode 100644
index 000000000..52fd114f5
--- /dev/null
+++ b/docs/INSTALL.md
@@ -0,0 +1,116 @@
+# Maps installation
+
+These are the installation and configuration instructions for the [Maps extension](../README.md).
+
+## Versions
+
+
+
+When installing Maps 2.x, see the installation instructions that come bundled with it. Also
+make use of Validator 0.5.x. More recent versions of Validator will not work.
+
+### Database support
+
+All current versions of Maps have full support for all databases that can be used with MediaWiki.
+
+## Download and installation
+
+The recommended way to download and install Maps is with [Composer](http://getcomposer.org) using
+[MediaWiki 1.22 built-in support for Composer](https://www.mediawiki.org/wiki/Composer). MediaWiki
+versions prior to 1.22 can use Composer via the
+[Extension Installer](https://github.com/JeroenDeDauw/ExtensionInstaller/blob/master/README.md)
+extension.
+
+#### Step 1
+
+If you have MediaWiki 1.22 or later, go to the root directory of your MediaWiki installation,
+and go to step 2. You do not need to install any extensions to support composer.
+
+For MediaWiki 1.21.x and earlier you need to install the
+[Extension Installer](https://github.com/JeroenDeDauw/ExtensionInstaller/blob/master/README.md) extension.
+
+Once you are done installing the Extension Installer, go to its directory so composer.phar
+is installed in the right place.
+
+ cd extensions/ExtensionInstaller
+
+#### Step 2
+
+If you have previously installed Composer skip to step 3.
+
+To install Composer:
+
+ wget http://getcomposer.org/composer.phar
+
+#### Step 3
+
+Now using Composer, install Maps
+
+ php composer.phar require mediawiki/maps "*"
+
+#### Verify installation success
+
+As final step, you can verify Maps got installed by looking at the Special:Version page on your wiki and verifying the
+Maps extension is listed.
+
+## Configuration
+
+See the [Maps settings file](../Maps_Settings.php) for the available configuration options.
diff --git a/RELEASE-NOTES b/docs/RELEASE-NOTES.md
similarity index 66%
rename from RELEASE-NOTES
rename to docs/RELEASE-NOTES.md
index ca61fdd5a..1cc468a41 100644
--- a/RELEASE-NOTES
+++ b/docs/RELEASE-NOTES.md
@@ -1,28 +1,29 @@
-These are the release notes for the Maps extension.
+These are the release notes for the [Maps extension](../README.md).
-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 3.0 ===
-(dev)
+## 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
+facilitate maintenance, new feature deployment 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
+#### 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
+#### New features
* Added leaflet service
+* Added Geocoder.us geoservice support
+
+#### Bug fixes
+
+* Fixed autoinfowindows functionality.
+* Fixed various bugs in geocoordinate parsing and formatting.
-; Breaking internal changes
+#### Breaking internal changes
* Moved classes into Maps namespace
* Removed all Criteria classes
@@ -31,15 +32,9 @@ bugs have been found and fixed. No big new features have been added.
* Geocoding interfaces changed
* MapsLocation interface changed
-; Bug fixes
-
-* Fixed autoinfowindows functionality.
-* Fixed various bugs in geocoordinate parsing and formatting.
-
-=== Maps 2.0 ===
-(2012-10-05)
+## Maps 2.0 (2012-10-05)
-; Compatibility changes
+#### Compatibility changes
* Changed minimum PHP version from 5.2 to 5.3.
* Changed minimum MediaWiki version from 1.17 to 1.18.
@@ -48,7 +43,7 @@ bugs have been found and fixed. No big new features have been added.
* Removed support for the now unsupported Yahoo! Maps API and associated geocoding service.
* Temporary disabled OSM service (you can still use OSM with the OpenLayers service).
-; New features
+#### New features
* Added support for defining an inline label to markers to GoogleMaps.
* Added support for marker clustering to Google Maps.
@@ -65,160 +60,132 @@ bugs have been found and fixed. No big new features have been added.
* Added an optional link parameter as an alternative to popup bubble with text and title
* Added an optional visitedicon parameter (both global and marker parameter), that will change the icon of a marker on click.
-; Other improvements
+#### Other improvements
* Merged display_map and display_point(s) into a single parser function: display_map (display_points is now an alias).
* Updates parameter definitions from Validator 0.4.x to Validator 0.5.x.
* Improved script loading.
* Added various unit tests that caught some bugs and will now prevent regressions.
-; Bug fixes
+#### Bug fixes
* Fixed JavaScript error on some special pages due to incorrect order of map initialization.
* Fixed partially broken kml functionality.
-=== Maps 1.0.5 ===
-(2011-11-30)
+## Maps 1.0.5 (2011-11-30)
* Fixed display of attribution control for OpenLayers.
* Fixed to big precision of geographic coordinates in decimal minutes format (bug 32407).
-=== Maps 1.0.4 ===
-(2011-10-15)
+## Maps 1.0.4 (2011-10-15)
* Updated OpenLayers from 2.10 to 2.11.
-* Fixed bug in adding adittional markers for Google Maps v3 (mainly affecting the Semantic Maps form input).
+* Fixed bug in adding additional markers for Google Maps v3 (mainly affecting the Semantic Maps form input).
-=== Maps 1.0.3 ===
-(2011-09-14)
+## Maps 1.0.3 (2011-09-14)
* Added API module for geocoding.
* Added 'geocoding' right.
* Added kmlrezoom parameter for Google Maps v3 and general $egMapsRezoomForKML setting.
-* Fixed Google Maps v3 JavaScript issue occuring on MediaWiki 1.17.
+* Fixed Google Maps v3 JavaScript issue occurring on MediaWiki 1.17.
-=== Maps 1.0.2 ===
-(2011-08-24)
+## Maps 1.0.2 (2011-08-24)
-* Fixed Google Maps v3 JavaScript issue occuring when using Google Earth on unsupported systems.
+* Fixed Google Maps v3 JavaScript issue occurring when using Google Earth on unsupported systems.
* Fixed internationalization of distances (bug 30467).
-=== Maps 1.0.1 ===
-(2011-08-17)
+## Maps 1.0.1 (2011-08-17)
* Added language parameter to the mapsdoc hook.
-
* Use of Validator 0.4.10s setMessage method instead of setDescription for better i18n.
-
* Fixed zoom and types parameters for Google Maps v3.
-
* Minor improvement to script loading.
-
* Added support for Google Earth in Google Maps v3.
-
* Added tilt parameter for Google Earth in Google Maps v3.
-=== Maps 1.0 ===
-(2011-07-19)
+## Maps 1.0 (2011-07-19)
This version branched from Maps 0.7.x at version 0.7.3.
-==== New features ====
+#### New features ####
* Added full Google Maps v3 support and set it as the default mapping service.
-
* Added new geocoder making use of the new GeoNames API.
-
* Added support for the auto-documentation features for parser hooks introduced in Validator 0.4.3.
-
* Added resizeable parameter to all mapping services except OSM.
-==== Removed features ====
+#### Removed features ####
* Removed compatibility with pre MediaWiki 1.17.
-
* Removed overlays parameter for Google Maps v2.
+* Removed the previously deprecated "display map", "display point" and "display points" parser hooks.
+Use their underscored equivalents, ie "display_map".
-* Removed the previously deprecated "display map", "display point" and "display points" parser hooks. Use their underscored equivalents, ie "display_map".
-
-==== Internal improvements ====
+#### Internal improvements ####
* Usage of the Resource Loader for all scripts and stylesheets.
-
* Rewrote all the map JavaScript to jQuery plugins.
-
* Rewrote the way parameters are translated to JavaScript. Now one big PHP object is json_encoded.
-
* Improved KML formatter.
-
* Use of Google Maps geocoding service v3 instead of v2.
+* Completed coordinate and distance parser/formatter unit tests and made them compliant with the
+MediaWiki unit testing support.
-* Completed coordinate and distance parser/formatter unit tests and made them compliant with the MediaWiki unit testing support.
-
-==== Bug fixes ====
+#### Bug fixes ####
* Fixed geocoding service overriding based on mapping service (merged in from Maps 0.7.5).
-
* Fixed fatal error occurring when running maintenance/refreshLinks.php.
-
* Fixed DMS coordinate parsing issue (bug 29419).
-
* Fixed coordinate normalization issue (bug 29421).
-==== Other tweaks ====
+#### Other tweaks ####
* Improved default width of maps (merged in from Maps 0.7.5).
-=== Maps 0.7.3 ===
+## Maps 0.7.3 ##
(2010-11-30)
* Some internal improvements and translation updates.
-
* Fixed issue occurring when Maps is the only extension adding custom namespaces.
-
-=== Maps 0.7.2 ===
+## Maps 0.7.2 ##
(2010-10-28)
-==== New features ====
+#### New features ####
* Added experimental support for KML layer definitions.
-==== Internal improvements ====
+#### Internal improvements ####
* Extended the layer handling to support different types of layers, each of which can be supported by one or more mapping services.
-==== Bug fixes ====
+#### Bug fixes ####
* Fixed incompatibility with MW 1.15.x.
-
-* Fixed incorect parsing of certain DM and DMS coordinates.
-
+* Fixed incorrect parsing of certain DM and DMS coordinates.
* Fixed small layout issue with pop-ups in Google Maps.
-
* Fixed incorrect error on non-existing pages in the Layer namespace.
-=== Maps 0.7.1 ===
+## Maps 0.7.1 ##
(2010-10-20)
-==== New features ====
+#### New features ####
* Image layers for OpenLayers maps, defined via pages in the Layer namespace.
-==== Bug fixes ====
+#### Bug fixes ####
* Support for images without namespace prefix in the display points parser hook.
-
* Fixed layer oder for OpenLayers maps.
-==== Internal improvements ====
+#### Internal improvements ####
* Rewrote OpenLayers layer handling.
-=== Maps 0.7 ===
+## Maps 0.7 ##
(2010-10-15)
-==== New features ====
+#### New features ####
* Tag support for these parser hooks (which previously only had parser function support):
** Coordinates
@@ -226,585 +193,532 @@ This version branched from Maps 0.7.x at version 0.7.3.
** Finddestination
** Geocode
** Geodistance
-
* Thumbs and photos parameters for the OSM service.
-==== Bug fixes ====
+#### Bug fixes ####
* Fixed compatibility with the MW 1.17 resource loader.
-
* Fixed i18n issue with the overlays control for Google Maps v2 maps.
-
* Fixed default zoom level for Yahoo! Maps maps.
-
* Increased the maximum decimals for DMS coordinates from 2 to 20.
-==== Removed features ====
+#### Removed features ####
* #geocodelong and #geocodelat parser functions - you can obtain their functionality using #geocode.
-==== Internal improvements ====
+#### Internal improvements ####
* Rewrote the geocoding functionality. It's now an integral part of the extension that can not be just pulled out,
while the reverse is true for individual geocoders. Geocoder interaction now uses the same model as mapping
service interaction.
-
* Use of Validator 0.4, allowing for more robust and consistent error reporting.
-
* Rewrote the parser hooks to use the ParserHook class provided by Validator.
-
* Restructured the directory structure of the extension to better match it's architecture.
-
* Use of OpenLayers 2.10 instead of 2.9.
-=== Maps 0.6.6 ===
+## Maps 0.6.6 ##
(2010-08-26)
-==== New features ====
+#### New features ####
* Support for geocoding over proxies.
-
* Added $egMapsInternatDirectionLabels settings, allowing users to disable internationalization of direction labels.
-==== Refactoring ====
-
-* Added MapsMappingServices, which serves as factory for MapsPappingService objects and does away with all the globals previously needed for this.
+#### Refactoring ####
+* Added MapsMappingServices, which serves as factory for MapsPappingService objects and does away
+with all the globals previously needed for this.
* Removed the http/curl request code from the geocoder classes - now using Http:get() instead.
-==== Bug fixes ====
+#### Bug fixes ####
* Fixed issue that caused pop-up contents to render incorrectly when it contained wiki markup.
-
* Fixed coordinate parsing bug (direction labels did not get recognized) that was introduced in 0.6.4.
-
* Fixed spacing issues with several parser functions.
-=== Maps 0.6.5 ===
+## Maps 0.6.5 ##
(2010-07-27)
-==== Refactoring ====
+#### Refactoring ####
* Added unit tests for the coordinates parser.
-
* Created iMappingFeature interface, from which iMapParserFunctions inherits.
-
* Moved map id creation to the mapping service class for all features.
-
-* Moved marker JavaScript creation for display_points to the mapping service class for all features.
-
+* Moved marker JavaScript creation for display_points to the mapping service class for all features.
* Moved default zoom level access method to the mapping service class for all features.
-
* Improved the way marker data is turned into JavaScript variables.
-
* Improved coordinate recognition regexes.
-==== Bug fixes ====
+#### Bug fixes ####
* Fixed several small coordinate parsing and formatting issues.
-
* Fixed a few small distance parsing issues.
-=== Maps 0.6.4 ===
+## Maps 0.6.4 ##
(2010-07-08)
-==== New features ====
+#### New features ####
* Added new OSM service based on iframe inclusion of toolserver page that renders OpenStreetMap tiles with Wikipedia overlays.
-
* Added internationalization to the OpenLayers service.
-
* Added support for including KML files for Google Maps v2.
-
* Added 'searchbar' control for Google Maps v2.
-==== Refactoring ====
+#### Refactoring ####
* Moved more functionality over from feature classes to service classes to prevent crazy code-flow and code duplication.
-==== Bug fixes ====
+#### Bug fixes ####
* Fixed bug in the OpenLayers service causing it to display badly in Chrome.
-
* Fixed issue with with and height validation for % values, also causing backward compatibility problems with pre 0.6 setting definitions.
-
* Fixed several small bugs in the coordinate parser.
-=== Maps 0.6.3 ===
+## Maps 0.6.3 ##
(2010-06-20)
-==== Refactoring ====
+#### Refactoring ####
* Mayor refactoring of the mapping service handling, to make the code flow less messy and be able to do mapping service related things in a more consistent fashion.
-
* Upgrade to OpenLayers 2.9.1.
-==== Bug fixes ====
+#### Bug fixes ####
* Fixed severe bug in the coordinate parsing that removed the degree symbol from passes values, resulting in rendering most of them invalid. Presumably present since 0.6.2.
-=== Maps 0.6.2 ===
+## Maps 0.6.2 ##
(2010-06-07)
-==== New features ====
+#### New features ####
* Added #distance parser function parse distances using any of the supported units and outputting them in any of these.
-
* Made supported distance units configurable and added setting for the default distance unit.
-
* Added 'decimals' and 'unit' parameters to #geosiatnce.
-
* Default parameter handling improvements (via Validator 0.3.2).
-==== Bug fixes ====
+#### Bug fixes ####
* Re-added parameter name and value insensitivity (via Validator 0.3.2).
-=== Maps 0.6.1 ===
+## Maps 0.6.1 ##
(2010-06-04)
-==== Bug fixes ====
+#### Bug fixes ####
* Fixed bug that caused geocoding requests to fail when using display_points
-
* Fixed bug that had broken the geoservice parameter for display_points and display_map.
-
* Fixed bug that made OSM layers in the OpenLayers service fail.
-
* Fixed issue that made custom markers on Google Maps not show up on initial page load and centred them wrongly.
-=== Maps 0.6 ===
+## Maps 0.6 ##
(2010-05-31)
-==== New features ====
-
-* Added support for width and height in px, ex, em and %, instead of only px, allowing for maps that adjust their size to the screen width and other content.
-
-* Added full support for both directional and non-directional coordinate notations in DMS, DD, DM and float notation.
+#### New features ####
+* Added support for width and height in px, ex, em and %, instead of only px, allowing for maps that
+adjust their size to the screen width and other content.
+* Added full support for both directional and non-directional coordinate notations in DMS, DD, DM
+and float notation.
* Added #coordinates parser function which allows rewformatting of coordinates to all supported notations.
-
-* Rewrote the #geocode parser function to work with named parameters and added support for smart geocoding. Now takes in all supported coordinate notations, and is able to output in all of them as well.
-
+* Rewrote the #geocode parser function to work with named parameters and added support for smart
+geocoding. Now takes in all supported coordinate notations, and is able to output in all of them as well.
* Added #geodistance function (based on the one in MathFunctions) with smart geocoding support.
-
* Added #finddestination function with smart geocoding support.
-==== Refactoring ====
-
-* Rewrote the handling of the display_map and display_point(s) parser functions, esp the way the service parameter is getting determined and acted upon.
+#### Refactoring ####
+* Rewrote the handling of the display_map and display_point(s) parser functions, esp the way the
+service parameter is getting determined and acted upon.
* Removed the MapsMapFeature class to make the base classes for the features more independent and flexible.
-
* Restructured the directory structure to make what the services and features are more clear.
-
* Rewrote map divs and added loading message for each map.
-
* Rewrote individual map JS to be added to the page header.
-
-* Mayor clean up of the coordinate handling, to allow for coordinate formatting and to facilitate better integration by the GeoCoords data type in Semantic Maps. All this code is now located in MapsCoordinateParser.
-
+* Mayor clean up of the coordinate handling, to allow for coordinate formatting and to facilitate
+better integration by the GeoCoords data type in Semantic Maps. All this code is now located in MapsCoordinateParser.
* Use native MW hook system for mapping services and features if possible.
-
* Updated the magic words to mw >=1.16 style, and retained backward compatibility.
-
* Updated the OpenLayers version from 2.8 to 2.9.
-
* Rewrote the parameter definitions to work with Validator 0.3.
-
* Rewrote the resource inclusion html to make the code cleaner and more secure.
-==== Bug fixes ====
-
-* Changed parsing of parameters so that '=' signs in values don't cause themselves and proceeding characters to be omitted.
-
-* Add mapping to the language codes that are send to the Google Maps API to null the naming differences between MW and the API.
+#### Bug fixes ####
+* Changed parsing of parameters so that '=' signs in values don't cause themselves and
+proceeding characters to be omitted.
+* Add mapping to the language codes that are send to the Google Maps API to null the naming
+differences between MW and the API.
* Added automatic icon image sizing for Google Maps and Yahoo! Maps markers.
-
* Fixed conflict with prototype library that caused compatibility problems with the Halo extension.
-=== Maps 0.5.5. ===
+## Maps 0.5.5. ##
(2010-03-20)
-==== Refactoring ====
+#### Refactoring ####
* Stylized the code to conform to MediaWiki's spacing conventions.
-==== Bug fixes ====
+#### Bug fixes ####
* Fixed issue with scrollbar in pop-ups on Google Maps maps.
-
* Fixed Google Maps key issue with OpenLayers that arose from the new OpenLayers layer definition system.
-
* Fixed JS issue with Google Maps default overlays.
-=== Maps 0.5.4 ===
+## Maps 0.5.4 ##
(2010-03-01)
-==== New features ====
+#### New features ####
* Added the ability to define the layers (and their dependencies) that can be added by users to an OpenLayers map.
-
* Added the ability to define "layer groups" for OpenLayers layers.
-==== Refactoring ====
+#### Refactoring ####
* Moved the OpenLayers layer definition validation and selection from JS to PHP.
-==== Bug fixes ====
+#### Bug fixes ####
* Fixed bug causing the default zoom for each mapping service to be off.
-
* Fixed potential xss vectors.
-
* Fixed minor JS error that was present for all maps except OSM.
-=== Maps 0.5.3 ===
+## Maps 0.5.3 ##
(2010-02-01)
-==== New features ====
+#### New features ####
* Added Google Maps v3 support for display_map.
-==== Refactoring ====
+#### Refactoring ####
* Added service defaulting for features using a hook themselves.
-==== Bug fixes ====
+#### Bug fixes ####
* Fixed JavaScript bug causing all OSM maps to fail.
-=== Maps 0.5.2 ===
+## Maps 0.5.2 ##
(2010-01-20)
-==== New features ====
+#### New features ####
-* Added icon parameter to display_point(s), allowing you to set the icon for all markers that do not have a specific icon assigned.
+* Added icon parameter to display_point(s), allowing you to set the icon for all markers that do not
+have a specific icon assigned.
-==== Refactoring ====
+#### Refactoring ####
* Usage of Validator 0.2 features for the static map specific parameters.
-==== Bug fixes ====
+#### Bug fixes ####
* Fixed escaping issue causing wikitext in the title and label parameters not to be displayed correctly.
-
* Fixed file path for location specific icons.
-=== Maps 0.5.1 ===
+## Maps 0.5.1 ##
(2009-12-25)
-==== New features ====
+#### New features ####
-* Integrated further with Validator by holding into account the error level for coordinate validation in the display_ parser functions.
+* Integrated further with Validator by holding into account the error level for coordinate validation
+in the display_ parser functions.
* Added activatable= parameter to the static map support.
-==== Refactoring ====
+#### Refactoring ####
* Cleaned up the static map code for OSM display_map.
-
* Modified the parameter definitions to work with Validator 0.2
-
* Removed redundant (because of Validator 0.2) utility function calls from the mapping classes.
-
* Removed redundant (because of Validator 0.2) utility functions from the mapping service files.
-==== Bug fixes ====
+#### Bug fixes ####
* Fixed issue with the hook system that caused code to get executed when it shouldn't.
-=== Maps 0.5 ===
+## Maps 0.5 ##
(2009-12-17)
-==== New features ====
+#### New features ####
* Added strict parameter validation.
-
* Added smart 'autopanzoom' like control for Google Maps and Yahoo! Maps.
-
* Added internationalization to the OSM service, and an extra parameter to define per-map languages.
-
* Static map support, similar and based upon SlippyMap.
-==== Refactoring ====
+#### Refactoring ####
* Rewrite the parameter handling to be more centralized and modular.
-** Make it possible to override the info of parameters for mapping services, including their aliases, default values and criteria.
-** Make it possible to add and override parameters in each segment of Maps, instead of only the mapping services.
+** Make it possible to override the info of parameters for mapping services, including
+their aliases, default values and criteria.
+** Make it possible to add and override parameters in each segment of Maps, instead of only
+the mapping services.
* Cleaned up and centralized parser function code.
-
-* Refactored the marker specific data handling code in every display point class up to a central location.
-
+* Refactored the marker specific data handling code in every display point class up to
+a central location.
* Removed backward compatibility (to 0.2.x and earlier) of the earth parameter.
-
* Removed support for Google Map API map type names for Google Maps.
-
-* Added code to unload any services from the service hook that are not present in the list of allowed services. This ensures they don't get initialized, and makes any check to see if the service is one of the allowed ones further on unneeded.
-
+* Added code to unload any services from the service hook that are not present in the list of
+allowed services. This ensures they don't get initialized, and makes any check to see if the
+service is one of the allowed ones further on unneeded.
* Added checks for extension dependencies that need to be present for Maps to be initialized.
-==== Bug fixes ====
+#### Bug fixes ####
* Fixed bug causing markers not to show up when a specific description was provided.
-==== Documenting ====
+#### Documenting ####
* Created screencast demonstrating display_map usage.
-
* Creates screencast demonstrating display_point usage.
+* Updated the developer documentation about hooking into and extending Maps to be useful
+for the current version.
-* Updated the developer documentation about hooking into and extending Maps to be useful for the current version.
-
-===Maps 0.4.2===
+##Maps 0.4.2##
(2009-11-15)
Changes in 0.4.2 discussed on the authors blog:
-* [http://blog.bn2vs.com/2009/11/16/maps-and-semantic-maps-0-4-2/ Maps and Semantic Maps 0.4.2 released]
-* [http://blog.bn2vs.com/2009/11/12/new-in-maps-0-4-2/ New in Maps 0.4.2]
-
-==== New features ====
+* [Maps and Semantic Maps 0.4.2 released](http://www.bn2vs.com/blog/2009/11/16/maps-and-semantic-maps-0-4-2/)
+* [New in Maps 0.4.2](http://www.bn2vs.com/blog/2009/11/12/new-in-maps-0-4-2/)
-* Added overlays to Google Maps. This includes both an 'overlay' control, and a new parameter to choose the available and default loaded overlays.
+#### New features ####
-* Added specific handling for the coordinates= and addresses= parameters for both display_map and display_point(s). You can now specify you do not want anything that's not a coordinate on your map (so no geocoding) with the coordinates= parameter, or let Maps know everything is an address with the addresses= parameter, causing everything to be geocoded. Also modified the error messages for wrong addresses and coordinates to fit this new behavior.
+* Added overlays to Google Maps. This includes both an 'overlay' control, and a new parameter
+to choose the available and default loaded overlays.
+* Added specific handling for the coordinates= and addresses= parameters for both display_map
+and display_point(s). You can now specify you do not want anything that's not a coordinate on
+your map (so no geocoding) with the coordinates= parameter, or let Maps know everything is
+an address with the addresses= parameter, causing everything to be geocoded. Also modified
+the error messages for wrong addresses and coordinates to fit this new behavior.
-==== Refactoring ====
+#### Refactoring ####
-* Added the version of Maps to the JS files call, to prevent issues when functions or calls are changed in new versions.
+* Added the version of Maps to the JS files call, to prevent issues when functions or calls
+are changed in new versions.
+* Changed the JavaScript map parameters for Google Maps from individual parameters to a group.
-* Changed the JavaScript map parameters for Google Maps from individual parameters to a groupe.
-
-==== Bug fixes ====
+#### Bug fixes ####
* Fixed inclusion path to the OSM JS file. This bug prevented any OSM maps from showing up.
-
-* Fixed display_map and the centre parameter of display_point(s). Both are unusable by a bug introduced in 0.4.1.
-
-* Fixed bug causing to many decimal digits in some coordinate notations, making them unrecognisable for Maps.
-
+* Fixed display_map and the centre parameter of display_point(s). Both are unusable by a bug
+introduced in 0.4.1.
+* Fixed bug causing to many decimal digits in some coordinate notations, making them unrecognisable
+for Maps.
* Fixed bug causing a form of DD notation not to get recognized.
-===Maps 0.4.1===
+##Maps 0.4.1##
(2009-11-10)
-==== Bug fixes ====
-
-* Fixed problems with the ° sign, caused by wrong file encodings, resulting into problems with the DMS notation.
+#### Bug fixes ####
-* Fixed flaw in DMS to float translation, resulting into a map being displayed when the values where not separated by a comma.
+* Fixed problems with the ° sign, caused by wrong file encodings, resulting into problems with
+the DMS notation.
+* Fixed flaw in DMS to float translation, resulting into a map being displayed when the values
+where not separated by a comma.
-=== Maps 0.4 ===
+## Maps 0.4 ##
(2009-11-03)
Changes in 0.4 discussed on the authors blog:
-* [http://blog.bn2vs.com/2009/11/03/finally-maps-and-semantic-maps-0-4/ Finally! Maps and Semantic Maps 0.4!]
+* [Finally! Maps and Semantic Maps 0.4!](http://www.bn2vs.com/blog/2009/11/03/finally-maps-and-semantic-maps-0-4/)
-==== New features ====
+#### New features ####
* Added display_map parser function, to display maps without any markers.
-
* Added parsing of marker-specific title and label values.
-
-* Added geocoding support for the centre parameter. This is based on automatic detection of non-coordinates to see if geocoding is required, similar to the modified behavior of display_point(s).
-
+* Added geocoding support for the centre parameter. This is based on automatic detection of
+non-coordinates to see if geocoding is required, similar to the modified behavior of display_point(s).
* Added minimum and maximum map size restrictions, like done in SlippyMap.
-
* Added OSM mapping service, which uses OL, but only allows OSM layers and is optimized for OSM.
-
-* Added smart 'autopanzoom' control to OL and OSM services. It will determine for itself if a panzoom, panzoombar, or no control should be displayed, depending on the maps height.
-
+* Added smart 'autopanzoom' control to OL and OSM services. It will determine for itself if a
+panzoom, panzoombar, or no control should be displayed, depending on the maps height.
* Added support for DM and DD coordinate notations.
-==== Refactoring ====
-
-* Created a hook system for the parser functions, allowing the adding or removing of additional parser function support.
+#### Refactoring ####
+* Created a hook system for the parser functions, allowing the adding or removing of additional
+parser function support.
* Removed redundant absolute script path variable. This absolute value caused problems for some installations.
-
* Changed the geocoding functionality into a true feature hook element, enabling easy removal.
-
* Created service hook for the geocoding feature, loose from the mapping services hook.
+* Changed display_point(s) and display_address(es) to display_point(s), with auto detect
+functionality to see if the provided value are coordinates or addresses. display_address and
+display_addresses have been retained for backward compatibility, but will be removed from the docs.
+Backward compatibility will be removed at some point, so the use of these functions is discouraged.
-* Changed display_point(s) and display_address(es) to display_point(s), with auto detect functionality to see if the provided value are coordinates or addresses. display_address and display_addresses have been retained for backward compatibility, but will be removed from the docs. Backward compatibility will be removed at some point, so the use of these functions is discouraged.
-
-==== Bug fixes ====
+#### Bug fixes ####
* Fixed issue with the default parameter for the display_address(es) parser functions.
+* Fixed major bug in the initialization method causing hook code to get executed at a probably
+wrong moment. This bug can be the cause of some weird problems that surfaced since 0.3.3.
+* Fixed issue with size of pop-ups in Google Maps. They did not stretch far enough vertically
+for large contents.
-* Fixed major bug in the initialization method causing hook code to get executed at a probably wrong moment. This bug can be the cause of some weird problems that surfaced since 0.3.3.
-
-* Fixed issue with size of pop-ups in Google Maps. They did not stretch far enough vertically for large contents.
-
-===Maps 0.3.4===
+##Maps 0.3.4##
(2009-09-12)
Changes in 0.3.4 discussed on the authors blog:
-* [http://blog.bn2vs.com/2009/09/12/maps-and-semantic-maps-0-3-4-released/ Maps and Semantic Maps 0.3.4 released]
+* [Maps and Semantic Maps 0.3.4 released](http://www.bn2vs.com/blog/2009/09/12/maps-and-semantic-maps-0-3-4-released/)
-====New features====
+####New features####
-* Created hook system for features, which now also allows you to specify which features should be enabled and which not.
+* Created hook system for features, which now also allows you to specify which features
+should be enabled and which not.
-====Refactoring====
-
-* Added old style geocoding request again for people who do not have cURL enabled, plus a more consistent fall-back mechanism.
+####Refactoring####
+* Added old style geocoding request again for people who do not have cURL enabled, plus a
+more consistent fall-back mechanism.
* Added internationalization for the mapping service names.
-
* Added internationalized list notations.
-
* Restructured the parser function handling code to work with the new feature hook system.
-
* Improved structure of geocoding classes.
-
* Moved Semantic Maps JavaScript code from the Maps JS files to new SM JS files.
-
* Fixed tiny performance issues all over the code.
-====Bug fixes====
-
-* Fixed issue with empty parameters (par=value||par2=value2) that caused the default parameter (coordinate(s)/address(es)) to be overridden if it occurred after the default one was set.
+####Bug fixes####
-* Fixed wrong error message when you provide a coordinate(s)/address(es) parameter without any value (ie |coordinates=|)
+* Fixed issue with empty parameters (par=value||par2=value2) that caused the default parameter
+(coordinate(s)/address(es)) to be overridden if it occurred after the default one was set.
+* Fixed wrong error message when you provide a coordinate(s)/address(es) parameter without
+any value (ie |coordinates=|)
-===Maps 0.3.3===
+##Maps 0.3.3##
(2009-08-25)
Changes in 0.3.3 discussed on the authors blog:
-* [http://blog.bn2vs.com/2009/08/25/maps-and-semantic-maps-0-3-3/ Maps and Semantic Maps 0.3.3]
-
-====New features====
+* [Maps and Semantic Maps 0.3.3](http://www.bn2vs.com/blog/2009/08/25/maps-and-semantic-maps-0-3-3/)
-*Added [http://www.geonames.org GeoNames] geocoding support. This is an open source geocoding service, that does not require a licence. It has been made the default geocoding service.
+####New features####
-* Added wiki-text rendering to the values of the title and label parameters, allowing users to pass along links, images, and more.
+*Added [http://www.geonames.org GeoNames] geocoding support. This is an open source geocoding
+service, that does not require a licence. It has been made the default geocoding service.
+* Added wiki-text rendering to the values of the title and label parameters, allowing users
+to pass along links, images, and more.
-====Refactoring====
+####Refactoring####
* Refactored some common functionality of the geocoder classes up to MapsBaseGeocoder.
+* Minor issue - the OpenLayers default zoom should be closer, when displaying one
+point - see the last map in [http://discoursedb.org/wiki/One-point_map the same page].
-* Minor issue - the OpenLayers default zoom should be closer, when displaying one point - see the last map in [http://discoursedb.org/wiki/One-point_map the same page].
+####Bug fixes####
-====Bug fixes====
+* Fixed small bug in MapsMapper::inParamAliases that caused the determination of the
+geoservice to fail in some cases, and set it to the default.
-* Fixed small bug in MapsMapper::inParamAliases that caused the determination of the geoservice to fail in some cases, and set it to the default.
-
-===Maps 0.3.2===
+##Maps 0.3.2##
(2009-08-18)
Release for consistency. Only changes to Semantic Maps where made in 0.3.2.
-===Maps 0.3.1===
+##Maps 0.3.1##
(2009-08-18)
-====New features====
+####New features####
* Users can now define a default service for each feature - parser functions, query printers and form inputs.
-====Refactoring====
+####Refactoring####
* Added check to see if the classes array is present in a mapping service info array.
+* Added check to see if a mapping service has handling for parser functions. In 0.3,
+Maps assumed it had, preventing the adding of mapping services that only have a form input or/and query printer.
+* The getValidService function now holds into account that not every service has support for
+both parser functions, query printers and form inputs.
-* Added check to see if a mapping service has handling for parser functions. In 0.3, Maps assumed it had, preventing the adding of mapping services that only have a form input or/and query printer.
-
-* The getValidService function now holds into account that not every service has support for both parser functions, query printers and form inputs.
+####Bug fixes####
-====Bug fixes====
+* Added path to extension directory to non local class item in a service's info array,
+since adding the path is impossible in the declaration.
-* Added path to extension directory to non local class item in a service's info array, since adding the path is impossible in the declaration.
-
-===Maps 0.3===
+##Maps 0.3##
(2009-08-14)
Changes in 0.3 discussed on the authors blog:
-* [http://blog.bn2vs.com/2009/08/13/final-changes-for-maps-and-sm-0-3/ Final changes for Maps and SM 0.3]
-
-* [http://blog.bn2vs.com/2009/08/07/new-features-in-maps-and-sm-0-3/ New features in Maps and SM 0.3]
-
-* [http://blog.bn2vs.com/2009/08/05/structural-changes-for-maps-and-sm-0-3/ Structural changes for Maps and SM 0.3]
+* [Final changes for Maps and SM 0.3](http://www.bn2vs.com/blog/2009/08/13/final-changes-for-maps-and-sm-0-3/)
+* [New features in Maps and SM 0.3](http://www.bn2vs.com/blog/2009/08/07/new-features-in-maps-and-sm-0-3/)
+* [Structural changes for Maps and SM 0.3](http://www.bn2vs.com/blog/2009/08/05/structural-changes-for-maps-and-sm-0-3/)
-====New features====
-
-* Multi location parser functions. Two completely new parser functions have been added that allow the displaying of multiple points on a map.
-
-* Configurable map type controls. Users can now configure the map type controls of Google maps and Yahoo! maps maps. They can set the available map types, and the order they want them to be displayed in the map type control.
-
-* Property names now have aliases. This means you can add several alternative ways to name the same parameter, for instance, you can make so that ‘auto zoom’ and ‘auto-zoom’ will do excellently the same as the main parameter ‘autozoom’. This is particularly handy for parameters such as ‘centre’ (British spelling) and ‘center’ (American spelling).
-
+####New features####
+
+* Multi location parser functions. Two completely new parser functions have been added that
+allow the displaying of multiple points on a map.
+* Configurable map type controls. Users can now configure the map type controls of Google
+maps and Yahoo! maps maps. They can set the available map types, and the order they want
+them to be displayed in the map type control.
+* Property names now have aliases. This means you can add several alternative ways to name
+the same parameter, for instance, you can make so that ‘auto zoom’ and ‘auto-zoom’ will do
+excellently the same as the main parameter ‘autozoom’. This is particularly handy for
+parameters such as ‘centre’ (British spelling) and ‘center’ (American spelling).
* Added Google Maps moon, Mars and sky support.
-
-* Controls on both Yahoo! Maps and Google Maps map can now be configured by the user with the controls parameter. Yahoo! Maps maps already have this option for a limited set of controls since version 0.2, but the amount of available controls has now been expanded to what the Yahoo! Maps API offers. For Google Maps the change is significantly larger, since a lot of new controls can now be added. These included an overview map, a scale line, a drop down menu for map types, an automated reverse geocoding location determiner and more.
-
-* Added the ability to specify separate title, label and icon values for each marker in the display_points and display_addresses parser functions.
-
+* Controls on both Yahoo! Maps and Google Maps map can now be configured by the user with
+the controls parameter. Yahoo! Maps maps already have this option for a limited set of
+controls since version 0.2, but the amount of available controls has now been expanded
+to what the Yahoo! Maps API offers. For Google Maps the change is significantly larger,
+since a lot of new controls can now be added. These included an overview map, a scale
+line, a drop down menu for map types, an automated reverse geocoding location determiner
+and more.
+* Added the ability to specify separate title, label and icon values for each marker
+in the display_points and display_addresses parser functions.
* Added user friendly notices for when geocoding of an address fails.
-
-* A whole list of OpenLayers base layers have been added. These include the satellite, street and hybrid views for Yahoo! Maps and Bing Maps, but also finally the OpenStreetMap layers.
-
-====Refactoring====
-
-* Created hook system for the mapping services. All hard-coded references to mapping services in the core code have been removed. A service is now added by one multi dimensional array in Maps.php (note that this can also be done in the initialization file of another extension!), which holds the name of the parser functions class and it’s location, the aliases for the service name (feature added in 0.2), and their allowed specific parameters and their aliases. This architecture allows other people to create their own mapping extension using the Maps (and Semantic Maps) ‘API’.
-
+* A whole list of OpenLayers base layers have been added. These include the satellite,
+street and hybrid views for Yahoo! Maps and Bing Maps, but also finally the OpenStreetMap layers.
+
+####Refactoring####
+
+* Created hook system for the mapping services. All hard-coded references to mapping
+services in the core code have been removed. A service is now added by one multi dimensional
+array in Maps.php (note that this can also be done in the initialization file of another
+extension!), which holds the name of the parser functions class and it’s location, the
+aliases for the service name (feature added in 0.2), and their allowed specific parameters
+and their aliases. This architecture allows other people to create their own mapping
+extension using the Maps (and Semantic Maps) ‘API’.
* Created a class that bundles common functionality from MapsBaseMap and SMFormInput.
-
-* Rewrote parts of the geocoder base class.
-
+* Rewrote parts of the geocoder base class.
* Added separated handling for default parameter for each mapping service.
-
* Changed the requests in the geocoder classes to CURL requests to avoid security issues.
-
* Moved common, parser function specific, functions and variables from MapsMapper to a new MapsParserFunctions class.
-
* Moved common code within the mapping services out of the parser function class to a new utility classes.
-====Bug fixes====
+####Bug fixes####
* Fixed issue preventing the extension description from showing up in 0.2.1 & 0.2.2.
-
* Fixed bug that caused Bing maps (for open layers) to not work.
-===Maps 0.2===
-(2009-07-29)
+## Maps 0.2 (2009-07-29)
-====New features====
+#### New features
* Added Backward compatibility by using the $wgGoogleMapsKey when this one is set and $egGoogleMapsKey isn't.
-
* Added hook for [[Extension:Admin_Links|Admin Links]].
-
* Added a true aliasing system for service names.
-
-* Created a centre parameter, that will allow you to set a custom map centre (different from the place where the marker will be put).
-
+* Created a centre parameter, that will allow you to set a custom map centre (different from the
+place where the marker will be put).
* Added pop-ups for the markers with title and label parameters to determine the pop-up contents.
-
-* Changed the OpenLayers control handling. Make it accept all (36) OL controls by using eval() instead of a switch statement in the JavaScript.
-
+* Changed the OpenLayers control handling. Make it accept all (36) OL controls by using eval()
+instead of a switch statement in the JavaScript.
* Added the 'physical' button in the map type control of Google Maps maps when this map type is set.
-
* Added Yahoo! geocoder support (for parser functions).
-====Refactoring====
-
-* Refactored MapsBaseMap and all it's child classes. This will vastly increase code centralization and decrease redundant logic and definitions.
-
-* Did a major rewrite of the Google Maps and Yahoo! Maps code. The parser function classes now only print a call to a JS function with all needed parameters, which then does all the logic and creates the map.
+#### Refactoring
-====Bug fixes====
+* Refactored MapsBaseMap and all it's child classes. This will vastly increase code
+centralization and decrease redundant logic and definitions.
+* Did a major rewrite of the Google Maps and Yahoo! Maps code. The parser function
+classes now only print a call to a JS function with all needed parameters, which then
+does all the logic and creates the map.
-* Fixed issue causing aliases for service names getting turned into the default service since they are not in the allowed services list.
+#### Bug fixes
+* Fixed issue causing aliases for service names getting turned into the default
+service since they are not in the allowed services list.
* Removed redundant parts of the OpenLayers library.
-===Maps 0.1===
-(2009-07-20)
+## Maps 0.1 (2009-07-20)
* Initial release, featuring Google Maps (+ Google Earth), Yahoo! Maps and OpenLayers mapping services.
diff --git a/includes/Element.php b/includes/Element.php
index 670b59799..2725a6c47 100644
--- a/includes/Element.php
+++ b/includes/Element.php
@@ -9,7 +9,6 @@
*
* @since 3.0
*
- * @ingroup Maps
*
* @licence GNU GPL v2+
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
diff --git a/includes/Geocoder.php b/includes/Geocoder.php
index d34549932..c93aaf829 100644
--- a/includes/Geocoder.php
+++ b/includes/Geocoder.php
@@ -7,9 +7,6 @@
*
* @since 0.7
*
- * @file Maps_Geocoder.php
- * @ingroup Maps
- *
* @licence GNU GPL v2+
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
diff --git a/includes/Geocoders.php b/includes/Geocoders.php
index 8d063e618..4f6126245 100644
--- a/includes/Geocoders.php
+++ b/includes/Geocoders.php
@@ -4,6 +4,7 @@
use DataValues\LatLongValue;
use MWException;
+use ValueFormatters\GeoCoordinateFormatter;
use ValueParsers\ParseException;
/**
@@ -12,9 +13,6 @@
* FIXME: this is procedural spaghetti
*
* @since 0.4
- *
- * @file Maps_Geocoders.php
- * @ingroup Maps
*
* @licence GNU GPL v2+
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
@@ -167,7 +165,7 @@ public static function isLocation( $coordsOrAddress, $geoService = '', $mappingS
* @param string $service
* @param string $mappingService
* @param boolean $checkForCoords
- * @param coordinate type $targetFormat The notation to which they should be formatted. Defaults to floats.
+ * @param string $targetFormat The notation to which they should be formatted. Defaults to floats.
* @param boolean $directional Indicates if the target notation should be directional. Defaults to false.
*
* @return string|false
@@ -180,11 +178,11 @@ public static function attemptToGeocodeToString( $coordsOrAddress, $service = ''
}
$options = new \ValueFormatters\FormatterOptions( array(
- \ValueFormatters\GeoCoordinateFormatter::OPT_FORMAT => $targetFormat,
- // TODO \ValueFormatters\GeoCoordinateFormatter::OPT_DIRECTIONAL => $directional
+ GeoCoordinateFormatter::OPT_FORMAT => $targetFormat,
+ GeoCoordinateFormatter::OPT_DIRECTIONAL => $directional
) );
- $formatter = new \ValueFormatters\GeoCoordinateFormatter( $options );
+ $formatter = new GeoCoordinateFormatter( $options );
return $formatter->format( $geoCoordinate );
}
@@ -192,6 +190,8 @@ public static function attemptToGeocodeToString( $coordsOrAddress, $service = ''
* Geocodes an address with the provided geocoding service and returns the result
* as an array, or false when the geocoding failed.
*
+ * FIXME: complexity
+ *
* @since 0.7
*
* @param string $address
@@ -226,27 +226,41 @@ public static function geocode( $address, $geoService = '', $mappingService = fa
return $cacheResult;
}
}
-
+
+ $coordinates = self::getGeocoded( $geocoder, $address );
+
+ if ( $coordinates === false ) {
+ return false;
+ }
+
+ self::cacheWrite( $address, $coordinates );
+
+ return $coordinates;
+ }
+
+ private static function getGeocoded( Geocoder $geocoder, $address ) {
+ $coordinates = self::getGeocodedAsArray( $geocoder, $address );
+
+ if ( $coordinates !== false ) {
+ $coordinates = new LatLongValue(
+ $coordinates['lat'],
+ $coordinates['lon']
+ );
+ }
+
+ return $coordinates;
+ }
+
+ private static function getGeocodedAsArray( Geocoder $geocoder, $address ) {
// Do the actual geocoding via the geocoder.
$coordinates = $geocoder->geocode( $address );
-
+
// If there address could not be geocoded, and contains comma's, try again without the comma's.
// This is cause several geocoding services such as geonames do not handle comma's well.
if ( !$coordinates && strpos( $address, ',' ) !== false ) {
$coordinates = $geocoder->geocode( str_replace( ',', '', $address ) );
}
- if ( $coordinates === false ) {
- return false;
- }
-
- $coordinates = new LatLongValue(
- $coordinates['lat'],
- $coordinates['lon']
- );
-
- self::cacheWrite( $address, $coordinates );
-
return $coordinates;
}
diff --git a/includes/Maps_BaseFillableElement.php b/includes/Maps_BaseFillableElement.php
index df9da0af4..09bbffc5a 100644
--- a/includes/Maps_BaseFillableElement.php
+++ b/includes/Maps_BaseFillableElement.php
@@ -1,4 +1,5 @@
*/
-class MapsBaseStrokableElement extends \Maps\BaseElement implements iStrokableMapElement {
+class MapsBaseStrokableElement extends BaseElement implements iStrokableMapElement {
protected $strokeColor;
protected $strokeOpacity;
diff --git a/includes/Maps_DisplayMapRenderer.php b/includes/Maps_DisplayMapRenderer.php
index e24640390..262fba024 100644
--- a/includes/Maps_DisplayMapRenderer.php
+++ b/includes/Maps_DisplayMapRenderer.php
@@ -1,11 +1,11 @@
* @author Kim Eik
@@ -98,6 +98,8 @@ public final function renderMap( array $params, Parser $parser ) {
* Converts the data in the coordinates parameter to JSON-ready objects.
* These get stored in the locations parameter, and the coordinates on gets deleted.
*
+ * FIXME: complexity
+ *
* @since 1.0
*
* @param array &$params
@@ -110,13 +112,6 @@ protected function handleMarkerData( array &$params, Parser $parser ) {
$parserClone = clone $parser;
- /**
- * @var \Maps\Line $line
- */
- foreach ( $params['lines'] as &$line ) {
- $line = $line->getJSONObject();
- }
-
if ( is_object( $params['wmsoverlay'] ) ) {
$params['wmsoverlay'] = $params['wmsoverlay']->getJSONObject();
}
@@ -126,7 +121,7 @@ protected function handleMarkerData( array &$params, Parser $parser ) {
$params['locations'] = array();
/**
- * @var \Maps\Location $location
+ * @var Location $location
*/
foreach ( $params['coordinates'] as $location ) {
$jsonObj = $location->getJSONObject( $params['title'], $params['label'], $iconUrl, '', '',$visitedIconUrl);
@@ -144,6 +139,14 @@ protected function handleMarkerData( array &$params, Parser $parser ) {
unset( $params['coordinates'] );
+ $this->handleShapeData( $params, $parserClone );
+
+ if ( $params['mappingservice'] === 'openlayers' ) {
+ $params['layers'] = self::evilOpenLayersHack( $params['layers'] );
+ }
+ }
+
+ protected function handleShapeData( array &$params, Parser $parserClone ) {
$textContainers = array(
&$params['lines'] ,
&$params['polygons'] ,
@@ -155,6 +158,10 @@ protected function handleMarkerData( array &$params, Parser $parser ) {
foreach ( $textContainers as &$textContainer ) {
if ( is_array( $textContainer ) ) {
foreach ( $textContainer as &$obj ) {
+ if ( $obj instanceof Element ) {
+ $obj = $obj->getArrayValue();
+ }
+
$obj['title'] = $parserClone->parse( $obj['title'] , $parserClone->getTitle() , new ParserOptions() )->getText();
$obj['text'] = $parserClone->parse( $obj['text'] , $parserClone->getTitle() , new ParserOptions() )->getText();
@@ -164,10 +171,6 @@ protected function handleMarkerData( array &$params, Parser $parser ) {
}
}
}
-
- if ( $params['mappingservice'] === 'openlayers' ) {
- $params['layers'] = $this->evilOpenLayersHack( $params['layers'] );
- }
}
/**
@@ -183,7 +186,7 @@ protected function handleMarkerData( array &$params, Parser $parser ) {
*
* @return string[]
*/
- protected function evilOpenLayersHack( $layers ) {
+ public static function evilOpenLayersHack( $layers ) {
global $egMapsOLLayerGroups, $egMapsOLAvailableLayers;
$layerDefs = array();
@@ -278,7 +281,7 @@ protected function evilOpenLayersHack( $layers ) {
}
}
- MapsMappingServices::getServiceInstance( 'openlayers' )->addLayerDependencies( $this->getLayerDependencies( $layerNames ) );
+ MapsMappingServices::getServiceInstance( 'openlayers' )->addLayerDependencies( self::getLayerDependencies( $layerNames ) );
// print_r( $layerDefs );
// die();
@@ -289,7 +292,7 @@ protected function evilOpenLayersHack( $layers ) {
* FIXME
* @see evilOpenLayersHack
*/
- protected function getLayerDependencies( array $layerNames ) {
+ private static function getLayerDependencies( array $layerNames ) {
global $egMapsOLLayerDependencies, $egMapsOLAvailableLayers;
$layerDependencies = array();
diff --git a/includes/Maps_DistanceParser.php b/includes/Maps_DistanceParser.php
index 9e3e5207f..d3b906295 100644
--- a/includes/Maps_DistanceParser.php
+++ b/includes/Maps_DistanceParser.php
@@ -5,9 +5,6 @@
*
* TODO: migrate to DataValue, ValueParser and ValueFormatter
*
- * @file Maps_DistanceParser.php
- * @ingroup Maps
- *
* @since 0.6
*
* @licence GNU GPL v2+
diff --git a/includes/Maps_GeoFunctions.php b/includes/Maps_GeoFunctions.php
index 7d8aa89cf..e439b4e05 100644
--- a/includes/Maps_GeoFunctions.php
+++ b/includes/Maps_GeoFunctions.php
@@ -9,9 +9,6 @@
* Static class containing geographical functions.
*
* @since 0.6
- *
- * @file Maps_GeoFunctions.php
- * @ingroup Maps
*
* @licence GNU GPL v2+
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
diff --git a/includes/Maps_KMLFormatter.php b/includes/Maps_KMLFormatter.php
index 65c80de7f..025e77565 100644
--- a/includes/Maps_KMLFormatter.php
+++ b/includes/Maps_KMLFormatter.php
@@ -1,18 +1,15 @@
*/
-use Maps\Location;
-
class MapsKMLFormatter {
/**
diff --git a/includes/Maps_Layer.php b/includes/Maps_Layer.php
index 235c95610..86ad0d69d 100644
--- a/includes/Maps_Layer.php
+++ b/includes/Maps_Layer.php
@@ -4,9 +4,6 @@
* Class for describing map layers.
*
* @since 0.7.1
- *
- * @file Maps_Layer.php
- * @ingroup Maps
*
* @licence GNU GPL v2+
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
diff --git a/includes/Maps_LayerPage.php b/includes/Maps_LayerPage.php
index 34dfb3e74..68c7fe91e 100644
--- a/includes/Maps_LayerPage.php
+++ b/includes/Maps_LayerPage.php
@@ -6,9 +6,6 @@
*
* @since dw1 (class with same name in 0.7.1+ but different purpose, 100% rewritten in dw1)
*
- * @file Maps_LayerPage.php
- * @ingroup Maps
- *
* @licence GNU GPL v2+
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
* @author Daniel Werner
diff --git a/includes/Maps_Layers.php b/includes/Maps_Layers.php
index 7423f98d9..65998154f 100644
--- a/includes/Maps_Layers.php
+++ b/includes/Maps_Layers.php
@@ -5,9 +5,6 @@
* using abstract layer templates(in form of a layer class) which are managed via MapsLayerTypes.
*
* @since dw1 (Most of the pre dw1 'MapsLayer' class has moved to 'MapsLayerTypes')
- *
- * @file Maps_Layers.php
- * @ingroup Maps
*
* @licence GNU GPL v2+
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
diff --git a/includes/Maps_Mapper.php b/includes/Maps_Mapper.php
index 09443fbf0..91352ac77 100644
--- a/includes/Maps_Mapper.php
+++ b/includes/Maps_Mapper.php
@@ -5,7 +5,6 @@
*
* @since 0.1
*
- * @ingroup Maps
* @deprecated
*
* @licence GNU GPL v2+
@@ -160,8 +159,6 @@ public static function getBaseMapJSON( $serviceName ) {
if ( !$baseInit ) {
$baseInit = true;
- global $egMapsScriptPath;
- $json .= 'var egMapsScriptPath =' . FormatJson::encode( $egMapsScriptPath ) . ';';
$json .= 'var mwmaps={};';
}
diff --git a/includes/Maps_MappingService.php b/includes/Maps_MappingService.php
index 0dbaa6837..365d6925d 100644
--- a/includes/Maps_MappingService.php
+++ b/includes/Maps_MappingService.php
@@ -6,9 +6,6 @@
*
* @since 0.6.3
*
- * @file Maps_MappingService.php
- * @ingroup Maps
- *
* @licence GNU GPL v2+
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
diff --git a/includes/Maps_MappingServices.php b/includes/Maps_MappingServices.php
index 2ab7784f0..3d35d65ec 100644
--- a/includes/Maps_MappingServices.php
+++ b/includes/Maps_MappingServices.php
@@ -4,9 +4,6 @@
* Class for interaction with MappingService objects.
*
* @since 0.6.6
- *
- * @file
- * @ingroup Maps
*
* @licence GNU GPL v2+
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
diff --git a/includes/ServiceParam.php b/includes/ServiceParam.php
index 483ea5272..cd8b09f1c 100644
--- a/includes/ServiceParam.php
+++ b/includes/ServiceParam.php
@@ -10,11 +10,8 @@
/**
* Parameter definition for mapping service parameters.
*
- * @file
* @since 2.0
*
- * @ingroup Maps
- *
* @licence GNU GPL v2+
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
diff --git a/includes/api/ApiGeocode.php b/includes/api/ApiGeocode.php
index dbd33a687..66415017e 100644
--- a/includes/api/ApiGeocode.php
+++ b/includes/api/ApiGeocode.php
@@ -9,7 +9,6 @@
*
* @since 1.0.3
*
- * @ingroup Maps
* @ingroup API
*
* @licence GNU GPL v2++
diff --git a/includes/editor/MapEditorHTML.php b/includes/editor/MapEditorHTML.php
index 06f7f5d79..21aa70397 100644
--- a/includes/editor/MapEditorHTML.php
+++ b/includes/editor/MapEditorHTML.php
@@ -5,9 +5,6 @@
*
* @since 2.1
*
- * @file MapEditorHTML.php
- * @ingroup Maps
- *
* @licence GNU GPL v2+
* @author Nischayn22
*/
@@ -38,7 +35,9 @@ public function getEditorHTML() {
$output = <<getCanvasDiv()}
-
+
+
+
%3\$s
diff --git a/includes/editor/css/mapeditor.css b/includes/editor/css/mapeditor.css
index 33c30a4fa..9c3fe7c4d 100644
--- a/includes/editor/css/mapeditor.css
+++ b/includes/editor/css/mapeditor.css
@@ -1,8 +1,24 @@
-#code-output, #code-input-container,#code-input {
- height: 100%;
+#code-output-container, #code-input-container,#code-input {
+ height: 100% !important;
width: 100%;
}
+#code-output-container {
+ overflow: visible;
+}
+
+textarea#code-input, textarea#code-output {
+ resize: none;
+}
+
+#code-output {
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ border: none;
+ padding: 10px;
+}
+
#map-canvas {
width: 100%;
height: 500px;
diff --git a/includes/editor/js/mapeditor.js b/includes/editor/js/mapeditor.js
index c2c718c03..a0ca35291 100644
--- a/includes/editor/js/mapeditor.js
+++ b/includes/editor/js/mapeditor.js
@@ -1,721 +1,721 @@
var mapEditor = {
- __map:null,
- __drawingManager:null,
- __mapObjects:[],
- __controlsDiv:null,
- __options:{
- canvas:'map-canvas',
- onRightClick:function(){}
- },
- __mapObjectOptions: {
- marker:{
- draggable:true
- },
- polyline:{
- strokeWeight:2,
- strokeOpacity:1,
- strokeColor:'#FF0000',
- editable:true
- },
- circle:{
- strokeWeight:2,
- strokeOpacity:1,
- strokeColor:'#FF0000',
- fillColor:'#FF0000',
- fillOpacity:0.5,
- editable:true
- },
- rectangle:{
- strokeWeight:2,
- strokeOpacity:1,
- strokeColor:'#FF0000',
- fillColor:'#FF0000',
- fillOpacity:0.5,
- editable:true
- },
- polygon:{
- strokeWeight:2,
- strokeOpacity:1,
- strokeColor:'#FF0000',
- fillColor:'#FF0000',
- fillOpacity:0.5,
- editable:true
- },
- imageoverlay:{
- strokeWeight:1,
- strokeOpacity:0.5,
- strokeColor:'#000',
- fillOpacity:0.0,
- editable:true
- }
- },
- __mapParameters:{
- mappingservice: {
- values:mw.config.get( 'egMapsAvailableServices' )
- },
- copycoords: {
- values:['on','off']
- },
- markercluster: {
- values:['on','off']
- },
- searchmarkers:{
- values:['title','all']
- },
- 'static':{
- values:['on','off']
- },
- maxzoom: {
- values:[]
- },
- minzoom: {
- values:[]
- },
- zoom:{
- values:[]
- },
- centre:{
- values:[]
- },
- title:{
- values:[]
- },
- label:{
- values:[]
- },
- icon:{
- values:[]
- },
- type:{
- values:[]
- },
- types:{
- values:[]
- },
- layers:{
- values:[]
- },
- controls:{
- values:[]
- },
- zoomstyle:{
- values:['default','small','large']
- },
- typestyle:{
- values:[]
- },
- autoinfowindows:{
- values:['on','off']
- },
- kml:{
- values:[]
- },
- gkml:{
- values:[]
- },
- fusiontables:{
- values:[]
- },
- resizable:{
- values:[]
- },
- tilt:{
- values:[]
- },
- kmlrezoom:{
- values:['on','off']
- },
- poi:{
- values:['on','off']
- },
- visitedicon:{
- values:[]
- }
- },
- __addMapObject:function(o){
- var idx = this.__mapObjects.indexOf(o);
- if(idx === -1){
- this.__mapObjects.push(o);
- o.overlay.setMap(this.__map);
- }
- },
- __removeMapObject:function(o){
- var idx = this.__mapObjects.indexOf(o);
- if(idx !== -1){
- this.__mapObjects[idx].overlay.setMap(null);
- this.__mapObjects.splice(idx,1);
- }
- },
- __createOrUpdateImageOverlay:function(e,imageUrl){
- //remove old image overlay if exists
- this.__removeMapObject(e.imageoverlay);
-
- //set to new type so it doesn't collide with rectangle
- e.type = 'imageoverlaybounds';
-
- //add map objects
- this.__addMapObject(e);
- var image = new google.maps.GroundOverlay(imageUrl, e.overlay.getBounds());
- var imageOverlay = {
- overlay:image,
- type:'imageoverlay'
- };
- this.__addMapObject(imageOverlay);
- e.imageoverlay = imageOverlay;
- imageOverlay.metadata = e.metadata;
-
- //register right click listener if not already done
- if(e.rightClickListener !== true){
- google.maps.event.addListener(e.overlay, 'rightclick', function () {
- mapEditor.__options.onRightClick(e);
- });
- e.rightClickListener = true;
- }
-
- //register bounds change listener if not already done
- if(e.boundsChangedListener !== true){
- google.maps.event.addListener(e.overlay, 'bounds_changed', function () {
- //destroy and recreate imageoverlay (due to no e.imageoverlay.setBounds() method)
- mapEditor.__createOrUpdateImageOverlay(e, e.imageoverlay.overlay.getUrl());
- });
- e.boundsChangedListener = true;
- }
-
- return imageOverlay;
- },
- __initControls:function(){
- //Create root controls element
- var controlDiv = this.__controlsDiv = document.createElement('div');
- controlDiv.setAttribute('class','mapeditor-controls');
- controlDiv.index = 1;
-
- this.__map.controls[google.maps.ControlPosition.BOTTOM_CENTER].push(controlDiv);
- },
- __initMap:function(){
- var myOptions = {
- center:new google.maps.LatLng(0, 0),
- zoom:1,
- mapTypeId:google.maps.MapTypeId.ROADMAP
- };
-
- this.__map = new google.maps.Map(document.getElementById(this.__options.canvas),myOptions);
-
- //noinspection JSUnresolvedVariable
- var drawingManager = this.__drawingManager = new google.maps.drawing.DrawingManager({
- drawingMode:null,
- drawingControl:true,
- drawingControlOptions:{
- position:google.maps.ControlPosition.TOP_CENTER
- },
- markerOptions:this.__mapObjectOptions.marker,
- circleOptions:this.__mapObjectOptions.circle,
- rectangleOptions:this.__mapObjectOptions.rectangle,
- polygonOptions:this.__mapObjectOptions.polygon,
- polylineOptions:this.__mapObjectOptions.polyline
- });
- drawingManager.setMap(this.__map);
-
- google.maps.event.addListener(drawingManager, 'overlaycomplete', function (e) {
- mapEditor.__addMapObject(e);
- mapEditor.__registerRightClickListener(e);
- google.maps.event.trigger(e.overlay, 'rightclick');
- });
- },
- __readMapObjectOptionsFromMetadata:function(e){
- var options = $.extend({},this.__mapObjectOptions[e.type]);
- for(var key in e.metadata){
- var data = e.metadata[key];
- if(data.value.trim() !== ''){
- options[data.name] = data.value;
- }
- }
- try{
- e.overlay.setOptions(options);
- return true;
- }catch(e){
- return false;
- }
- },
- __writeMetaDataToMapObject:function(e,metadata){
- e.metadata = this.__arrayToObject(metadata);
- },
- __convertPositionalParametersToMetaData:function(positionalArray){
- var positionalNames = [
- 'title',
- 'text',
- 'strokeColor',
- 'strokeOpacity',
- 'strokeWeight',
- 'fillColor',
- 'fillOpacity',
- 'showOnHover'
- ];
-
- if(positionalArray !== undefined && positionalArray.length > 0){
- if(positionalArray[0].trim().indexOf('link:') === 0){
- positionalNames.splice(0,1);
- positionalNames[0] = 'link';
- }
- }
-
- for(var x = 0; x < positionalArray.length; x++){
- positionalArray[x] = {
- name:positionalNames[x],
- value:positionalArray[x].trim()
- };
- }
- return this.__arrayToObject(positionalArray);
- },
- __arrayToObject:function(arr){
- var o = {};
- for (var i = 0; i < arr.length; ++i){
- o[i] = arr[i];
- }
- return o;
- },
- __registerRightClickListener:function(e){
- google.maps.event.addListener(e.overlay, 'rightclick', function () {
- mapEditor.__options.onRightClick(e);
- });
- },
- __generateWikiCode:function( seperators ){
- var code = seperators.codeStart;
-
- var markers = '';
- var circles = '';
- var polygons = '';
- var lines = '';
- var rectangles = '';
- var imageoverlays = '';
-
- for(var x = 0; x < this.__mapObjects.length; x++){
- var mapObject = this.__mapObjects[x].overlay;
- var mapObjectType = this.__mapObjects[x].type;
- var mapObjectMeta = this.__mapObjects[x].metadata;
-
- var metadata = '';
- if(mapObjectMeta !== undefined){
- var delimiterPosition = '';
- for(var key in mapObjectMeta){
- var data = mapObjectMeta[key];
- delimiterPosition += delimiterPosition.length > 0 ? ' ~' : '~';
- if(data.value !== ''){
- if(data.name === 'link' && data.value.indexOf('link:') === -1){
- data.value = 'link:'+data.value;
- }
- if(!(mapObjectType === 'imageoverlay' && data.name === 'image')){
- metadata += delimiterPosition+data.value;
- delimiterPosition = '';
- }
- }
- }
- }
-
- var serializedData = mapObject+metadata;
- if (mapObjectType === 'marker') {
- markers += markers === '' ? serializedData : '; '+serializedData;
- } else if (mapObjectType === 'circle') {
- circles += circles === '' ? serializedData : '; '+serializedData;
- } else if (mapObjectType === 'polygon') {
- polygons += polygons === '' ? serializedData : '; '+serializedData;
- } else if (mapObjectType === 'polyline') {
- lines += lines === '' ? serializedData : '; '+serializedData;
- } else if (mapObjectType === 'rectangle') {
- rectangles += rectangles === '' ? serializedData : '; '+serializedData;
- }else if(mapObjectType === 'imageoverlay'){
- imageoverlays += imageoverlays === '' ? serializedData : '; '+serializedData;
- }
- }
-
-
- code += markers !== '' ? markers : '';
- code += circles !== '' ? seperators.separator+'circles='+circles : '';
- code += polygons !== '' ? seperators.separator+'polygons='+polygons : '';
- code += lines !== '' ? seperators.separator+'lines='+lines : '';
- code += rectangles !== '' ? seperators.separator+'rectangles='+rectangles : '';
- code += imageoverlays !== '' ? seperators.separator+'imageoverlays='+imageoverlays : '';
-
- //add map parameters
- for(var param in this.__mapParameters){
- var value = this.__mapParameters[param].value;
- if(value === undefined || value === ''){
- continue;
- }
- code += '\n|'+param+'='+value;
- }
-
- code += seperators.codeEnd;
- return code;
- },
- __importWikiCode:function(rawData){
- var syntaxPattern = /^\{\{#display_map:[\s\S]*\}\}[\s\n]*$/i;
- if(rawData.match(syntaxPattern) === null){ //NO MATCH
- return false;
- }else{
- try{
- var patterns = {
- marker: /^\{\{#display_map:\s*(.*)/i,
- polyline: /\|\s*lines=(.*)/i,
- circle:/\|\s*circles=(.*)/i,
- polygon:/\|\s*polygons=(.*)/i,
- rectangle:/\|\s*rectangles=(.*)/i,
- imageoverlay:/\|\s*imageoverlays=(.*)/i,
- parameter:/\|\s*(.*)=(.*)/i
- };
- var mapObjects = [];
- rawData = rawData.split('\n');
- for(var j = 0; j < rawData.length; j++){
- for (var key in patterns){
- var match = rawData[j].match(patterns[key]);
- if(match !== null && match[1].trim().length !== 0){
- var isMapObject = false;
- if(key !== 'parameter'){
- var data = match[1].split(';');
- for(var i = 0; i < data.length; i++){
-
- var metadata = data[i].split('~');
- metadata.splice(0,1);
- if(metadata.length > 0){
- data[i] = data[i].substring(0,data[i].indexOf('~'));
- }
- metadata = this.__convertPositionalParametersToMetaData(metadata);
-
- var options = this.__mapObjectOptions[key];
- var mapObject = null;
- if (key === 'marker') {
- var position = data[i].split(',');
- //noinspection JSValidateTypes
- options = $.extend({
- position: new google.maps.LatLng(position[0],position[1])
- },options);
- mapObject = new google.maps.Marker(options);
- } else if (key === 'circle') {
- var parts = data[i].split(':');
- var radius = parts[1];
- var position = parts[0].split(',');
- //noinspection JSValidateTypes
- options = $.extend({
- center: new google.maps.LatLng(position[0],position[1]),
- radius: parseFloat(radius)
- },options);
- mapObject = new google.maps.Circle(options);
- } else if (key === 'polygon') {
- var paths = data[i].split(':');
- for(var x = 0; x < paths.length; x++){
- var position = paths[x].split(',');
- paths[x] = new google.maps.LatLng(position[0],position[1]);
- }
- paths = new google.maps.MVCArray(paths);
- //noinspection JSValidateTypes
- options = $.extend({
- paths: paths
- },options);
- mapObject = new google.maps.Polygon(options);
- } else if (key === 'polyline') {
- var paths = data[i].split(':');
- for(var x = 0; x < paths.length; x++){
- var position = paths[x].split(',');
- paths[x] = new google.maps.LatLng(position[0],position[1]);
- }
- paths = new google.maps.MVCArray(paths);
- //noinspection JSValidateTypes
- options = $.extend({
- path: paths
- },options);
- mapObject = new google.maps.Polyline(options);
- } else if (key === 'rectangle') {
- var parts = data[i].split(':');
- var ne = parts[0].split(',');
- var sw = parts[1].split(',');
- sw = new google.maps.LatLng(sw[0],sw[1]);
- ne = new google.maps.LatLng(ne[0],ne[1]);
- //noinspection JSValidateTypes
- options = $.extend({
- bounds: new google.maps.LatLngBounds(sw,ne)
- },options);
- mapObject = new google.maps.Rectangle(options);
- }else if (key === 'imageoverlay'){
- var parts = data[i].split(':');
- var ne = parts[0].split(',');
- var sw = parts[1].split(',');
- var imageUrl = parts[2];
- sw = new google.maps.LatLng(sw[0],sw[1]);
- ne = new google.maps.LatLng(ne[0],ne[1]);
-
- options = $.extend({
- bounds: new google.maps.LatLngBounds(sw,ne)
- },options);
- var rectangle = new google.maps.Rectangle(options);
-
- //add image url as metadata entry
- metadata.image = {
- name:'image',value:imageUrl
- };
-
- mapObject = {
- type:'imageoverlaybounds',
- overlay:rectangle,
- metadata:metadata
- };
-
- this.__createOrUpdateImageOverlay(mapObject,imageUrl);
- this.__readMapObjectOptionsFromMetadata(mapObject);
-
- }
- if(mapObject !== null){
- //imageoverlay needs special handling
- if(key !== 'imageoverlay' ){
- mapObject = {
- type:key,
- overlay:mapObject,
- metadata:metadata
- };
-
- this.__registerRightClickListener(mapObject);
- this.__addMapObject(mapObject);
- this.__readMapObjectOptionsFromMetadata(mapObject);
- }
-
- isMapObject = true;
-
- }
- }
- }else if(!isMapObject){
- //handle global map parameters
- if(this.__mapParameters[match[1]] === undefined){
- this.__mapParameters[match[1]] = {};
- }
- this.__mapParameters[match[1]].value = match[2];
- }
- }
- }
- }
- }catch(e){
- console.log('An error occurred when parsing data');
- return false;
- }
- return true;
- }
- },
- addControlButton:function (text, onclick){
- // Set CSS for the control border
- var controlUI = $('');
- $(controlUI).click(function(){
- onclick.call(this);
- }).appendTo(this.__controlsDiv);
-
- // Set CSS for the control interior
- var controlText = $('')
- .text(text).appendTo(controlUI);
- },
- setup:function(o){
- //extend options
- $.extend(this.__options,o);
-
- //Override tostring methods for wiki code generation
- google.maps.LatLng.prototype.toString = function(){
- return this.lat()+','+this.lng();
- };
-
- google.maps.Rectangle.prototype.toString = function(){
- var bounds = this.getBounds();
- var ne = bounds.getNorthEast();
- var sw = bounds.getSouthWest();
- return ne+':'+sw;
- };
-
- google.maps.Marker.prototype.toString = function(){
- var position = this.getPosition();
- return position.lat()+','+position.lng();
- };
-
- google.maps.Circle.prototype.toString = function(){
- var center = this.getCenter();
- var radius = this.getRadius();
- return center.lat()+','+center.lng()+':'+radius;
- };
-
- google.maps.Polygon.prototype.toString = function(){
- var polygons = '';
- this.getPath().forEach(function(e){
- polygons += ':'+e;
- });
- return polygons.substr(1);
- };
-
- google.maps.Polyline.prototype.toString = function(){
- var lines = '';
- this.getPath().forEach(function(e){
- lines += ':'+e;
- });
- return lines.substr(1);
- };
-
- google.maps.GroundOverlay.prototype.toString = function(){
- var bounds = this.getBounds();
- var sw = bounds.getSouthWest();
- var ne = bounds.getNorthEast();
- return [ne,sw,this.getUrl()].join(':');
- };
-
- //initialize rest
- this.__initMap();
- this.__initControls();
- }
+ __map:null,
+ __drawingManager:null,
+ __mapObjects:[],
+ __controlsDiv:null,
+ __options:{
+ canvas:'map-canvas',
+ onRightClick:function(){}
+ },
+ __mapObjectOptions: {
+ marker:{
+ draggable:true
+ },
+ polyline:{
+ strokeWeight:2,
+ strokeOpacity:1,
+ strokeColor:'#FF0000',
+ editable:true
+ },
+ circle:{
+ strokeWeight:2,
+ strokeOpacity:1,
+ strokeColor:'#FF0000',
+ fillColor:'#FF0000',
+ fillOpacity:0.5,
+ editable:true
+ },
+ rectangle:{
+ strokeWeight:2,
+ strokeOpacity:1,
+ strokeColor:'#FF0000',
+ fillColor:'#FF0000',
+ fillOpacity:0.5,
+ editable:true
+ },
+ polygon:{
+ strokeWeight:2,
+ strokeOpacity:1,
+ strokeColor:'#FF0000',
+ fillColor:'#FF0000',
+ fillOpacity:0.5,
+ editable:true
+ },
+ imageoverlay:{
+ strokeWeight:1,
+ strokeOpacity:0.5,
+ strokeColor:'#000',
+ fillOpacity:0.0,
+ editable:true
+ }
+ },
+ __mapParameters:{
+ mappingservice: {
+ values:mw.config.get( 'egMapsAvailableServices' )
+ },
+ copycoords: {
+ values:['on','off']
+ },
+ markercluster: {
+ values:['on','off']
+ },
+ searchmarkers:{
+ values:['title','all']
+ },
+ 'static':{
+ values:['on','off']
+ },
+ maxzoom: {
+ values:[]
+ },
+ minzoom: {
+ values:[]
+ },
+ zoom:{
+ values:[]
+ },
+ centre:{
+ values:[]
+ },
+ title:{
+ values:[]
+ },
+ label:{
+ values:[]
+ },
+ icon:{
+ values:[]
+ },
+ type:{
+ values:[]
+ },
+ types:{
+ values:[]
+ },
+ layers:{
+ values:[]
+ },
+ controls:{
+ values:[]
+ },
+ zoomstyle:{
+ values:['default','small','large']
+ },
+ typestyle:{
+ values:[]
+ },
+ autoinfowindows:{
+ values:['on','off']
+ },
+ kml:{
+ values:[]
+ },
+ gkml:{
+ values:[]
+ },
+ fusiontables:{
+ values:[]
+ },
+ resizable:{
+ values:[]
+ },
+ tilt:{
+ values:[]
+ },
+ kmlrezoom:{
+ values:['on','off']
+ },
+ poi:{
+ values:['on','off']
+ },
+ visitedicon:{
+ values:[]
+ }
+ },
+ __addMapObject:function(o){
+ var idx = this.__mapObjects.indexOf(o);
+ if(idx === -1){
+ this.__mapObjects.push(o);
+ o.overlay.setMap(this.__map);
+ }
+ },
+ __removeMapObject:function(o){
+ var idx = this.__mapObjects.indexOf(o);
+ if(idx !== -1){
+ this.__mapObjects[idx].overlay.setMap(null);
+ this.__mapObjects.splice(idx,1);
+ }
+ },
+ __createOrUpdateImageOverlay:function(e,imageUrl){
+ //remove old image overlay if exists
+ this.__removeMapObject(e.imageoverlay);
+
+ //set to new type so it doesn't collide with rectangle
+ e.type = 'imageoverlaybounds';
+
+ //add map objects
+ this.__addMapObject(e);
+ var image = new google.maps.GroundOverlay(imageUrl, e.overlay.getBounds());
+ var imageOverlay = {
+ overlay:image,
+ type:'imageoverlay'
+ };
+ this.__addMapObject(imageOverlay);
+ e.imageoverlay = imageOverlay;
+ imageOverlay.metadata = e.metadata;
+
+ //register right click listener if not already done
+ if(e.rightClickListener !== true){
+ google.maps.event.addListener(e.overlay, 'rightclick', function () {
+ mapEditor.__options.onRightClick(e);
+ });
+ e.rightClickListener = true;
+ }
+
+ //register bounds change listener if not already done
+ if(e.boundsChangedListener !== true){
+ google.maps.event.addListener(e.overlay, 'bounds_changed', function () {
+ //destroy and recreate imageoverlay (due to no e.imageoverlay.setBounds() method)
+ mapEditor.__createOrUpdateImageOverlay(e, e.imageoverlay.overlay.getUrl());
+ });
+ e.boundsChangedListener = true;
+ }
+
+ return imageOverlay;
+ },
+ __initControls:function(){
+ //Create root controls element
+ var controlDiv = this.__controlsDiv = document.createElement('div');
+ controlDiv.setAttribute('class','mapeditor-controls');
+ controlDiv.index = 1;
+
+ this.__map.controls[google.maps.ControlPosition.BOTTOM_CENTER].push(controlDiv);
+ },
+ __initMap:function(){
+ var myOptions = {
+ center:new google.maps.LatLng(0, 0),
+ zoom:1,
+ mapTypeId:google.maps.MapTypeId.ROADMAP
+ };
+
+ this.__map = new google.maps.Map(document.getElementById(this.__options.canvas),myOptions);
+
+ //noinspection JSUnresolvedVariable
+ var drawingManager = this.__drawingManager = new google.maps.drawing.DrawingManager({
+ drawingMode:null,
+ drawingControl:true,
+ drawingControlOptions:{
+ position:google.maps.ControlPosition.TOP_CENTER
+ },
+ markerOptions:this.__mapObjectOptions.marker,
+ circleOptions:this.__mapObjectOptions.circle,
+ rectangleOptions:this.__mapObjectOptions.rectangle,
+ polygonOptions:this.__mapObjectOptions.polygon,
+ polylineOptions:this.__mapObjectOptions.polyline
+ });
+ drawingManager.setMap(this.__map);
+
+ google.maps.event.addListener(drawingManager, 'overlaycomplete', function (e) {
+ mapEditor.__addMapObject(e);
+ mapEditor.__registerRightClickListener(e);
+ google.maps.event.trigger(e.overlay, 'rightclick');
+ });
+ },
+ __readMapObjectOptionsFromMetadata:function(e){
+ var options = $.extend({},this.__mapObjectOptions[e.type]);
+ for(var key in e.metadata){
+ var data = e.metadata[key];
+ if(data.value.trim() !== ''){
+ options[data.name] = data.value;
+ }
+ }
+ try{
+ e.overlay.setOptions(options);
+ return true;
+ }catch(e){
+ return false;
+ }
+ },
+ __writeMetaDataToMapObject:function(e,metadata){
+ e.metadata = this.__arrayToObject(metadata);
+ },
+ __convertPositionalParametersToMetaData:function(positionalArray){
+ var positionalNames = [
+ 'title',
+ 'text',
+ 'strokeColor',
+ 'strokeOpacity',
+ 'strokeWeight',
+ 'fillColor',
+ 'fillOpacity',
+ 'showOnHover'
+ ];
+
+ if(positionalArray !== undefined && positionalArray.length > 0){
+ if(positionalArray[0].trim().indexOf('link:') === 0){
+ positionalNames.splice(0,1);
+ positionalNames[0] = 'link';
+ }
+ }
+
+ for(var x = 0; x < positionalArray.length; x++){
+ positionalArray[x] = {
+ name:positionalNames[x],
+ value:positionalArray[x].trim()
+ };
+ }
+ return this.__arrayToObject(positionalArray);
+ },
+ __arrayToObject:function(arr){
+ var o = {};
+ for (var i = 0; i < arr.length; ++i){
+ o[i] = arr[i];
+ }
+ return o;
+ },
+ __registerRightClickListener:function(e){
+ google.maps.event.addListener(e.overlay, 'rightclick', function () {
+ mapEditor.__options.onRightClick(e);
+ });
+ },
+ __generateWikiCode:function( seperators ){
+ var code = seperators.codeStart;
+
+ var markers = '';
+ var circles = '';
+ var polygons = '';
+ var lines = '';
+ var rectangles = '';
+ var imageoverlays = '';
+
+ for(var x = 0; x < this.__mapObjects.length; x++){
+ var mapObject = this.__mapObjects[x].overlay;
+ var mapObjectType = this.__mapObjects[x].type;
+ var mapObjectMeta = this.__mapObjects[x].metadata;
+
+ var metadata = '';
+ if(mapObjectMeta !== undefined){
+ var delimiterPosition = '';
+ for(var key in mapObjectMeta){
+ var data = mapObjectMeta[key];
+ delimiterPosition += delimiterPosition.length > 0 ? ' ~' : '~';
+ if(data.value !== ''){
+ if(data.name === 'link' && data.value.indexOf('link:') === -1){
+ data.value = 'link:'+data.value;
+ }
+ if(!(mapObjectType === 'imageoverlay' && data.name === 'image')){
+ metadata += delimiterPosition+data.value;
+ delimiterPosition = '';
+ }
+ }
+ }
+ }
+
+ var serializedData = mapObject+metadata;
+ if (mapObjectType === 'marker') {
+ markers += markers === '' ? serializedData : '; '+serializedData;
+ } else if (mapObjectType === 'circle') {
+ circles += circles === '' ? serializedData : '; '+serializedData;
+ } else if (mapObjectType === 'polygon') {
+ polygons += polygons === '' ? serializedData : '; '+serializedData;
+ } else if (mapObjectType === 'polyline') {
+ lines += lines === '' ? serializedData : '; '+serializedData;
+ } else if (mapObjectType === 'rectangle') {
+ rectangles += rectangles === '' ? serializedData : '; '+serializedData;
+ }else if(mapObjectType === 'imageoverlay'){
+ imageoverlays += imageoverlays === '' ? serializedData : '; '+serializedData;
+ }
+ }
+
+
+ code += markers !== '' ? markers : '';
+ code += circles !== '' ? seperators.separator+'circles='+circles : '';
+ code += polygons !== '' ? seperators.separator+'polygons='+polygons : '';
+ code += lines !== '' ? seperators.separator+'lines='+lines : '';
+ code += rectangles !== '' ? seperators.separator+'rectangles='+rectangles : '';
+ code += imageoverlays !== '' ? seperators.separator+'imageoverlays='+imageoverlays : '';
+
+ //add map parameters
+ for(var param in this.__mapParameters){
+ var value = this.__mapParameters[param].value;
+ if(value === undefined || value === ''){
+ continue;
+ }
+ code += '\n|'+param+'='+value;
+ }
+
+ code += seperators.codeEnd;
+ return code;
+ },
+ __importWikiCode:function(rawData){
+ var syntaxPattern = /^\{\{#display_map:[\s\S]*\}\}[\s\n]*$/i;
+ if(rawData.match(syntaxPattern) === null){ //NO MATCH
+ return false;
+ }else{
+ try{
+ var patterns = {
+ marker: /^\{\{#display_map:\s*(.*)/i,
+ polyline: /\|\s*lines=(.*)/i,
+ circle:/\|\s*circles=(.*)/i,
+ polygon:/\|\s*polygons=(.*)/i,
+ rectangle:/\|\s*rectangles=(.*)/i,
+ imageoverlay:/\|\s*imageoverlays=(.*)/i,
+ parameter:/\|\s*(.*)=(.*)/i
+ };
+ var mapObjects = [];
+ rawData = rawData.split('\n');
+ for(var j = 0; j < rawData.length; j++){
+ for (var key in patterns){
+ var match = rawData[j].match(patterns[key]);
+ if(match !== null && match[1].trim().length !== 0){
+ var isMapObject = false;
+ if(key !== 'parameter'){
+ var data = match[1].split(';');
+ for(var i = 0; i < data.length; i++){
+
+ var metadata = data[i].split('~');
+ metadata.splice(0,1);
+ if(metadata.length > 0){
+ data[i] = data[i].substring(0,data[i].indexOf('~'));
+ }
+ metadata = this.__convertPositionalParametersToMetaData(metadata);
+
+ var options = this.__mapObjectOptions[key];
+ var mapObject = null;
+ if (key === 'marker') {
+ var position = data[i].split(',');
+ //noinspection JSValidateTypes
+ options = $.extend({
+ position: new google.maps.LatLng(position[0],position[1])
+ },options);
+ mapObject = new google.maps.Marker(options);
+ } else if (key === 'circle') {
+ var parts = data[i].split(':');
+ var radius = parts[1];
+ var position = parts[0].split(',');
+ //noinspection JSValidateTypes
+ options = $.extend({
+ center: new google.maps.LatLng(position[0],position[1]),
+ radius: parseFloat(radius)
+ },options);
+ mapObject = new google.maps.Circle(options);
+ } else if (key === 'polygon') {
+ var paths = data[i].split(':');
+ for(var x = 0; x < paths.length; x++){
+ var position = paths[x].split(',');
+ paths[x] = new google.maps.LatLng(position[0],position[1]);
+ }
+ paths = new google.maps.MVCArray(paths);
+ //noinspection JSValidateTypes
+ options = $.extend({
+ paths: paths
+ },options);
+ mapObject = new google.maps.Polygon(options);
+ } else if (key === 'polyline') {
+ var paths = data[i].split(':');
+ for(var x = 0; x < paths.length; x++){
+ var position = paths[x].split(',');
+ paths[x] = new google.maps.LatLng(position[0],position[1]);
+ }
+ paths = new google.maps.MVCArray(paths);
+ //noinspection JSValidateTypes
+ options = $.extend({
+ path: paths
+ },options);
+ mapObject = new google.maps.Polyline(options);
+ } else if (key === 'rectangle') {
+ var parts = data[i].split(':');
+ var ne = parts[0].split(',');
+ var sw = parts[1].split(',');
+ sw = new google.maps.LatLng(sw[0],sw[1]);
+ ne = new google.maps.LatLng(ne[0],ne[1]);
+ //noinspection JSValidateTypes
+ options = $.extend({
+ bounds: new google.maps.LatLngBounds(sw,ne)
+ },options);
+ mapObject = new google.maps.Rectangle(options);
+ }else if (key === 'imageoverlay'){
+ var parts = data[i].split(':');
+ var ne = parts[0].split(',');
+ var sw = parts[1].split(',');
+ var imageUrl = parts[2];
+ sw = new google.maps.LatLng(sw[0],sw[1]);
+ ne = new google.maps.LatLng(ne[0],ne[1]);
+
+ options = $.extend({
+ bounds: new google.maps.LatLngBounds(sw,ne)
+ },options);
+ var rectangle = new google.maps.Rectangle(options);
+
+ //add image url as metadata entry
+ metadata.image = {
+ name:'image',value:imageUrl
+ };
+
+ mapObject = {
+ type:'imageoverlaybounds',
+ overlay:rectangle,
+ metadata:metadata
+ };
+
+ this.__createOrUpdateImageOverlay(mapObject,imageUrl);
+ this.__readMapObjectOptionsFromMetadata(mapObject);
+
+ }
+ if(mapObject !== null){
+ //imageoverlay needs special handling
+ if(key !== 'imageoverlay' ){
+ mapObject = {
+ type:key,
+ overlay:mapObject,
+ metadata:metadata
+ };
+
+ this.__registerRightClickListener(mapObject);
+ this.__addMapObject(mapObject);
+ this.__readMapObjectOptionsFromMetadata(mapObject);
+ }
+
+ isMapObject = true;
+
+ }
+ }
+ }else if(!isMapObject){
+ //handle global map parameters
+ if(this.__mapParameters[match[1]] === undefined){
+ this.__mapParameters[match[1]] = {};
+ }
+ this.__mapParameters[match[1]].value = match[2];
+ }
+ }
+ }
+ }
+ }catch(e){
+ console.log('An error occurred when parsing data');
+ return false;
+ }
+ return true;
+ }
+ },
+ addControlButton:function (text, onclick){
+ // Set CSS for the control border
+ var controlUI = $('');
+ $(controlUI).click(function(){
+ onclick.call(this);
+ }).appendTo(this.__controlsDiv);
+
+ // Set CSS for the control interior
+ var controlText = $('')
+ .text(text).appendTo(controlUI);
+ },
+ setup:function(o){
+ //extend options
+ $.extend(this.__options,o);
+
+ //Override tostring methods for wiki code generation
+ google.maps.LatLng.prototype.toString = function(){
+ return this.lat()+','+this.lng();
+ };
+
+ google.maps.Rectangle.prototype.toString = function(){
+ var bounds = this.getBounds();
+ var ne = bounds.getNorthEast();
+ var sw = bounds.getSouthWest();
+ return ne+':'+sw;
+ };
+
+ google.maps.Marker.prototype.toString = function(){
+ var position = this.getPosition();
+ return position.lat()+','+position.lng();
+ };
+
+ google.maps.Circle.prototype.toString = function(){
+ var center = this.getCenter();
+ var radius = this.getRadius();
+ return center.lat()+','+center.lng()+':'+radius;
+ };
+
+ google.maps.Polygon.prototype.toString = function(){
+ var polygons = '';
+ this.getPath().forEach(function(e){
+ polygons += ':'+e;
+ });
+ return polygons.substr(1);
+ };
+
+ google.maps.Polyline.prototype.toString = function(){
+ var lines = '';
+ this.getPath().forEach(function(e){
+ lines += ':'+e;
+ });
+ return lines.substr(1);
+ };
+
+ google.maps.GroundOverlay.prototype.toString = function(){
+ var bounds = this.getBounds();
+ var sw = bounds.getSouthWest();
+ var ne = bounds.getNorthEast();
+ return [ne,sw,this.getUrl()].join(':');
+ };
+
+ //initialize rest
+ this.__initMap();
+ this.__initControls();
+ }
};
$(document).ready(function(){
- function openDialog(e){
- if(e.metadata !== undefined){
- for(var key in e.metadata){
- var data = e.metadata[key];
- $(this).find('form input[name="'+data.name+'"]').val(data.value);
- }
- }
- var i18nButtons = {};
- i18nButtons[mw.msg('mapeditor-done-button')] = function () {
- var form = $(this).find('form');
- form.find('.miniColors').each(function(){
- if($(this).val() === '#'){
- $(this).val('');
- }
- });
- mapEditor.__writeMetaDataToMapObject(e,form.serializeArray());
- $(this).dialog("close");
- if(!mapEditor.__readMapObjectOptionsFromMetadata(e)){
- alert(mw.msg('mapeditor-parser-error'));
- }
- };
- i18nButtons[mw.msg('mapeditor-remove-button')] = function () {
- mapEditor.__removeMapObject(e);
- $(this).dialog("close");
- };
-
- this.dialog({
- modal:true,
- buttons:i18nButtons,
- open:function(){
- if(e.metadata !== undefined){
- var isText = true;
- for(var key in e.metadata){
- var data = e.metadata[key];
- if(data.name === 'link' && data.value.length > 0){
- isText = false;
- break;
- }
- }
- //depending on existing metadata,
- //show either form with title/text fields or just link field
- if(isText){
- $(this).find('input[value="text"]').trigger('click');
- }else{
- $(this).find('input[value="link"]').trigger('click');
- }
- }else{
- //default trigger click on text radio button
- $(this).find('input[value="text"]').trigger('click');
- }
-
-
- },
- beforeClose:function(){
- //reset the form
- var form = $(this).find('form');
- form[0].reset();
- form.find('.opacity-data-holder').text(mw.msg('mapeditor-none-text'));
- form.find('.ui-slider').slider('value',-1);
- form.find('.miniColors').miniColors('value','#fff').val('');
- }
- });
- }
-
- function openImageOverlayDialog(e,callback){
-
- var form = $('#imageoverlay-form');
-
- var i18nButtons = {};
- i18nButtons[mw.msg('mapeditor-done-button')] = function(){
- var imageUrl = $(this).find('input[name="image"]').val();
- mapEditor.__createOrUpdateImageOverlay(e,imageUrl);
-
- var metadata = form.find('form').serializeArray();
- mapEditor.__writeMetaDataToMapObject(e,metadata);
- mapEditor.__writeMetaDataToMapObject(e.imageoverlay,metadata);
-
- form.dialog("close");
- };
-
- i18nButtons[mw.msg('mapeditor-remove-button')] = function () {
- mapEditor.__removeMapObject(e.imageoverlay);
- e.imageoverlay = undefined;
- form.dialog("close");
- };
-
- form.dialog({
- modal:true,
- buttons:i18nButtons,
- open:function(){
- //restore data from previous edits
- if(e.metadata !== undefined){
- var isText = true;
- for(var key in e.metadata){
- var data = e.metadata[key];
- if(data.name === 'link' && data.value.length > 0){
- isText = false;
- }
- form.find('form input[name="'+data.name+'"]').val(data.value);
- }
- //depending on existing metadata,
- //show either form with title/text fields or just link field
- if(isText){
- form.find('input[value="text"]').trigger('click');
- }else{
- form.find('input[value="link"]').trigger('click');
- }
- }else{
- //default trigger click on text radio button
- form.find('input[value="text"]').trigger('click');
- }
- },
- beforeClose:function(){
- mapEditor.__drawingManager.setMap(mapEditor.__map); //re-enable standard drawing manager
- if(e.imageoverlay === undefined){
- mapEditor.__removeMapObject(e);
- }
-
- //reset the form
- var formElement = form.find('form');
- formElement[0].reset();
-
- if(callback !== undefined && typeof(callback) === 'function'){
- callback();
- }
-
- }
- });
- }
-
- mapEditor.setup({
- onRightClick:function(e){
- if (e.type === 'marker') {
- openDialog.call($('#marker-form'),e);
- } else if (e.type === 'circle') {
- openDialog.call($('#fillable-form'),e);
- } else if (e.type === 'polygon') {
- openDialog.call($('#polygon-form'),e);
- } else if (e.type === 'polyline') {
- openDialog.call($('#strokable-form'),e);
- } else if (e.type === 'rectangle') {
- openDialog.call($('#fillable-form'),e);
- } else if (e.type === 'imageoverlaybounds') {
- openImageOverlayDialog(e);
- }
- }
- });
-
- //add custom controls
+ function openDialog(e){
+ if(e.metadata !== undefined){
+ for(var key in e.metadata){
+ var data = e.metadata[key];
+ $(this).find('form input[name="'+data.name+'"]').val(data.value);
+ }
+ }
+ var i18nButtons = {};
+ i18nButtons[mw.msg('mapeditor-done-button')] = function () {
+ var form = $(this).find('form');
+ form.find('.miniColors').each(function(){
+ if($(this).val() === '#'){
+ $(this).val('');
+ }
+ });
+ mapEditor.__writeMetaDataToMapObject(e,form.serializeArray());
+ $(this).dialog("close");
+ if(!mapEditor.__readMapObjectOptionsFromMetadata(e)){
+ alert(mw.msg('mapeditor-parser-error'));
+ }
+ };
+ i18nButtons[mw.msg('mapeditor-remove-button')] = function () {
+ mapEditor.__removeMapObject(e);
+ $(this).dialog("close");
+ };
+
+ this.dialog({
+ modal:true,
+ buttons:i18nButtons,
+ open:function(){
+ if(e.metadata !== undefined){
+ var isText = true;
+ for(var key in e.metadata){
+ var data = e.metadata[key];
+ if(data.name === 'link' && data.value.length > 0){
+ isText = false;
+ break;
+ }
+ }
+ //depending on existing metadata,
+ //show either form with title/text fields or just link field
+ if(isText){
+ $(this).find('input[value="text"]').trigger('click');
+ }else{
+ $(this).find('input[value="link"]').trigger('click');
+ }
+ }else{
+ //default trigger click on text radio button
+ $(this).find('input[value="text"]').trigger('click');
+ }
+
+
+ },
+ beforeClose:function(){
+ //reset the form
+ var form = $(this).find('form');
+ form[0].reset();
+ form.find('.opacity-data-holder').text(mw.msg('mapeditor-none-text'));
+ form.find('.ui-slider').slider('value',-1);
+ form.find('.miniColors').miniColors('value','#fff').val('');
+ }
+ });
+ }
+
+ function openImageOverlayDialog(e,callback){
+
+ var form = $('#imageoverlay-form');
+
+ var i18nButtons = {};
+ i18nButtons[mw.msg('mapeditor-done-button')] = function(){
+ var imageUrl = $(this).find('input[name="image"]').val();
+ mapEditor.__createOrUpdateImageOverlay(e,imageUrl);
+
+ var metadata = form.find('form').serializeArray();
+ mapEditor.__writeMetaDataToMapObject(e,metadata);
+ mapEditor.__writeMetaDataToMapObject(e.imageoverlay,metadata);
+
+ form.dialog("close");
+ };
+
+ i18nButtons[mw.msg('mapeditor-remove-button')] = function () {
+ mapEditor.__removeMapObject(e.imageoverlay);
+ e.imageoverlay = undefined;
+ form.dialog("close");
+ };
+
+ form.dialog({
+ modal:true,
+ buttons:i18nButtons,
+ open:function(){
+ //restore data from previous edits
+ if(e.metadata !== undefined){
+ var isText = true;
+ for(var key in e.metadata){
+ var data = e.metadata[key];
+ if(data.name === 'link' && data.value.length > 0){
+ isText = false;
+ }
+ form.find('form input[name="'+data.name+'"]').val(data.value);
+ }
+ //depending on existing metadata,
+ //show either form with title/text fields or just link field
+ if(isText){
+ form.find('input[value="text"]').trigger('click');
+ }else{
+ form.find('input[value="link"]').trigger('click');
+ }
+ }else{
+ //default trigger click on text radio button
+ form.find('input[value="text"]').trigger('click');
+ }
+ },
+ beforeClose:function(){
+ mapEditor.__drawingManager.setMap(mapEditor.__map); //re-enable standard drawing manager
+ if(e.imageoverlay === undefined){
+ mapEditor.__removeMapObject(e);
+ }
+
+ //reset the form
+ var formElement = form.find('form');
+ formElement[0].reset();
+
+ if(callback !== undefined && typeof(callback) === 'function'){
+ callback();
+ }
+
+ }
+ });
+ }
+
+ mapEditor.setup({
+ onRightClick:function(e){
+ if (e.type === 'marker') {
+ openDialog.call($('#marker-form'),e);
+ } else if (e.type === 'circle') {
+ openDialog.call($('#fillable-form'),e);
+ } else if (e.type === 'polygon') {
+ openDialog.call($('#polygon-form'),e);
+ } else if (e.type === 'polyline') {
+ openDialog.call($('#strokable-form'),e);
+ } else if (e.type === 'rectangle') {
+ openDialog.call($('#fillable-form'),e);
+ } else if (e.type === 'imageoverlaybounds') {
+ openImageOverlayDialog(e);
+ }
+ }
+ });
+
+ //add custom controls
if( $('#map-canvas').attr('context') != 'forminput' ) { //for Special:MapEditor
var editorMarkers = {
'codeStart' : '{{#display_map: ',
@@ -729,9 +729,12 @@ $(document).ready(function(){
code = code.split('\n').join('\r\n');
}
$('#code-output').text(code);
- $('#code-output').dialog({
+ $('#code-output-container').dialog({
modal:true,
- width:'80%'
+ width:'80%',
+ open:function(){
+ $('#code-output').focus();
+ }
});
});
@@ -767,153 +770,153 @@ $(document).ready(function(){
});
}
- mapEditor.addControlButton(mw.msg('mapeditor-mapparam-button'), function(){
- var i18nButtons = {};
- i18nButtons[mw.msg('mapeditor-done-button')] = function(){
- var data = $(this).find('form input').not('select').serializeArray();
- for(var x = 0; x < data.length; x++){
- mapEditor.__mapParameters[data[x].name].value = data[x].value;
- }
- $(this).dialog('close');
- };
- $('#map-parameter-form').dialog({
- modal:true,
- width: 500,
- buttons:i18nButtons
- });
- });
-
- mapEditor.addControlButton(mw.msg('mapeditor-clear-button'), function(){
- while(mapEditor.__mapObjects.length > 0){
- var mapObj = mapEditor.__mapObjects.pop();
- mapObj.overlay.setMap(null);
- }
- for(var param in mapEditor.__mapParameters){
- mapEditor.__mapParameters[param].value = undefined;
- }
- });
-
- mapEditor.addControlButton(mw.msg('mapeditor-imageoverlay-button'), function(){
- var button = $(this);
- if(button.data('clicked') === true){
- return; //already clicked, disregard this click
- }else{
- button.data('clicked',true);
- }
-
- mapEditor.__drawingManager.setMap(null); //disable current drawing manager
-
- var drawingManager = new google.maps.drawing.DrawingManager({
- drawingMode:google.maps.drawing.OverlayType.RECTANGLE,
- drawingControl:false,
- rectangleOptions:mapEditor.__mapObjectOptions.imageoverlay
- });
- drawingManager.setMap(mapEditor.__map);
-
- google.maps.event.addListener(drawingManager, 'overlaycomplete', function (e) {
- mapEditor.__addMapObject(e); //add if it doesn't already exist.
-
- drawingManager.setMap(null);
-
- openImageOverlayDialog(e,function(){
- //re-enable button
- button.data('clicked',false);
- });
-
- });
-
- });
-
-
-
- //init map parameters
- var formselect = $('#map-parameter-form select[name="key"]');
- formselect.on('change',function(){
- var option = $(this);
- var key = option.val();
- var value = mapEditor.__mapParameters[key].value;
- if(value === undefined){
- value = '';
- }
-
- var parent = option.parent();
- var input = $('');
- var removeButton = $('[x]');
- var option2 = option.clone(true);
- var container = $('');
-
- option2.find('option[value="'+key+'"]').remove();
- option.attr('disabled',true);
- removeButton.on('click',function(){
- var removedKey = $(this).prevAll('select').val();
- var activeSelect = $(this).parent().parent().find('select').not('select[disabled="disabled"]');
- var option = $('');
- activeSelect.children().first().after(option);
- $(this).parent().remove();
- mapEditor.__mapParameters[key].value = undefined;
- return false;
- });
-
- parent.append(input);
- parent.append(removeButton);
- parent.parent().append(container);
- container.append(option2);
-
- input.autocomplete({
- source: mapEditor.__mapParameters[key].values,
- minLength: 0,
- autoFocus: true
- });
- input.autocomplete('search','');
- });
-
- for(var parameter in mapEditor.__mapParameters){
- var option = $('');
- formselect.append(option);
- }
-
- //hide link input initially
- $('input[name="link"]').attr('disabled',true).hide().prev().hide();
-
- //init text/link switcher
- $('input[name="switch"]').on('click',function(){
- if($(this).val() === 'link'){
- $(this).parent().next().find('input[name="title"],input[name="text"]').attr('disabled',true).hide().prev().hide();
- $(this).parent().next().find('input[name="link"]').attr('disabled',false).show().prev().show();
- }else{
- $(this).parent().next().find('input[name="title"],input[name="text"]').attr('disabled',false).show().prev().show();
- $(this).parent().next().find('input[name="link"]').attr('disabled',true).hide().prev().hide();
- }
- });
-
- //init enter keypress to press done on dialog.
- $('.mapeditor-dialog').on('keypress',function(e){
- if(e.keyCode === 13){
- $(this).dialog('option','buttons').Done.call(this);
- }
- });
-
- //init sliders
- $('input[name="strokeOpacity"],input[name="fillOpacity"]').each(function(){
- var input = $(this);
- var dataHolder = $(''+mw.msg('mapeditor-none-text')+'');
- dataHolder.css({fontSize: 12});
- var slider = $('').slider({
- min: -1,
- slide: function(event, ui){
- if(ui.value === -1){
- input.val('');
- dataHolder.text(mw.msg('mapeditor-none-text'));
- }else{
- input.val( ui.value/100 );
- dataHolder.text(ui.value+'%');
- }
- }
- });
- input.before(dataHolder);
- input.after(slider);
- });
-
- //init color pickers
- $('input[name="strokeColor"],input[name="fillColor"]').miniColors().miniColors('value','').val('');
+ mapEditor.addControlButton(mw.msg('mapeditor-mapparam-button'), function(){
+ var i18nButtons = {};
+ i18nButtons[mw.msg('mapeditor-done-button')] = function(){
+ var data = $(this).find('form input').not('select').serializeArray();
+ for(var x = 0; x < data.length; x++){
+ mapEditor.__mapParameters[data[x].name].value = data[x].value;
+ }
+ $(this).dialog('close');
+ };
+ $('#map-parameter-form').dialog({
+ modal:true,
+ width: 500,
+ buttons:i18nButtons
+ });
+ });
+
+ mapEditor.addControlButton(mw.msg('mapeditor-clear-button'), function(){
+ while(mapEditor.__mapObjects.length > 0){
+ var mapObj = mapEditor.__mapObjects.pop();
+ mapObj.overlay.setMap(null);
+ }
+ for(var param in mapEditor.__mapParameters){
+ mapEditor.__mapParameters[param].value = undefined;
+ }
+ });
+
+ mapEditor.addControlButton(mw.msg('mapeditor-imageoverlay-button'), function(){
+ var button = $(this);
+ if(button.data('clicked') === true){
+ return; //already clicked, disregard this click
+ }else{
+ button.data('clicked',true);
+ }
+
+ mapEditor.__drawingManager.setMap(null); //disable current drawing manager
+
+ var drawingManager = new google.maps.drawing.DrawingManager({
+ drawingMode:google.maps.drawing.OverlayType.RECTANGLE,
+ drawingControl:false,
+ rectangleOptions:mapEditor.__mapObjectOptions.imageoverlay
+ });
+ drawingManager.setMap(mapEditor.__map);
+
+ google.maps.event.addListener(drawingManager, 'overlaycomplete', function (e) {
+ mapEditor.__addMapObject(e); //add if it doesn't already exist.
+
+ drawingManager.setMap(null);
+
+ openImageOverlayDialog(e,function(){
+ //re-enable button
+ button.data('clicked',false);
+ });
+
+ });
+
+ });
+
+
+
+ //init map parameters
+ var formselect = $('#map-parameter-form select[name="key"]');
+ formselect.on('change',function(){
+ var option = $(this);
+ var key = option.val();
+ var value = mapEditor.__mapParameters[key].value;
+ if(value === undefined){
+ value = '';
+ }
+
+ var parent = option.parent();
+ var input = $('');
+ var removeButton = $('[x]');
+ var option2 = option.clone(true);
+ var container = $('');
+
+ option2.find('option[value="'+key+'"]').remove();
+ option.attr('disabled',true);
+ removeButton.on('click',function(){
+ var removedKey = $(this).prevAll('select').val();
+ var activeSelect = $(this).parent().parent().find('select').not('select[disabled="disabled"]');
+ var option = $('');
+ activeSelect.children().first().after(option);
+ $(this).parent().remove();
+ mapEditor.__mapParameters[key].value = undefined;
+ return false;
+ });
+
+ parent.append(input);
+ parent.append(removeButton);
+ parent.parent().append(container);
+ container.append(option2);
+
+ input.autocomplete({
+ source: mapEditor.__mapParameters[key].values,
+ minLength: 0,
+ autoFocus: true
+ });
+ input.autocomplete('search','');
+ });
+
+ for(var parameter in mapEditor.__mapParameters){
+ var option = $('');
+ formselect.append(option);
+ }
+
+ //hide link input initially
+ $('input[name="link"]').attr('disabled',true).hide().prev().hide();
+
+ //init text/link switcher
+ $('input[name="switch"]').on('click',function(){
+ if($(this).val() === 'link'){
+ $(this).parent().next().find('input[name="title"],input[name="text"]').attr('disabled',true).hide().prev().hide();
+ $(this).parent().next().find('input[name="link"]').attr('disabled',false).show().prev().show();
+ }else{
+ $(this).parent().next().find('input[name="title"],input[name="text"]').attr('disabled',false).show().prev().show();
+ $(this).parent().next().find('input[name="link"]').attr('disabled',true).hide().prev().hide();
+ }
+ });
+
+ //init enter keypress to press done on dialog.
+ $('.mapeditor-dialog').on('keypress',function(e){
+ if(e.keyCode === 13){
+ $(this).dialog('option','buttons').Done.call(this);
+ }
+ });
+
+ //init sliders
+ $('input[name="strokeOpacity"],input[name="fillOpacity"]').each(function(){
+ var input = $(this);
+ var dataHolder = $(''+mw.msg('mapeditor-none-text')+'');
+ dataHolder.css({fontSize: 12});
+ var slider = $('').slider({
+ min: -1,
+ slide: function(event, ui){
+ if(ui.value === -1){
+ input.val('');
+ dataHolder.text(mw.msg('mapeditor-none-text'));
+ }else{
+ input.val( ui.value/100 );
+ dataHolder.text(ui.value+'%');
+ }
+ }
+ });
+ input.before(dataHolder);
+ input.after(slider);
+ });
+
+ //init color pickers
+ $('input[name="strokeColor"],input[name="fillColor"]').miniColors().miniColors('value','').val('');
});
\ No newline at end of file
diff --git a/includes/elements/Polygon.php b/includes/elements/Polygon.php
deleted file mode 100644
index 64c99e480..000000000
--- a/includes/elements/Polygon.php
+++ /dev/null
@@ -1,51 +0,0 @@
-
- * @author Jeroen De Dauw < jeroendedauw@gmail.com >
- */
-class Polygon extends Line implements \iHoverableMapElement {
-
- /**
- * @since 3.0
- *
- * @var boolean
- */
- protected $onlyVisibleOnHover = false;
-
- /**
- * @since 3.0
- *
- * @param boolean $visible
- *
- * @throws MWException
- */
- public function setOnlyVisibleOnHover( $visible ) {
- if ( !is_bool( $visible ) ) {
- throw new MWException( '$visible should be a boolean' );
- }
-
- $this->onlyVisibleOnHover = $visible;
- }
-
- /**
- * @since 3.0
- *
- * @return boolean
- */
- public function isOnlyVisibleOnHover() {
- return $this->onlyVisibleOnHover;
- }
-
-}
diff --git a/includes/ext.maps.common.js b/includes/ext.maps.common.js
index 2dab2a49d..f61da8854 100644
--- a/includes/ext.maps.common.js
+++ b/includes/ext.maps.common.js
@@ -3,8 +3,7 @@
* @see http://www.mediawiki.org/wiki/Extension:Maps
*
* @since 1.0
- * @ingroup Maps
- *
+ *
* @licence GNU GPL v2++
* @author Jeroen De Dauw
*/
diff --git a/includes/ext.maps.coord.js b/includes/ext.maps.coord.js
index d568f67f9..729281ae5 100644
--- a/includes/ext.maps.coord.js
+++ b/includes/ext.maps.coord.js
@@ -3,8 +3,7 @@
* @see http://www.mediawiki.org/wiki/Extension:Maps
*
* @since 1.0
- * @ingroup Maps
- *
+ *
* @licence GNU GPL v2++
* @author Jeroen De Dauw
*/
diff --git a/includes/geocoders/Maps_GeocoderusGeocoder.php b/includes/geocoders/Maps_GeocoderusGeocoder.php
new file mode 100644
index 000000000..825e05e3a
--- /dev/null
+++ b/includes/geocoders/Maps_GeocoderusGeocoder.php
@@ -0,0 +1,57 @@
+=5.3 becomes acceptable.
+ *
+ * @since 3.0
+ */
+ public static function register() {
+ \Maps\Geocoders::registerGeocoder( 'geocoderus', __CLASS__ );
+ return true;
+ }
+
+ /**
+ * @see \Maps\Geocoder::getRequestUrl
+ *
+ * @since 3.0
+ *
+ * @param string $address
+ *
+ * @return string
+ */
+ protected function getRequestUrl( $address ) {
+ return 'http://geocoder.us/service/rest/?address=' . urlencode( $address );
+ }
+
+ /**
+ * @see \Maps\Geocoder::parseResponse
+ *
+ * @since 3.0
+ *
+ * @param string $address
+ *
+ * @return array
+ */
+ protected function parseResponse( $response ) {
+ $lon = self::getXmlElementValue( $response, 'geo:long' );
+ $lat = self::getXmlElementValue( $response, 'geo:lat' );
+
+ // In case one of the values is not found, return false.
+ if ( !$lon || !$lat ) return false;
+
+ return array(
+ 'lat' => (float)$lat,
+ 'lon' => (float)$lon
+ );
+ }
+}
diff --git a/includes/geocoders/Maps_GeonamesGeocoder.php b/includes/geocoders/Maps_GeonamesGeocoder.php
index 69450740b..5fd8b85a5 100644
--- a/includes/geocoders/Maps_GeonamesGeocoder.php
+++ b/includes/geocoders/Maps_GeonamesGeocoder.php
@@ -4,9 +4,6 @@
* Class for geocoding requests with the GeoNames webservice.
*
* @since 1.0
- * @file Maps_GeonamesGeocoder.php
- * @ingroup Maps
- * @ingroup Geocoders
*
* @licence GNU GPL v2+
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
diff --git a/includes/geocoders/Maps_GoogleGeocoder.php b/includes/geocoders/Maps_GoogleGeocoder.php
index 58dcbe0c0..d73347a19 100644
--- a/includes/geocoders/Maps_GoogleGeocoder.php
+++ b/includes/geocoders/Maps_GoogleGeocoder.php
@@ -5,10 +5,6 @@
*
* Webservice documentation: http://code.google.com/apis/maps/documentation/geocoding/
*
- * @file Maps_GoogleGeocoder.php
- * @ingroup Maps
- * @ingroup Geocoders
- *
* @licence GNU GPL v2+
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
* @author Sergey Chernyshev
diff --git a/includes/iMappingService.php b/includes/iMappingService.php
index ec8987200..d73fc7455 100644
--- a/includes/iMappingService.php
+++ b/includes/iMappingService.php
@@ -4,9 +4,6 @@
* Interface that should be implemented by all mapping feature classes.
*
* @since 0.6.3
- *
- * @file iMappingService.php
- * @ingroup Maps
*
* @licence GNU GPL v2+
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
@@ -20,7 +17,7 @@ interface iMappingService {
*
* @return string
*/
- function getName();
+ public function getName();
/**
* Adds the dependencies to the parser output as head items.
@@ -29,7 +26,7 @@ function getName();
*
* @param mixed $parserOrOut
*/
- function addDependencies( &$parserOrOut );
+ public function addDependencies( &$parserOrOut );
/**
* Adds service-specific parameter definitions to the provided parameter list.
@@ -40,7 +37,7 @@ function addDependencies( &$parserOrOut );
*
* @return array
*/
- function addParameterInfo( array &$parameterInfo );
+ public function addParameterInfo( array &$parameterInfo );
/**
* Adds a feature to this service. This is to indicate this service has support for this feature.
@@ -50,7 +47,7 @@ function addParameterInfo( array &$parameterInfo );
* @param string $featureName
* @param string $handlingClass
*/
- function addFeature( $featureName, $handlingClass );
+ public function addFeature( $featureName, $handlingClass );
/**
* Returns the name of the class that handles the provided feature in this service, or false if there is none.
@@ -61,7 +58,7 @@ function addFeature( $featureName, $handlingClass );
*
* @return mixed String or false
*/
- function getFeature( $featureName );
+ public function getFeature( $featureName );
/**
* Returns an instance of the class handling the provided feature with this service, or false if there is none.
@@ -72,7 +69,7 @@ function getFeature( $featureName );
*
* @return object or false
*/
- function getFeatureInstance( $featureName );
+ public function getFeatureInstance( $featureName );
/**
* Returns a list of aliases.
@@ -81,7 +78,7 @@ function getFeatureInstance( $featureName );
*
* @return array
*/
- function getAliases();
+ public function getAliases();
/**
* Returns if the service has a certain alias or not.
@@ -92,7 +89,7 @@ function getAliases();
*
* @return boolean
*/
- function hasAlias( $alias );
+ public function hasAlias( $alias );
/**
* Returns the default zoomlevel for the mapping service.
@@ -101,7 +98,7 @@ function hasAlias( $alias );
*
* @return integer
*/
- function getDefaultZoom();
+ public function getDefaultZoom();
/**
* Returns the zoomlevel that shows the whole earth for the mapping service.
@@ -123,6 +120,6 @@ public function getEarthZoom();
*
* @return string
*/
- function getMapId( $increment = true );
+ public function getMapId( $increment = true );
}
\ No newline at end of file
diff --git a/includes/parserhooks/Maps_Coordinates.php b/includes/parserhooks/Maps_Coordinates.php
index 3e1c38bc7..1b52733aa 100644
--- a/includes/parserhooks/Maps_Coordinates.php
+++ b/includes/parserhooks/Maps_Coordinates.php
@@ -1,4 +1,5 @@
*/
@@ -90,11 +88,11 @@ protected function getDefaultParameters( $type ) {
*/
public function render( array $parameters ) {
$options = new \ValueFormatters\FormatterOptions( array(
- \ValueFormatters\GeoCoordinateFormatter::OPT_FORMAT => $parameters['format'],
- // TODO \ValueFormatters\GeoCoordinateFormatter::OPT_DIRECTIONAL => $parameters['directional']
+ GeoCoordinateFormatter::OPT_FORMAT => $parameters['format'],
+ GeoCoordinateFormatter::OPT_DIRECTIONAL => $parameters['directional']
) );
- $coordinateFormatter = new \ValueFormatters\GeoCoordinateFormatter( $options );
+ $coordinateFormatter = new GeoCoordinateFormatter( $options );
$output = $coordinateFormatter->format( $parameters['location'] );
diff --git a/includes/parserhooks/Maps_DisplayMap.php b/includes/parserhooks/Maps_DisplayMap.php
index a6136d973..e99c4cc8b 100644
--- a/includes/parserhooks/Maps_DisplayMap.php
+++ b/includes/parserhooks/Maps_DisplayMap.php
@@ -5,9 +5,6 @@
*
* @since 0.7
*
- * @file Maps_DisplayMap.php
- * @ingroup Maps
- *
* @licence GNU GPL v2+
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
@@ -99,22 +96,22 @@ public static function getCommonMapParams() {
);
$params['polygons'] = array(
- // TODO 'type' => 'mapspolygon',
+ 'type' => 'mapspolygon',
'default' => array(),
'delimiter' => ';',
'islist' => true,
);
$params['circles'] = array(
+ 'type' => 'mapscircle',
'default' => array(),
- // TODO 'manipulations' => new MapsParamCircle( '~' ), // TODO
'delimiter' => ';',
'islist' => true,
);
$params['rectangles'] = array(
+ 'type' => 'mapsrectangle',
'default' => array(),
- // TODO 'manipulations' => new MapsParamRectangle( '~' ), // TODO
'delimiter' => ';',
'islist' => true,
);
@@ -198,11 +195,12 @@ public function render( array $parameters ) {
$parameters['zoom'] = false;
}
+ $this->parser->addTrackingCategory( 'maps-tracking-category' );
return $mapClass->renderMap( $parameters, $this->parser );
}
/**
- * Returns the parser function otpions.
+ * Returns the parser function options.
* @see ParserHook::getFunctionOptions
*
* @since 0.7
diff --git a/includes/parserhooks/Maps_Distance.php b/includes/parserhooks/Maps_Distance.php
index 7e79de744..45f2cccbb 100644
--- a/includes/parserhooks/Maps_Distance.php
+++ b/includes/parserhooks/Maps_Distance.php
@@ -6,9 +6,6 @@
*
* @since 0.7
*
- * @file Maps_Distance.php
- * @ingroup Maps
- *
* @licence GNU GPL v2+
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
diff --git a/includes/parserhooks/Maps_Finddestination.php b/includes/parserhooks/Maps_Finddestination.php
index a9ea5e56c..66c5797bc 100644
--- a/includes/parserhooks/Maps_Finddestination.php
+++ b/includes/parserhooks/Maps_Finddestination.php
@@ -1,4 +1,5 @@
*/
-use DataValues\LatLongValue;
class MapsFinddestination extends ParserHook {
@@ -127,11 +124,11 @@ public function render( array $parameters ) {
);
$options = new \ValueFormatters\FormatterOptions( array(
- \ValueFormatters\GeoCoordinateFormatter::OPT_FORMAT => $parameters['format'],
- // TODO \ValueFormatters\GeoCoordinateFormatter::OPT_DIRECTIONAL => $parameters['directional']
+ GeoCoordinateFormatter::OPT_FORMAT => $parameters['format'],
+ GeoCoordinateFormatter::OPT_DIRECTIONAL => $parameters['directional']
) );
- $formatter = new \ValueFormatters\GeoCoordinateFormatter( $options );
+ $formatter = new GeoCoordinateFormatter( $options );
$geoCoords = new \DataValues\LatLongValue( $destination['lat'], $destination['lon'] );
$output = $formatter->format( $geoCoords );
diff --git a/includes/parserhooks/Maps_Geocode.php b/includes/parserhooks/Maps_Geocode.php
index 9504d3e88..05704a8f4 100644
--- a/includes/parserhooks/Maps_Geocode.php
+++ b/includes/parserhooks/Maps_Geocode.php
@@ -1,4 +1,5 @@
*/
@@ -115,11 +113,11 @@ public function render( array $parameters ) {
$coordinates = $parameters['location']->getCoordinates();
$options = new \ValueFormatters\FormatterOptions( array(
- \ValueFormatters\GeoCoordinateFormatter::OPT_FORMAT => $parameters['format'],
- // TODO \ValueFormatters\GeoCoordinateFormatter::OPT_DIRECTIONAL => $parameters['directional']
+ GeoCoordinateFormatter::OPT_FORMAT => $parameters['format'],
+ GeoCoordinateFormatter::OPT_DIRECTIONAL => $parameters['directional']
) );
- $formatter = new \ValueFormatters\GeoCoordinateFormatter( $options );
+ $formatter = new GeoCoordinateFormatter( $options );
return $formatter->format( $coordinates );
}
diff --git a/includes/parserhooks/Maps_Geodistance.php b/includes/parserhooks/Maps_Geodistance.php
index aca666fb1..34ee88d11 100644
--- a/includes/parserhooks/Maps_Geodistance.php
+++ b/includes/parserhooks/Maps_Geodistance.php
@@ -6,13 +6,9 @@
*
* @since 0.7
*
- * @file Maps_Geodistance.php
- * @ingroup Maps
- *
* @licence GNU GPL v2+
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
-use ValueParsers\GeoCoordinateParser;
class MapsGeodistance extends ParserHook {
diff --git a/includes/parserhooks/Maps_MapsDoc.php b/includes/parserhooks/Maps_MapsDoc.php
index e10785c10..8d7ec5ac6 100644
--- a/includes/parserhooks/Maps_MapsDoc.php
+++ b/includes/parserhooks/Maps_MapsDoc.php
@@ -6,9 +6,6 @@
*
* @since 1.0
*
- * @file Maps_MapsDoc.php
- * @ingroup Maps
- *
* @licence GNU GPL v2+
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
diff --git a/includes/parsers/CircleParser.php b/includes/parsers/CircleParser.php
new file mode 100644
index 000000000..6af0ac4bc
--- /dev/null
+++ b/includes/parsers/CircleParser.php
@@ -0,0 +1,79 @@
+
+ */
+class CircleParser extends StringValueParser {
+
+ protected $supportGeocoding = true;
+
+ // TODO: use options
+ protected $metaDataSeparator = '~';
+
+ /**
+ * @see StringValueParser::stringParse
+ *
+ * @since 3.0
+ *
+ * @param string $value
+ *
+ * @return Circle
+ */
+ public function stringParse( $value ) {
+ $metaData = explode( $this->metaDataSeparator , $value );
+ $circleData = explode( ':' , array_shift( $metaData ) );
+
+ $circle = new Circle( $this->stringToLatLongValue( $circleData[0] ), (float)$circleData[1] );
+
+ if ( $metaData !== array() ) {
+ $circle->setTitle( array_shift( $metaData ) );
+ }
+
+ if ( $metaData !== array() ) {
+ $circle->setText( array_shift( $metaData ) );
+ }
+
+ if ( $metaData !== array() ) {
+ $circle->setStrokeColor( array_shift( $metaData ) );
+ }
+
+ if ( $metaData !== array() ) {
+ $circle->setStrokeOpacity( array_shift( $metaData ) );
+ }
+
+ if ( $metaData !== array() ) {
+ $circle->setStrokeWeight( array_shift( $metaData ) );
+ }
+
+ return $circle;
+ }
+
+ protected function stringToLatLongValue( $location ) {
+ if ( $this->supportGeocoding && Geocoders::canGeocode() ) {
+ $location = Geocoders::attemptToGeocode( $location );
+
+ if ( $location === false ) {
+ throw new ParseException( 'Failed to parse or geocode' );
+ }
+
+ assert( $location instanceof LatLongValue );
+ return $location;
+ }
+
+ $parser = new GeoCoordinateParser( new \ValueParsers\ParserOptions() );
+ return $parser->parse( $location );
+ }
+
+}
diff --git a/includes/parsers/DistanceParser.php b/includes/parsers/DistanceParser.php
index c131383b1..e2f5fc33a 100644
--- a/includes/parsers/DistanceParser.php
+++ b/includes/parsers/DistanceParser.php
@@ -10,10 +10,6 @@
*
* @since 3.0
*
- * @file
- * @ingroup Maps
- * @ingroup ValueParser
- *
* @licence GNU GPL v2+
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
diff --git a/includes/parsers/LineParser.php b/includes/parsers/LineParser.php
index 07f114df8..cdae58240 100644
--- a/includes/parsers/LineParser.php
+++ b/includes/parsers/LineParser.php
@@ -3,6 +3,7 @@
namespace Maps;
use DataValues\LatLongValue;
+use Maps\Elements\Line;
use ValueParsers\StringValueParser;
/**
@@ -10,21 +11,17 @@
*
* @since 3.0
*
- * @file
- * @ingroup Maps
- * @ingroup ValueParser
- *
* @licence GNU GPL v2+
* @author Kim Eik
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
class LineParser extends StringValueParser {
+ protected $supportGeocoding = true;
+
// TODO: use options
protected $metaDataSeparator = '~';
- protected $supportGeocoding = true;
-
/**
* @see StringValueParser::stringParse
*
@@ -37,7 +34,7 @@ class LineParser extends StringValueParser {
public function stringParse( $value ) {
$parts = explode( $this->metaDataSeparator , $value );
- $line = new Line( $this->parseCoordinates(
+ $line = $this->constructShapeFromLatLongValues( $this->parseCoordinates(
explode( ':' , array_shift( $parts ) )
) );
@@ -78,6 +75,10 @@ protected function parseCoordinates( array $coordinateStrings ) {
return $coordinates;
}
+ protected function constructShapeFromLatLongValues( array $locations ) {
+ return new Line( $locations );
+ }
+
/**
* This method requires that parameters are positionally correct,
* 1. Link (one parameter) or bubble data (two parameters)
diff --git a/includes/parsers/LocationParser.php b/includes/parsers/LocationParser.php
index 00a811748..d4aebd36d 100644
--- a/includes/parsers/LocationParser.php
+++ b/includes/parsers/LocationParser.php
@@ -3,7 +3,9 @@
namespace Maps;
use DataValues\LatLongValue;
+use Maps\Elements\Location;
use MWException;
+use Title;
use ValueParsers\GeoCoordinateParser;
use ValueParsers\ParseException;
use ValueParsers\StringValueParser;
@@ -13,9 +15,6 @@
*
* @since 3.0
*
- * @file
- * @ingroup ValueParsers
- *
* @licence GNU GPL v2+
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
@@ -39,12 +38,12 @@ public function stringParse( $value ) {
$metaData = explode( $separator, $value );
- $coordinates = $this->getCoordinates( array_shift( $metaData ) );
+ $coordinates = $this->stringToLatLongValue( array_shift( $metaData ) );
$location = new Location( $coordinates );
if ( $metaData !== array() ) {
- $location->setTitle( array_shift( $metaData ) );
+ $this->setTitleOrLink( $location, array_shift( $metaData ) );
}
if ( $metaData !== array() ) {
@@ -55,9 +54,49 @@ public function stringParse( $value ) {
$location->setIcon( array_shift( $metaData ) );
}
+ if ( $metaData !== array() ) {
+ $location->setGroup( array_shift( $metaData ) );
+ }
+
+ if ( $metaData !== array() ) {
+ $location->setInlineLabel( array_shift( $metaData ) );
+ }
+
return $location;
}
+ protected function setTitleOrLink( Location $location, $titleOrLink ) {
+ if ( $this->isLink( $titleOrLink ) ) {
+ $this->setLink( $location, $titleOrLink );
+ }
+ else {
+ $location->setTitle( $titleOrLink );
+ }
+ }
+
+ protected function isLink( $value ) {
+ return strpos( $value , 'link:' ) === 0;
+ }
+
+ protected function setLink( Location $location, $link ) {
+ $link = substr( $link, 5 );
+ $location->setLink( $this->getExpandedLink( $link ) );
+ }
+
+ protected function getExpandedLink( $link ) {
+ if ( filter_var( $link , FILTER_VALIDATE_URL , FILTER_FLAG_SCHEME_REQUIRED ) ) {
+ return $link;
+ }
+
+ $title = Title::newFromText( $link );
+
+ if ( $title === null ) {
+ return '';
+ }
+
+ return $title->getFullUrl();
+ }
+
/**
* @since 3.0
*
@@ -66,9 +105,9 @@ public function stringParse( $value ) {
* @return LatLongValue
* @throws ParseException
*/
- protected function getCoordinates( $location ) {
- if ( $this->supportGeocoding && \Maps\Geocoders::canGeocode() ) {
- $location = \Maps\Geocoders::attemptToGeocode( $location );
+ protected function stringToLatLongValue( $location ) {
+ if ( $this->supportGeocoding && Geocoders::canGeocode() ) {
+ $location = Geocoders::attemptToGeocode( $location );
if ( $location === false ) {
throw new ParseException( 'Failed to parse or geocode' );
diff --git a/includes/parsers/PolygonParser.php b/includes/parsers/PolygonParser.php
index 0a017df1c..62e2750eb 100644
--- a/includes/parsers/PolygonParser.php
+++ b/includes/parsers/PolygonParser.php
@@ -2,33 +2,40 @@
namespace Maps;
-use ValueParsers\StringValueParser;
+use Maps\Elements\Line;
+use Maps\Elements\Polygon;
/**
* ValueParser that parses the string representation of a polygon.
*
* @since 3.0
*
- * @file
- * @ingroup Maps
- * @ingroup ValueParser
- *
* @licence GNU GPL v2+
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
-class PolygonParser extends StringValueParser {
-
- /**
- * @see StringValueParser::stringParse
- *
- * @since 3.0
- *
- * @param string $value
- *
- * @return Polygon
- */
- public function stringParse( $value ) {
- // TODO
+class PolygonParser extends LineParser {
+
+ protected function constructShapeFromLatLongValues( array $locations ) {
+ return new Polygon( $locations );
+ }
+
+ protected function handleCommonParams( array &$params, Line &$line ) {
+ parent::handleCommonParams( $params, $line );
+ $this->handlePolygonParams( $params, $line );
+ }
+
+ protected function handlePolygonParams( array &$params, Polygon &$polygon ) {
+ if ( $fillColor = array_shift( $params ) ) {
+ $polygon->setFillColor( $fillColor );
+ }
+
+ if ( $fillOpacity = array_shift( $params ) ) {
+ $polygon->setFillOpacity( $fillOpacity );
+ }
+
+ if ( $showOnlyOnHover = array_shift( $params ) ) {
+ $polygon->setOnlyVisibleOnHover( strtolower( trim( $showOnlyOnHover ) ) === 'on' );
+ }
}
}
diff --git a/includes/parsers/RectangleParser.php b/includes/parsers/RectangleParser.php
new file mode 100644
index 000000000..e7672ecb5
--- /dev/null
+++ b/includes/parsers/RectangleParser.php
@@ -0,0 +1,82 @@
+
+ */
+class RectangleParser extends StringValueParser {
+
+ protected $supportGeocoding = true;
+
+ // TODO: use options
+ protected $metaDataSeparator = '~';
+
+ /**
+ * @see StringValueParser::stringParse
+ *
+ * @since 3.0
+ *
+ * @param string $value
+ *
+ * @return Rectangle
+ */
+ public function stringParse( $value ) {
+ $metaData = explode( $this->metaDataSeparator , $value );
+ $rectangleData = explode( ':' , array_shift( $metaData ) );
+
+ $rectangle = new Rectangle(
+ $this->stringToLatLongValue( $rectangleData[0] ),
+ $this->stringToLatLongValue( $rectangleData[1] )
+ );
+
+ if ( $metaData !== array() ) {
+ $rectangle->setTitle( array_shift( $metaData ) );
+ }
+
+ if ( $metaData !== array() ) {
+ $rectangle->setText( array_shift( $metaData ) );
+ }
+
+ if ( $metaData !== array() ) {
+ $rectangle->setStrokeColor( array_shift( $metaData ) );
+ }
+
+ if ( $metaData !== array() ) {
+ $rectangle->setStrokeOpacity( array_shift( $metaData ) );
+ }
+
+ if ( $metaData !== array() ) {
+ $rectangle->setStrokeWeight( array_shift( $metaData ) );
+ }
+
+ return $rectangle;
+ }
+
+ protected function stringToLatLongValue( $location ) {
+ if ( $this->supportGeocoding && Geocoders::canGeocode() ) {
+ $location = Geocoders::attemptToGeocode( $location );
+
+ if ( $location === false ) {
+ throw new ParseException( 'Failed to parse or geocode' );
+ }
+
+ assert( $location instanceof LatLongValue );
+ return $location;
+ }
+
+ $parser = new GeoCoordinateParser( new \ValueParsers\ParserOptions() );
+ return $parser->parse( $location );
+ }
+
+}
diff --git a/includes/parsers/WmsOverlayParser.php b/includes/parsers/WmsOverlayParser.php
index fb4b8df4b..0b918ab5e 100644
--- a/includes/parsers/WmsOverlayParser.php
+++ b/includes/parsers/WmsOverlayParser.php
@@ -2,8 +2,7 @@
namespace Maps;
-use MWException;
-use ValueParsers\GeoCoordinateParser;
+use Maps\Elements\WmsOverlay;
use ValueParsers\ParseException;
use ValueParsers\StringValueParser;
@@ -12,9 +11,6 @@
*
* @since 3.0
*
- * @file
- * @ingroup ValueParsers
- *
* @licence GNU GPL v2+
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
diff --git a/includes/properties/iBubbleMapElement.php b/includes/properties/iBubbleMapElement.php
index d78606912..74203daff 100644
--- a/includes/properties/iBubbleMapElement.php
+++ b/includes/properties/iBubbleMapElement.php
@@ -3,12 +3,12 @@
interface iBubbleMapElement {
/**
- * @param \text $text
+ * @param string $text
*/
public function setText( $text );
/**
- * @return \text
+ * @return string
*/
public function getText();
diff --git a/includes/services/GoogleMaps3/GoogleMaps3.php b/includes/services/GoogleMaps3/GoogleMaps3.php
index cf02f05ac..67b2a398e 100644
--- a/includes/services/GoogleMaps3/GoogleMaps3.php
+++ b/includes/services/GoogleMaps3/GoogleMaps3.php
@@ -4,15 +4,11 @@
* This groupe contains all Google Maps v3 related files of the Maps extension.
*
* @defgroup MapsGoogleMaps3 Google Maps v3
- * @ingroup Maps
*/
/**
* This file holds the hook and initialization for the Google Maps v3 service.
*
- * @file GoogleMaps3.php
- * @ingroup MapsGoogleMaps3
- *
* @licence GNU GPL v2+
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
@@ -22,12 +18,12 @@
}
call_user_func( function() {
- global $wgResourceModules, $egMapsScriptPath, $wgHooks;
+ global $wgResourceModules, $wgHooks;
$wgResourceModules['ext.maps.googlemaps3'] = array(
'dependencies' => array( 'ext.maps.common' ),
'localBasePath' => __DIR__,
- 'remoteBasePath' => $egMapsScriptPath . '/includes/services/GoogleMaps3',
+ 'remoteExtPath' => '..' . substr( __DIR__, strlen( $GLOBALS['IP'] ) ),
'group' => 'ext.maps',
'scripts' => array(
'jquery.googlemap.js',
@@ -37,12 +33,14 @@
'maps-googlemaps3-incompatbrowser',
'maps-copycoords-prompt',
'maps-searchmarkers-text',
+ 'maps-fullscreen-button',
+ 'maps-fullscreen-button-tooltip',
)
);
$wgResourceModules['ext.maps.gm3.markercluster'] = array(
'localBasePath' => __DIR__ . '/gm3-util-library',
- 'remoteBasePath' => $egMapsScriptPath . '/includes/services/GoogleMaps3/gm3-util-library',
+ 'remoteExtPath' => '..' . substr( __DIR__, strlen( $GLOBALS['IP'] ) ) . 'gm3-util-library',
'group' => 'ext.maps',
'scripts' => array(
'markerclusterer.js',
@@ -51,7 +49,7 @@
$wgResourceModules['ext.maps.gm3.markerwithlabel'] = array(
'localBasePath' => __DIR__ . '/gm3-util-library',
- 'remoteBasePath' => $egMapsScriptPath . '/includes/services/GoogleMaps3/gm3-util-library',
+ 'remoteExtPath' => '..' . substr( __DIR__, strlen( $GLOBALS['IP'] ) ) . 'gm3-util-library',
'group' => 'ext.maps',
'scripts' => array(
'markerwithlabel.js',
@@ -63,17 +61,18 @@
$wgResourceModules['ext.maps.gm3.geoxml'] = array(
'localBasePath' => __DIR__ . '/geoxml3',
- 'remoteBasePath' => $egMapsScriptPath . '/includes/services/GoogleMaps3/geoxml3',
+ 'remoteExtPath' => '..' . substr( __DIR__, strlen( $GLOBALS['IP'] ) ) . 'geoxml3',
'group' => 'ext.maps',
'scripts' => array(
'geoxml3.js',
'ZipFile.complete.js', //kmz handling
+ 'ProjectedOverlay.js', //Overlay handling
),
);
$wgResourceModules['ext.maps.gm3.earth'] = array(
'localBasePath' => __DIR__ . '/gm3-util-library',
- 'remoteBasePath' => $egMapsScriptPath . '/includes/services/GoogleMaps3/gm3-util-library',
+ 'remoteExtPath' => '..' . substr( __DIR__, strlen( $GLOBALS['IP'] ) ) . 'gm3-util-library',
'group' => 'ext.maps',
'scripts' => array(
'googleearth-compiled.js',
diff --git a/includes/services/GoogleMaps3/Maps_GoogleMaps3.php b/includes/services/GoogleMaps3/Maps_GoogleMaps3.php
index 34c050704..aed3927c7 100644
--- a/includes/services/GoogleMaps3/Maps_GoogleMaps3.php
+++ b/includes/services/GoogleMaps3/Maps_GoogleMaps3.php
@@ -6,9 +6,6 @@
*
* @since 0.7
*
- * @file Maps_GoogleMaps3.php
- * @ingroup MapsGoogleMaps3
- *
* @licence GNU GPL v2+
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
@@ -69,7 +66,7 @@ class MapsGoogleMaps3 extends MapsMappingService {
*
* @since 0.6.6
*/
- function __construct( $serviceName ) {
+ public function __construct( $serviceName ) {
parent::__construct(
$serviceName,
array( 'googlemaps', 'google' )
@@ -219,6 +216,12 @@ public function addParameterInfo( array &$params ) {
'message' => 'maps-googlemaps3-par-searchmarkers',
// new CriterionSearchMarkers() FIXME
);
+
+ $params['enablefullscreen'] = array(
+ 'type' => 'boolean',
+ 'default' => false,
+ 'message' => 'maps-googlemaps3-par-enable-fullscreen',
+ );
}
/**
diff --git a/includes/services/GoogleMaps3/geoxml3/ProjectedOverlay.js b/includes/services/GoogleMaps3/geoxml3/ProjectedOverlay.js
new file mode 100644
index 000000000..4056c2c37
--- /dev/null
+++ b/includes/services/GoogleMaps3/geoxml3/ProjectedOverlay.js
@@ -0,0 +1,139 @@
+// Create an overlay on the map from a projected image - Maps v3...
+// Author. John D. Coryat 05/2009
+// USNaviguide LLC - http://www.usnaviguide.com
+// Thanks go to Mile Williams EInsert: http://econym.googlepages.com/einsert.js, Google's GOverlay Example and Bratliff's suggestion...
+// Opacity code from TPhoto: http://gmaps.tommangan.us/addtphoto.html
+// This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+//
+// Parameters:
+// map: This Map
+// imageUrl: URL of the image (Mandatory)
+// bounds: Bounds object of image destination (Mandatory)
+// Options:
+// addZoom: Added Zoom factor as a parameter to the imageUrl (include complete parameter, including separater like '?zoom='
+// percentOpacity: Default 50, percent opacity to use when the image is loaded 0-100.
+// id: Default imageUrl, ID of the div
+//
+
+function ProjectedOverlay(map, imageUrl, bounds, opts)
+{
+ google.maps.OverlayView.call(this);
+
+ this.map_ = map;
+ this.url_ = imageUrl ;
+ this.bounds_ = bounds ;
+ this.addZ_ = opts.addZoom || '' ; // Add the zoom to the image as a parameter
+ this.id_ = opts.id || this.url_ ; // Added to allow for multiple images
+ this.percentOpacity_ = opts.percentOpacity || 50 ;
+
+ this.setMap(map);
+}
+
+ProjectedOverlay.prototype = new google.maps.OverlayView();
+
+ProjectedOverlay.prototype.createElement = function()
+{
+ var panes = this.getPanes() ;
+ var div = this.div_ ;
+
+ if (!div)
+ {
+ div = this.div_ = document.createElement("div");
+ div.style.position = "absolute" ;
+ div.setAttribute('id',this.id_) ;
+ this.div_ = div ;
+ this.lastZoom_ = -1 ;
+ if( this.percentOpacity_ )
+ {
+ this.setOpacity(this.percentOpacity_) ;
+ }
+ panes.overlayLayer.appendChild(div);
+ }
+}
+
+// Remove the main DIV from the map pane
+
+ProjectedOverlay.prototype.remove = function()
+{
+ if (this.div_)
+ {
+ this.div_.parentNode.removeChild(this.div_);
+ this.div_ = null;
+ this.setMap(null);
+ }
+}
+
+// Redraw based on the current projection and zoom level...
+
+ProjectedOverlay.prototype.draw = function(firstTime)
+{
+ // Creates the element if it doesn't exist already.
+
+ this.createElement();
+
+ if (!this.div_)
+ {
+ return ;
+ }
+
+ var c1 = this.get('projection').fromLatLngToDivPixel(this.bounds_.getSouthWest());
+ var c2 = this.get('projection').fromLatLngToDivPixel(this.bounds_.getNorthEast());
+
+ if (!c1 || !c2) return;
+
+ // Now position our DIV based on the DIV coordinates of our bounds
+
+ this.div_.style.width = Math.abs(c2.x - c1.x) + "px";
+ this.div_.style.height = Math.abs(c2.y - c1.y) + "px";
+ this.div_.style.left = Math.min(c2.x, c1.x) + "px";
+ this.div_.style.top = Math.min(c2.y, c1.y) + "px";
+
+ // Do the rest only if the zoom has changed...
+
+ if ( this.lastZoom_ == this.map_.getZoom() )
+ {
+ return ;
+ }
+
+ this.lastZoom_ = this.map_.getZoom() ;
+
+ var url = this.url_ ;
+
+ if ( this.addZ_ )
+ {
+ url += this.addZ_ + this.map_.getZoom() ;
+ }
+
+ this.div_.innerHTML = '' ;
+}
+
+ProjectedOverlay.prototype.setOpacity=function(opacity)
+{
+ if (opacity < 0)
+ {
+ opacity = 0 ;
+ }
+ if(opacity > 100)
+ {
+ opacity = 100 ;
+ }
+ var c = opacity/100 ;
+
+ if (typeof(this.div_.style.filter) =='string')
+ {
+ this.div_.style.filter = 'alpha(opacity:' + opacity + ')' ;
+ }
+ if (typeof(this.div_.style.KHTMLOpacity) == 'string' )
+ {
+ this.div_.style.KHTMLOpacity = c ;
+ }
+ if (typeof(this.div_.style.MozOpacity) == 'string')
+ {
+ this.div_.style.MozOpacity = c ;
+ }
+ if (typeof(this.div_.style.opacity) == 'string')
+ {
+ this.div_.style.opacity = c ;
+ }
+}
+
diff --git a/includes/services/GoogleMaps3/jquery.googlemap.js b/includes/services/GoogleMaps3/jquery.googlemap.js
index ca6cfa19e..909ad4c16 100644
--- a/includes/services/GoogleMaps3/jquery.googlemap.js
+++ b/includes/services/GoogleMaps3/jquery.googlemap.js
@@ -39,19 +39,41 @@
this.circles = [];
- /**
- * All rectangles on the map
- */
- this.rectangles = [];
+ /**
+ * All rectangles on the map
+ */
+ this.rectangles = [];
+
+
+ /**
+ * All image overlays on the map
+ */
+ this.imageoverlays = [];
- /**
- * All image overlays on the map
- */
- this.imageoverlays = [];
+ var getBounds = function() {
+ if (( options.centre === false || options.zoom === false ) && options.locations.length > 1) {
+ bounds = new google.maps.LatLngBounds();
+
+ for (var i = _this.markers.length - 1; i >= 0; i--) {
+ bounds.extend(_this.markers[i].getPosition());
+ }
+ return bounds;
+ }
+ return null;
+ };
+
+ var setZoom = function(bounds) {
+ if (options.zoom === false) {
+ _this.map.fitBounds(bounds);
+ }
+ else {
+ _this.map.setZoom(options.zoom);
+ }
+ };
- /**
+ /**
* Creates a new marker with the provided data,
* adds it to the map, and returns it.
* @param {Object} markerData Contains the fields lat, lon, title, text and icon
@@ -111,7 +133,8 @@
'ext.maps.gm3.markerwithlabel',
function() {
marker = new MarkerWithLabel( markerOptions );
- return addToMapAndHandlers( marker );
+ addToMapAndHandlers( marker );
+ setZoom(getBounds());
}
);
}
@@ -184,7 +207,61 @@
// If there are any non-Google KML/KMZ layers, load the geoxml library and use it to add these layers.
if (options.kml.length != 0) {
mw.loader.using('ext.maps.gm3.geoxml', function () {
- var geoXml = new geoXML3.parser({ map:_this.map, zoom:options.kmlrezoom });
+
+ function addToCopyCoords(doc){
+ if(options.copycoords){
+ for(var i = 0; i < doc.length; i++){
+ addCopyCoordsOnRightClick([
+ doc[i].gpolygons,
+ doc[i].gpolylines,
+ doc[i].ggroundoverlays
+ ]);
+ }
+ }
+ }
+
+
+ var geoXml = new geoXML3.parser({
+ map:_this.map,
+ zoom:options.kmlrezoom,
+ failedParse:function(){
+ alert(mediaWiki.msg('maps-kml-parsing-failed'));
+ }
+ });
+ geoXml.options.afterParse = function(docs){
+ //add toggle functionality
+ var toggleDiv = document.createElement('div');
+ toggleDiv.style.backgroundColor = 'white';
+ toggleDiv.style.marginTop = '5px';
+ toggleDiv.style.padding = '5px';
+ toggleDiv.style.border = '1px solid grey';
+ for(var i = docs.length-1; i >= 0; i--){
+ (function(doc){
+ var label = document.createElement('label');
+ label.style.display = 'block';
+ var text = document.createTextNode(doc.baseUrl.substring(doc.baseDir.length));
+ var checkbox = document.createElement('input');
+ checkbox.setAttribute('type','checkbox');
+ checkbox.style.verticalAlign = '-0.2em';
+ checkbox.checked = true;
+ checkbox.onclick = function(){
+ if(this.checked){
+ geoXml.showDocument(doc);
+ }else{
+ geoXml.hideDocument(doc);
+ }
+ };
+ label.appendChild(checkbox);
+ label.appendChild(text);
+
+ toggleDiv.appendChild(label);
+
+ console.log(toggleDiv);
+ })(docs[i]);
+ }
+ _this.map.controls[google.maps.ControlPosition.TOP_RIGHT].push(toggleDiv);
+ };
+
geoXml.parse(options.kml);
});
}
@@ -319,22 +396,22 @@
});
};
- this.addImageOverlay = function(properties){
- var imageBounds = new google.maps.LatLngBounds(
- new google.maps.LatLng(properties.sw.lat,properties.sw.lon),
- new google.maps.LatLng(properties.ne.lat,properties.ne.lon)
- );
+ this.addImageOverlay = function(properties){
+ var imageBounds = new google.maps.LatLngBounds(
+ new google.maps.LatLng(properties.sw.lat,properties.sw.lon),
+ new google.maps.LatLng(properties.ne.lat,properties.ne.lon)
+ );
- var image = new google.maps.GroundOverlay(properties.image,imageBounds);
- image.setMap(this.map);
+ var image = new google.maps.GroundOverlay(properties.image,imageBounds);
+ image.setMap(this.map);
- this.imageoverlays.push(image);
+ this.imageoverlays.push(image);
- //add click event
- google.maps.event.addListener(image, "click", function (event) {
- openBubbleOrLink.call(this, properties, event, image);
- });
- };
+ //add click event
+ google.maps.event.addListener(image, "click", function (event) {
+ openBubbleOrLink.call(this, properties, event, image);
+ });
+ };
this.removePolygon = function (polygon) {
@@ -357,7 +434,20 @@
this.polygon = [];
};
+ //Rezoom's the map to show all visible markers.
+ this.reZoom = function(){
+ var bounds = new google.maps.LatLngBounds();
+ for(var x = 0; x < this.markers.length; x++){
+ var marker = this.markers[x];
+ if (marker.getVisible() === true) {
+ bounds.extend(marker.getPosition());
+ }
+ }
+ this.map.fitBounds(bounds);
+ }
+
this.setup = function () {
+
var showEarth = $.inArray('earth', options.types) !== -1;
// If there are any non-Google KML/KMZ layers, load the geoxml library and use it to add these layers.
@@ -446,22 +536,9 @@
layer.setMap(map);
}
- var bounds;
-
- if (( options.centre === false || options.zoom === false ) && options.locations.length > 1) {
- bounds = new google.maps.LatLngBounds();
-
- for (var i = this.markers.length - 1; i >= 0; i--) {
- bounds.extend(this.markers[i].getPosition());
- }
- }
+ var bounds = getBounds();
- if (options.zoom === false) {
- map.fitBounds(bounds);
- }
- else {
- map.setZoom(options.zoom);
- }
+ setZoom(bounds);
var centre;
@@ -602,28 +679,6 @@
}
}
- /**
- * used in display_line functionality
- * allows the copy to clipboard of coordinates
- */
- if (options.copycoords) {
- function addRightClickListener(object) {
- google.maps.event.addListener(object, 'rightclick', function (event) {
- prompt(mediaWiki.msg('maps-copycoords-prompt'), event.latLng.lat() + ',' + event.latLng.lng());
- });
- }
-
- for (var x = 0; x < this.markers.length; x++) {
- addRightClickListener(this.markers[x]);
- }
-
- for (var x = 0; x < this.lines.length; x++) {
- addRightClickListener(this.lines[x]);
- }
-
- addRightClickListener(this.map);
- }
-
/**
* Allows grouping of markers.
*/
@@ -638,6 +693,8 @@
);
}
+
+
if (options.searchmarkers) {
var searchBoxValue = mediaWiki.msg('maps-searchmarkers-text');
var searchBox = $('');
@@ -647,34 +704,55 @@
searchBox.appendTo(searchContainer);
map.controls[google.maps.ControlPosition.TOP_RIGHT].push(searchContainer);
+ //prevents markers and other map objects to be placed beneath searchfield
+ google.maps.event.addListenerOnce(map, 'bounds_changed', function () {
+ map.panBy(0,-30);
+ });
+
+
searchBox.on('keyup',function (e) {
for (var i = 0; i < _this.markers.length; i++) {
- var haystack = '';
- var marker = _this.markers[i];
- if (options.searchmarkers == 'title') {
- haystack = marker.title;
- } else if (options.searchmarkers == 'all') {
- haystack = marker.title + marker.text;
- }
-
- marker.setVisible(haystack.toLowerCase().indexOf(e.target.value.toLowerCase()) != -1);
+ var haystack = '';
+ var marker = _this.markers[i];
+ if (options.searchmarkers == 'title') {
+ haystack = marker.title;
+ } else if (options.searchmarkers == 'all') {
+ haystack = marker.title + marker.text;
}
- }).on('focusin', function () {
+
+ var visible = haystack.toLowerCase().indexOf(e.target.value.toLowerCase()) != -1;
+ marker.setVisible(visible);
+ }
+ _this.reZoom();
+ }).on('focusin',function () {
if ($(this).val() === searchBoxValue) {
$(this).val('');
}
- }).on('focusout', function () {
+ }).on('focusout', function () {
if ($(this).val() === '') {
$(this).val(searchBoxValue);
}
- });
+ });
+ }
+
+ if(options.imageoverlays){
+ for (var i = 0; i < options.imageoverlays.length; i++) {
+ this.addImageOverlay(options.imageoverlays[i]);
+ }
}
- if(options.imageoverlays){
- for (var i = 0; i < options.imageoverlays.length; i++) {
- this.addImageOverlay(options.imageoverlays[i]);
- }
- }
+ if (options.copycoords) {
+
+ addCopyCoordsOnRightClick([
+ this.lines,
+ this.circles,
+ this.polygons,
+ this.markers,
+ this.rectangles,
+ this.imageoverlays,
+ this.map
+ ]);
+ }
if (options.wmsoverlay) {
var wmsOptions = {
@@ -720,8 +798,66 @@
map.mapTypes.set('OpenLayers', openlayersWMS);
map.setMapTypeId('OpenLayers');
}
+
+ //Add custom controls
+ // - Fullscreen
+ if(options.enablefullscreen){
+ this.map.controls[google.maps.ControlPosition.TOP_RIGHT].push(new FullscreenControl(this.map));
+ }
};
+ function FullscreenControl(map) {
+
+ var controlDiv = document.createElement('div');
+ controlDiv.style.padding = '5px';
+ controlDiv.index = 1;
+
+ var controlUI = document.createElement('div');
+ controlUI.style.backgroundColor = 'white';
+ controlUI.style.borderStyle = 'solid';
+ controlUI.style.borderWidth = '1px';
+ controlUI.style.cursor = 'pointer';
+ controlUI.style.textAlign = 'center';
+ controlUI.title = mediaWiki.msg('maps-fullscreen-button-tooltip');
+ controlDiv.appendChild(controlUI);
+
+ var controlText = document.createElement('div');
+ controlText.style.fontFamily = 'Arial,sans-serif';
+ controlText.style.fontSize = '12px';
+ controlText.style.paddingLeft = '4px';
+ controlText.style.paddingRight = '4px';
+ controlText.innerHTML = mediaWiki.msg('maps-fullscreen-button');
+ controlUI.appendChild(controlText);
+
+ google.maps.event.addDomListener(controlUI, 'click', function() {
+ var mapDiv = $(map.getDiv());
+ if(mapDiv.data('preFullscreenCss') != null){
+ mapDiv.css(mapDiv.data('preFullscreenCss'));
+ mapDiv.removeData('preFullscreenCss');
+ }else{
+ var fullscreenCss = {
+ position:'fixed',
+ top: 0,
+ left:0,
+ width:'100%',
+ height:'100%',
+ zIndex:10000
+ };
+ var oldState = {};
+ for(var cssProp in fullscreenCss){
+ oldState[cssProp] = mapDiv.css(cssProp);
+ }
+ mapDiv.data('preFullscreenCss',oldState);
+ mapDiv.css(fullscreenCss);
+ }
+
+
+ });
+
+ return controlDiv;
+ }
+
+
function openBubbleOrLink(properties, event, obj) {
if (properties.link) {
window.location.href = properties.link;
@@ -754,6 +890,18 @@
}
}
+ function addCopyCoordsOnRightClick(object) {
+ if(object instanceof Array){
+ for (var x = 0; x < object.length; x++) {
+ addCopyCoordsOnRightClick(object[x]);
+ }
+ }else{
+ google.maps.event.addListener(object, 'rightclick', function (event) {
+ prompt(mediaWiki.msg('maps-copycoords-prompt'), event.latLng.lat() + ',' + event.latLng.lng());
+ });
+ }
+ }
+
//Complete path to OpenLayers WMS layer
this.setup();
diff --git a/includes/services/Leaflet/Leaflet.php b/includes/services/Leaflet/Leaflet.php
index 24f803bf3..11f1126ab 100644
--- a/includes/services/Leaflet/Leaflet.php
+++ b/includes/services/Leaflet/Leaflet.php
@@ -4,15 +4,11 @@
* This groupe contains all Leaflet related files of the Maps extension.
*
* @defgroup Leaflet
- * @ingroup Maps
*/
/**
* This file holds the hook and initialization for the Leaflet service.
*
- * @file
- * @ingroup Leaflet
- *
* @licence GNU GPL v2+
* @author Pavel Astakhov < pastakhov@yandex.ru >
*/
@@ -23,7 +19,7 @@
}
call_user_func( function() {
- global $wgHooks, $wgResourceModules, $egMapsScriptPath;
+ global $wgHooks, $wgResourceModules;
// Specify the function that will initialize the parser function.
$wgHooks['MappingServiceLoad'][] = 'efMapsInitLeaflet';
@@ -31,17 +27,12 @@
$wgResourceModules['ext.maps.leaflet'] = array(
'dependencies' => array( 'ext.maps.common' ),
'localBasePath' => __DIR__,
- 'remoteBasePath' => $egMapsScriptPath . '/includes/services/Leaflet',
+ 'remoteExtPath' => '..' . substr( __DIR__, strlen( $GLOBALS['IP'] ) ),
'group' => 'ext.maps',
'scripts' => array(
- 'leaflet/leaflet.js',
'jquery.leaflet.js',
'ext.maps.leaflet.js',
),
- 'styles' => array(
- 'leaflet/leaflet.css',
- 'leaflet/leaflet.ie.css',
- ),
'messages' => array(
'maps-markers',
'maps-copycoords-prompt',
diff --git a/includes/services/Leaflet/Maps_Leaflet.php b/includes/services/Leaflet/Maps_Leaflet.php
index 2b37469e7..109a6c1b5 100644
--- a/includes/services/Leaflet/Maps_Leaflet.php
+++ b/includes/services/Leaflet/Maps_Leaflet.php
@@ -4,9 +4,6 @@
* Class holding information and functionality specific to Leaflet.
* This information and features can be used by any mapping feature.
*
- * @file Maps_Leaflet.php
- * @ingroup Leaflet
- *
* @licence GNU GPL v2+
* @author Pavel Astakhov < pastakhov@yandex.ru >
*/
@@ -15,7 +12,7 @@ class MapsLeaflet extends MapsMappingService {
/**
* Constructor
*/
- function __construct( $serviceName ) {
+ public function __construct( $serviceName ) {
parent::__construct(
$serviceName,
array( 'leafletmaps', 'leaflet' )
@@ -86,4 +83,14 @@ public function getResourceModules() {
array( 'ext.maps.leaflet' )
);
}
+
+ protected function getDependencies() {
+ $leafletPath = $GLOBALS['wgScriptPath'] . '/extensions/Maps/includes/services/Leaflet/leaflet';
+ return array(
+ Html::linkedStyle( "$leafletPath/leaflet.css" ),
+ '',
+ Html::linkedScript( "$leafletPath/leaflet.js" ),
+ );
+ }
+
}
diff --git a/includes/services/OpenLayers/Maps_OpenLayers.php b/includes/services/OpenLayers/Maps_OpenLayers.php
index e58f41de6..218651618 100644
--- a/includes/services/OpenLayers/Maps_OpenLayers.php
+++ b/includes/services/OpenLayers/Maps_OpenLayers.php
@@ -6,9 +6,6 @@
*
* @since 0.1
*
- * @file Maps_OpenLayers.php
- * @ingroup MapsOpenLayers
- *
* @licence GNU GPL v2+
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
@@ -19,7 +16,7 @@ class MapsOpenLayers extends MapsMappingService {
*
* @since 0.6.6
*/
- function __construct( $serviceName ) {
+ public function __construct( $serviceName ) {
parent::__construct(
$serviceName,
array( 'layers', 'openlayer' )
@@ -190,7 +187,10 @@ public function getResourceModules() {
* @return array
*/
public function getConfigVariables() {
- return array_merge( parent::getConfigVariables(), array( 'egMapsScriptPath' => $GLOBALS['egMapsScriptPath'] ) );
+ return array_merge(
+ parent::getConfigVariables(),
+ array( 'egMapsScriptPath' => $GLOBALS['wgScriptPath'] . '/extensions/Maps/' )
+ );
}
}
diff --git a/includes/services/OpenLayers/OpenLayers.php b/includes/services/OpenLayers/OpenLayers.php
index 5c6114b06..dcff5a5ab 100644
--- a/includes/services/OpenLayers/OpenLayers.php
+++ b/includes/services/OpenLayers/OpenLayers.php
@@ -4,15 +4,11 @@
* This group contains all OpenLayers related files of the Maps extension.
*
* @defgroup MapsOpenLayers OpenLayers
- * @ingroup Maps
*/
/**
* This file holds the hook and initialization for the OpenLayers service.
*
- * @file OpenLayers.php
- * @ingroup MapsOpenLayers
- *
* @licence GNU GPL v2+
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
@@ -22,12 +18,12 @@
}
call_user_func( function() {
- global $wgHooks, $wgResourceModules, $egMapsScriptPath, $wgAutoloadClasses;
+ global $wgHooks, $wgResourceModules, $wgAutoloadClasses;
$wgResourceModules['ext.maps.openlayers'] = array(
'dependencies' => array( 'ext.maps.common' ),
'localBasePath' => __DIR__,
- 'remoteBasePath' => $egMapsScriptPath . '/includes/services/OpenLayers',
+ 'remoteExtPath' => '..' . substr( __DIR__, strlen( $GLOBALS['IP'] ) ),
'group' => 'ext.maps',
'scripts' => array(
'OpenLayers/OpenLayers.js',
diff --git a/includes/specials/SpecialMapEditor.php b/includes/specials/SpecialMapEditor.php
index 1c0ba758f..1a5ccb94a 100644
--- a/includes/specials/SpecialMapEditor.php
+++ b/includes/specials/SpecialMapEditor.php
@@ -5,9 +5,6 @@
*
* @since 2.0
*
- * @file
- * @ingroup Maps
- *
* @licence GNU GPL v2+
* @author Kim Eik
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
index 5b7bf8de0..05c605dc5 100644
--- a/phpunit.xml.dist
+++ b/phpunit.xml.dist
@@ -20,6 +20,7 @@
includes
+ src
diff --git a/includes/elements/BaseElement.php b/src/Maps/Elements/BaseElement.php
similarity index 97%
rename from includes/elements/BaseElement.php
rename to src/Maps/Elements/BaseElement.php
index 4c50f6ca2..5e7935f8f 100644
--- a/includes/elements/BaseElement.php
+++ b/src/Maps/Elements/BaseElement.php
@@ -1,13 +1,15 @@
diff --git a/includes/elements/Circle.php b/src/Maps/Elements/Circle.php
similarity index 76%
rename from includes/elements/Circle.php
rename to src/Maps/Elements/Circle.php
index 16b422031..a4a31b9f7 100644
--- a/includes/elements/Circle.php
+++ b/src/Maps/Elements/Circle.php
@@ -1,16 +1,13 @@
@@ -31,8 +28,18 @@ class Circle extends \MapsBaseFillableElement {
/**
* @param LatLongValue $circleCentre
* @param integer|float $circleRadius
+ *
+ * @throws InvalidArgumentException
*/
- public function __construct( LatLongValue $circleCentre , $circleRadius ) {
+ public function __construct( LatLongValue $circleCentre, $circleRadius ) {
+ if ( !is_float( $circleRadius ) && !is_int( $circleRadius ) ) {
+ throw new InvalidArgumentException( '$circleRadius must be a float or int' );
+ }
+
+ if ( $circleRadius <= 0 ) {
+ throw new InvalidArgumentException( '$circleRadius must be greater than zero' );
+ }
+
parent::__construct();
$this->setCircleCentre( $circleCentre );
diff --git a/includes/elements/ImageOverlay.php b/src/Maps/Elements/ImageOverlay.php
similarity index 78%
rename from includes/elements/ImageOverlay.php
rename to src/Maps/Elements/ImageOverlay.php
index fc841b9cf..b3dce59da 100644
--- a/includes/elements/ImageOverlay.php
+++ b/src/Maps/Elements/ImageOverlay.php
@@ -1,15 +1,13 @@
@@ -32,8 +30,14 @@ class ImageOverlay extends Rectangle {
* @param LatLongValue $boundsNorthEast
* @param LatLongValue $boundsSouthWest
* @param string $image
+ *
+ * @throws InvalidArgumentException
*/
public function __construct( LatLongValue $boundsNorthEast, LatLongValue $boundsSouthWest, $image ) {
+ if ( !is_string( $image ) ) {
+ throw new InvalidArgumentException( '$image must be a string' );
+ }
+
parent::__construct( $boundsNorthEast, $boundsSouthWest );
$this->image = $image;
}
diff --git a/includes/elements/Line.php b/src/Maps/Elements/Line.php
similarity index 87%
rename from includes/elements/Line.php
rename to src/Maps/Elements/Line.php
index 66d73beb7..6bbb6d143 100644
--- a/includes/elements/Line.php
+++ b/src/Maps/Elements/Line.php
@@ -1,16 +1,15 @@
@@ -30,12 +29,12 @@ class Line extends \MapsBaseStrokableElement {
*
* @param LatLongValue[] $coordinates
*
- * @throws MWException
+ * @throws InvalidArgumentException
*/
public function __construct( array $coordinates = array() ) {
foreach ( $coordinates as $coordinate ) {
if ( !( $coordinate instanceof LatLongValue ) ) {
- throw new MWException( 'Can only construct Maps\Line with DataValues\LatLongValue objects' );
+ throw new InvalidArgumentException( 'Can only construct Line with LatLongValue objects' );
}
}
diff --git a/includes/elements/Location.php b/src/Maps/Elements/Location.php
similarity index 93%
rename from includes/elements/Location.php
rename to src/Maps/Elements/Location.php
index 6b83f9e7c..91d4ec24c 100644
--- a/includes/elements/Location.php
+++ b/src/Maps/Elements/Location.php
@@ -1,8 +1,9 @@
* @author Daniel Werner
*/
-class Location extends \Maps\BaseElement {
+class Location extends BaseElement {
/**
* @since 3.0
@@ -61,7 +60,7 @@ class Location extends \Maps\BaseElement {
protected $visitedIcon = '';
/**
- * Creates and returns a new instance of a \Maps\Location from a latitude and longitude.
+ * Creates and returns a new instance of a Location from a latitude and longitude.
*
* @since 1.0
*
@@ -75,7 +74,7 @@ public static function newFromLatLon( $lat, $lon ) {
}
/**
- * Creates and returns a new instance of a \Maps\Location from an address.
+ * Creates and returns a new instance of a Location from an address.
*
* @since 1.0
*
@@ -162,16 +161,10 @@ public function getCoordinates() {
*
* @since 0.7.1
*
- * @param boolean $geocodeIfEmpty
- *
* @return string
*/
- public function getAddress( $geocodeIfEmpty = true ) {
+ public function getAddress() {
if ( is_null( $this->address ) ) {
- if ( $geocodeIfEmpty ) {
- // TODO: attempt to reverse-geocode
- }
-
$this->address = '';
}
@@ -296,6 +289,8 @@ public function hasVisitedIcon(){
/**
* Returns an object that can directly be converted to JS using json_encode or similar.
*
+ * FIXME: complexity
+ *
* @since 1.0
*
* @param string $defText
@@ -309,6 +304,7 @@ public function hasVisitedIcon(){
*/
public function getJSONObject( $defText = '', $defTitle = '', $defIconUrl = '', $defGroup = '', $defInlineLabel = '', $defVisitedIcon = '' ) {
$parentArray = parent::getJSONObject( $defText , $defTitle );
+
$array = array(
'lat' => $this->coordinates->getLatitude(),
'lon' => $this->coordinates->getLongitude(),
@@ -319,6 +315,7 @@ public function getJSONObject( $defText = '', $defTitle = '', $defIconUrl = '',
'inlineLabel' => $this->hasInlineLabel() ? $this->getInlineLabel() : $defInlineLabel,
'visitedicon' => $this->hasVisitedIcon() ? $this->getVisitedIcon() : $defVisitedIcon,
);
+
return array_merge( $parentArray , $array );
}
diff --git a/src/Maps/Elements/Polygon.php b/src/Maps/Elements/Polygon.php
new file mode 100644
index 000000000..df2ee1d38
--- /dev/null
+++ b/src/Maps/Elements/Polygon.php
@@ -0,0 +1,70 @@
+
+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
+ */
+class Polygon extends Line implements \iHoverableMapElement {
+
+ protected $onlyVisibleOnHover = false;
+ protected $fillOpacity = '0.5';
+ protected $fillColor = '#FF0000';
+
+ /**
+ * @since 3.0
+ *
+ * @param boolean $visible
+ *
+ * @throws InvalidArgumentException
+ */
+ public function setOnlyVisibleOnHover( $visible ) {
+ if ( !is_bool( $visible ) ) {
+ throw new InvalidArgumentException( '$visible should be a boolean' );
+ }
+
+ $this->onlyVisibleOnHover = $visible;
+ }
+
+ /**
+ * @since 3.0
+ *
+ * @return boolean
+ */
+ public function isOnlyVisibleOnHover() {
+ return $this->onlyVisibleOnHover;
+ }
+
+ public function setFillOpacity( $fillOpacity ) {
+ if ( !is_string( $fillOpacity ) ) {
+ throw new InvalidArgumentException( '$fillOpacity should be a string' );
+ }
+
+ $this->fillOpacity = $fillOpacity;
+ }
+
+ public function setFillColor( $fillColor ) {
+ if ( !is_string( $fillColor ) ) {
+ throw new InvalidArgumentException( '$fillColor should be a string' );
+ }
+
+ $this->fillColor = $fillColor;
+ }
+
+ public function getJSONObject( $defText = '' , $defTitle = '' ) {
+ $json = parent::getJSONObject( $defText, $defTitle );
+
+ $json['onlyVisibleOnHover'] = $this->onlyVisibleOnHover;
+ $json['fillColor'] = $this->fillColor;
+ $json['fillOpacity'] = $this->fillOpacity;
+
+ return $json;
+ }
+
+}
diff --git a/includes/elements/Rectangle.php b/src/Maps/Elements/Rectangle.php
similarity index 88%
rename from includes/elements/Rectangle.php
rename to src/Maps/Elements/Rectangle.php
index d429c98c9..f695c83ac 100644
--- a/includes/elements/Rectangle.php
+++ b/src/Maps/Elements/Rectangle.php
@@ -1,16 +1,13 @@
@@ -35,8 +32,14 @@ class Rectangle extends \MapsBaseFillableElement {
*
* @param LatLongValue $rectangleNorthEast
* @param LatLongValue $rectangleSouthWest
+ *
+ * @throws InvalidArgumentException
*/
public function __construct( LatLongValue $rectangleNorthEast, LatLongValue $rectangleSouthWest ) {
+ if ( $rectangleNorthEast->equals( $rectangleSouthWest ) ) {
+ throw new InvalidArgumentException( '$rectangleNorthEast cannot be equal to $rectangleSouthWest' );
+ }
+
parent::__construct();
// TODO: validate bounds are correct, if not, flip
diff --git a/includes/elements/WmsOverlay.php b/src/Maps/Elements/WmsOverlay.php
similarity index 94%
rename from includes/elements/WmsOverlay.php
rename to src/Maps/Elements/WmsOverlay.php
index a5e7889b0..2ae523920 100644
--- a/includes/elements/WmsOverlay.php
+++ b/src/Maps/Elements/WmsOverlay.php
@@ -1,21 +1,16 @@
*/
-class WmsOverlay extends \Maps\BaseElement {
+class WmsOverlay extends BaseElement {
/**
* @since 3.0
diff --git a/tests/bootstrap.php b/tests/bootstrap.php
index 748f304a6..df469b773 100644
--- a/tests/bootstrap.php
+++ b/tests/bootstrap.php
@@ -5,15 +5,23 @@
*
* @since 3.0
*
- * @file
- * @ingroup Maps
- *
* @licence GNU GPL v2+
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
+if ( php_sapi_name() !== 'cli' ) {
+ die( 'Not an entry point' );
+}
+
+$pwd = exec( 'pwd' );
+chdir( __DIR__ . '/..' );
+passthru( 'composer update' );
+chdir( $pwd );
+
require_once( __DIR__ . '/evilMediaWikiBootstrap.php' );
-require_once( __DIR__ . '/../Maps.php' );
+require_once( __DIR__ . '/../vendor/autoload.php' );
-//require_once( __DIR__ . '/testLoader.php' );
+foreach ( $GLOBALS['wgExtensionFunctions'] as $extensionFunction ) {
+ call_user_func( $extensionFunction );
+}
\ No newline at end of file
diff --git a/tests/evilMediaWikiBootstrap.php b/tests/evilMediaWikiBootstrap.php
index add7f9a0a..776a6c144 100644
--- a/tests/evilMediaWikiBootstrap.php
+++ b/tests/evilMediaWikiBootstrap.php
@@ -70,7 +70,3 @@ function loadSettings() {
$wgCommandLineMode = true;
return $settingsFile;
}
-
-foreach ( $GLOBALS['wgExtensionFunctions'] as $extensionFunction ) {
- call_user_func( $extensionFunction );
-}
\ No newline at end of file
diff --git a/tests/phpunit/ElementTest.php b/tests/phpunit/ElementTest.php
index 401336f9c..3e894fb8e 100644
--- a/tests/phpunit/ElementTest.php
+++ b/tests/phpunit/ElementTest.php
@@ -1,34 +1,35 @@
*/
-use DataValues\LatLongValue;
-use Maps\Element;
-class ElementTest extends \MediaWikiTestCase {
+class ElementTest extends \PHPUnit_Framework_TestCase {
public function elementProvider() {
$elements = array();
- $elements[] = new \Maps\Rectangle( new LatLongValue( 4, 2 ), new LatLongValue( 5, 6 ) );
- $elements[] = new \Maps\ImageOverlay( new LatLongValue( 4, 2 ), new LatLongValue( 5, 6 ), 'foo' );
- $elements[] = new \Maps\Circle( new LatLongValue( 4, 2 ), 42 );
- $elements[] = new \Maps\Line( array( new LatLongValue( 4, 2 ), new LatLongValue( 5, 6 ) ) );
+ $elements[] = array( new Rectangle( new LatLongValue( 4, 2 ), new LatLongValue( 5, 6 ) ) );
+ $elements[] = array( new ImageOverlay( new LatLongValue( 4, 2 ), new LatLongValue( 5, 6 ), 'foo' ) );
+ $elements[] = array( new Circle( new LatLongValue( 4, 2 ), 42 ) );
+ $elements[] = array( new Line( array( new LatLongValue( 4, 2 ), new LatLongValue( 5, 6 ) ) ) );
+
//$elements[] = new \Maps\Polygon( array( new LatLongValue( 4, 2 ), new LatLongValue( 5, 6 ) ) );
// TODO: location
- return $this->arrayWrap( $elements );
+ return $elements;
}
/**
diff --git a/tests/phpunit/MapsDistanceParserTest.php b/tests/phpunit/MapsDistanceParserTest.php
index f2c801c58..b9c5a94d2 100644
--- a/tests/phpunit/MapsDistanceParserTest.php
+++ b/tests/phpunit/MapsDistanceParserTest.php
@@ -5,14 +5,10 @@
use MapsDistanceParser;
/**
- * Tests for the MapsCoordinates class.
+ * @covers MapsCoordinates
*
- * @file
* @since 0.6.5
*
- * @ingroup Maps
- * @ingroup Test
- *
* @group Maps
*
* @licence GNU GPL v2+
diff --git a/tests/phpunit/elements/BaseElementTest.php b/tests/phpunit/elements/BaseElementTest.php
index af2525ede..772b2d557 100644
--- a/tests/phpunit/elements/BaseElementTest.php
+++ b/tests/phpunit/elements/BaseElementTest.php
@@ -1,6 +1,6 @@
*/
-abstract class BaseElementTest extends \MediaWikiTestCase {
+abstract class BaseElementTest extends \PHPUnit_Framework_TestCase {
/**
* Returns the name of the concrete class tested by this test.
@@ -28,15 +23,11 @@ abstract class BaseElementTest extends \MediaWikiTestCase {
*/
public abstract function getClass();
- /**
- * First element can be a boolean indication if the successive values are valid,
- * or a string indicating the type of exception that should be thrown (ie not valid either).
- *
- * @since 3.0
- *
- * @return array
- */
- public abstract function constructorProvider();
+ public abstract function validConstructorProvider();
+
+ public function invalidConstructorProvider() {
+ return array();
+ }
/**
* Creates and returns a new instance of the concrete class.
@@ -60,48 +51,32 @@ public function newInstance() {
public function instanceProvider() {
$phpFails = array( $this, 'newInstance' );
- return array_filter( array_map(
+ return array_map(
function( array $args ) use ( $phpFails ) {
- $isValid = array_shift( $args ) === true;
-
- if ( $isValid ) {
- return array( call_user_func_array( $phpFails, $args ), $args );
- }
- else {
- return false;
- }
+ return array( call_user_func_array( $phpFails, $args ), $args );
},
- $this->constructorProvider()
- ), 'is_array' );
+ $this->validConstructorProvider()
+ );
}
/**
- * @dataProvider constructorProvider
+ * @dataProvider validConstructorProvider
*
* @since 3.0
*/
- public function testConstructor() {
- $args = func_get_args();
-
- $valid = array_shift( $args );
- $pokemons = null;
-
- try {
- $instance = call_user_func_array( array( $this, 'newInstance' ), $args );
- $this->assertInstanceOf( $this->getClass(), $instance );
- }
- catch ( \Exception $pokemons ) {
- if ( $valid === true ) {
- throw $pokemons;
- }
+ public function testGivenValidArguments_constructorDoesNotThrowException() {
+ $instance = call_user_func_array( array( $this, 'newInstance' ), func_get_args() );
+ $this->assertInstanceOf( $this->getClass(), $instance );
+ }
- if ( is_string( $valid ) ) {
- $this->assertEquals( $valid, get_class( $pokemons ) );
- }
- else {
- $this->assertFalse( $valid );
- }
- }
+ /**
+ * @dataProvider invalidConstructorProvider
+ *
+ * @since 3.0
+ */
+ public function testGivenInvalidArguments_constructorThrowsException() {
+ $this->setExpectedException( 'InvalidArgumentException' );
+ call_user_func_array( array( $this, 'newInstance' ), func_get_args() );
}
/**
@@ -112,4 +87,4 @@ public function testGetOptions( Element $element ) {
$this->assertInstanceOf( '\Maps\ElementOptions', $element->getOptions() );
}
-}
\ No newline at end of file
+}
diff --git a/tests/phpunit/elements/CircleTest.php b/tests/phpunit/elements/CircleTest.php
index 4b99e6763..32a2c6d0b 100644
--- a/tests/phpunit/elements/CircleTest.php
+++ b/tests/phpunit/elements/CircleTest.php
@@ -1,19 +1,15 @@
*/
@@ -27,41 +23,49 @@ class CircleTest extends BaseElementTest {
* @return string
*/
public function getClass() {
- return 'Maps\Circle';
+ return 'Maps\Elements\Circle';
}
- /**
- * @see BaseElementTest::constructorProvider
- *
- * @since 3.0
- *
- * @return array
- */
- public function constructorProvider() {
+ public function validConstructorProvider() {
$argLists = array();
- $argLists[] = array( false );
- $argLists[] = array( false, '' );
- $argLists[] = array( false, '4,2' );
- $argLists[] = array( false, new LatLongValue( 4, 2 ) );
+ $argLists[] = array( new LatLongValue( 4, 2 ), 42 );
+ $argLists[] = array( new LatLongValue( 42, 2.2 ), 9000.1 );
+ $argLists[] = array( new LatLongValue( 4, 2 ), 1 );
+ $argLists[] = array( new LatLongValue( 4, 2 ), 0.1 );
+
+ return $argLists;
+ }
+
+ public function invalidConstructorProvider() {
+ $argLists = array();
- $argLists[] = array( true, new LatLongValue( 4, 2 ), 42 );
- $argLists[] = array( true, new LatLongValue( 42, 2.2 ), 9000.1 );
+ $argLists[] = array( new LatLongValue( 4, 2 ), 'foo' );
- $argLists[] = array( false, '~=[,,_,,]:3', 9000.1 );
+ $argLists[] = array( new LatLongValue( 4, 2 ), 0 );
+ $argLists[] = array( new LatLongValue( 4, 2 ), -42 );
return $argLists;
}
/**
* @dataProvider instanceProvider
- * @param \Maps\Circle $circle
+ * @param Circle $circle
* @param array $arguments
*/
- public function testGetCircleCentre( \Maps\Circle $circle, array $arguments ) {
+ public function testGetCircleCentre( Circle $circle, array $arguments ) {
$this->assertTrue( $circle->getCircleCentre()->equals( $arguments[0] ) );
}
+ /**
+ * @dataProvider instanceProvider
+ * @param Circle $circle
+ * @param array $arguments
+ */
+ public function testGetCircleRadius( Circle $circle, array $arguments ) {
+ $this->assertEquals( $arguments[1], $circle->getCircleRadius() );
+ }
+
}
diff --git a/tests/phpunit/elements/ImageOverlayTest.php b/tests/phpunit/elements/ImageOverlayTest.php
index c466c1b53..419991efe 100644
--- a/tests/phpunit/elements/ImageOverlayTest.php
+++ b/tests/phpunit/elements/ImageOverlayTest.php
@@ -1,19 +1,14 @@
*/
@@ -27,27 +22,24 @@ class ImageOverlayTest extends RectangleTest {
* @return string
*/
public function getClass() {
- return 'Maps\ImageOverlay';
+ return 'Maps\Elements\ImageOverlay';
}
- /**
- * @see BaseElementTest::constructorProvider
- *
- * @since 3.0
- *
- * @return array
- */
- public function constructorProvider() {
- $argLists = array();
+ public function validConstructorProvider() {
+ $argLists = parent::validConstructorProvider();
- foreach ( parent::constructorProvider() as $argList ) {
- $argList[0] = false;
- $argLists[] = $argList;
+ foreach ( $argLists as &$argList ) {
+ $argList[] = 'Foo.png';
}
- foreach ( parent::constructorProvider() as $argList ) {
- $argList[] = 'Foo.png';
- $argLists[] = $argList;
+ return $argLists;
+ }
+
+ public function invalidConstructorProvider() {
+ $argLists = parent::validConstructorProvider();
+
+ foreach ( $argLists as &$argList ) {
+ $argList[] = null;
}
return $argLists;
@@ -55,7 +47,7 @@ public function constructorProvider() {
/**
* @dataProvider instanceProvider
- * @param \Maps\ImageOverlay $imageOverlay
+ * @param ImageOverlay $imageOverlay
* @param array $arguments
*/
public function testGetImage( ImageOverlay $imageOverlay, array $arguments ) {
diff --git a/tests/phpunit/elements/LineTest.php b/tests/phpunit/elements/LineTest.php
index 012531bc9..1bce64af3 100644
--- a/tests/phpunit/elements/LineTest.php
+++ b/tests/phpunit/elements/LineTest.php
@@ -1,20 +1,15 @@
*/
@@ -28,29 +23,16 @@ class LineTest extends BaseElementTest {
* @return string
*/
public function getClass() {
- return 'Maps\Line';
+ return 'Maps\Elements\Line';
}
- /**
- * @see BaseElementTest::constructorProvider
- *
- * @since 3.0
- *
- * @return array
- */
- public function constructorProvider() {
+ public function validConstructorProvider() {
$argLists = array();
- $argLists[] = array( false );
- $argLists[] = array( false, '' );
- $argLists[] = array( false, '4,2' );
- $argLists[] = array( false, new LatLongValue( 4, 2 ) );
-
- $argLists[] = array( true, array() );
- $argLists[] = array( true, array( new LatLongValue( 4, 2 ) ) );
+ $argLists[] = array( array() );
+ $argLists[] = array( array( new LatLongValue( 4, 2 ) ) );
$argLists[] = array(
- true,
array(
new LatLongValue( 4, 2 ),
new LatLongValue( 2, 4 ),
@@ -58,16 +40,22 @@ public function constructorProvider() {
)
);
- $argLists[] = array( false, array( '~=[,,_,,]:3' ) );
- $argLists[] = array( false, array( new LatLongValue( 4, 2 ), '~=[,,_,,]:3' ) );
- $argLists[] = array( false, array( '~=[,,_,,]:3', new LatLongValue( 4, 2 ) ) );
+ return $argLists;
+ }
+
+ public function invalidConstructorProvider() {
+ $argLists = array();
+
+ $argLists[] = array( array( '~=[,,_,,]:3' ) );
+ $argLists[] = array( array( new LatLongValue( 4, 2 ), '~=[,,_,,]:3' ) );
+ $argLists[] = array( array( '~=[,,_,,]:3', new LatLongValue( 4, 2 ) ) );
return $argLists;
}
/**
* @dataProvider instanceProvider
- * @param \Maps\Line $line
+ * @param Line $line
* @param array $arguments
*/
public function testGetLineCoordinates( Line $line, array $arguments ) {
diff --git a/tests/phpunit/elements/LocationTest.php b/tests/phpunit/elements/LocationTest.php
index 9ef152402..6fd0db25e 100644
--- a/tests/phpunit/elements/LocationTest.php
+++ b/tests/phpunit/elements/LocationTest.php
@@ -1,72 +1,37 @@
*/
-class LocationTest extends BaseElementTest {
+class LocationTest extends \PHPUnit_Framework_TestCase {
- /**
- * @see BaseElementTest::getClass
- *
- * @since 3.0
- *
- * @return string
- */
- public function getClass() {
- return 'Maps\Location';
- }
-
- /**
- * @see BaseElementTest::constructorProvider
- *
- * @since 3.0
- *
- * @return array
- */
- public function constructorProvider() {
+ public function latLongValueProvider() {
$argLists = array();
- $argLists[] = array( false );
- $argLists[] = array( false, '' );
- $argLists[] = array( false, '4,2' );
- $argLists[] = array( false, array() );
- $argLists[] = array( false, array( new LatLongValue( 4, 2 ) ) );
-
- $argLists[] = array( true, new LatLongValue( 4, 2 ) );
- $argLists[] = array( true, new LatLongValue( 42, 42 ) );
- $argLists[] = array( true, new LatLongValue( -4.2, -42 ) );
+ $argLists[] = array( new LatLongValue( 0, 0 ) );
+ $argLists[] = array( new LatLongValue( 4, 2 ) );
+ $argLists[] = array( new LatLongValue( 42, 42 ) );
+ $argLists[] = array( new LatLongValue( -4.2, -42 ) );
return $argLists;
}
/**
- * @dataProvider instanceProvider
- * @param Location $location
- * @param array $arguments
+ * @dataProvider latLongValueProvider
*/
- public function testGetLineCoordinates( Location $location, array $arguments ) {
- $coordinates = $location->getCoordinates();
-
- $this->assertType( 'DataValues\LatLongValue', $coordinates );
- $this->assertTrue( $coordinates->equals( $arguments[0] ) );
+ public function testGivenLatLongInConstructor_getCoordinatesReturnsIt( LatLongValue $latLong ) {
+ $location = new Location( $latLong );
+ $this->assertTrue( $latLong->equals( $location->getCoordinates() ) );
}
}
-
-
-
diff --git a/tests/phpunit/elements/PolygonTest.php b/tests/phpunit/elements/PolygonTest.php
index 827b63d0a..ab7364d13 100644
--- a/tests/phpunit/elements/PolygonTest.php
+++ b/tests/phpunit/elements/PolygonTest.php
@@ -1,19 +1,14 @@
*/
@@ -27,12 +22,12 @@ class PolygonTest extends LineTest {
* @return string
*/
public function getClass() {
- return 'Maps\Polygon';
+ return 'Maps\Elements\Polygon';
}
/**
* @dataProvider instanceProvider
- * @param \Maps\Polygon $polygon
+ * @param Polygon $polygon
* @param array $arguments
*/
public function testSetOnlyVisibleOnHover( Polygon $polygon, array $arguments ) {
@@ -45,6 +40,36 @@ public function testSetOnlyVisibleOnHover( Polygon $polygon, array $arguments )
$this->assertFalse( $polygon->isOnlyVisibleOnHover() );
}
+ /**
+ * @dataProvider instanceProvider
+ * @param Polygon $polygon
+ * @param array $arguments
+ */
+ public function testSetFillOpacity( Polygon $polygon, array $arguments ) {
+ $polygon->setFillOpacity( '0.42' );
+ $this->assertHasJsonKeyWithValue( $polygon, 'fillOpacity', '0.42' );
+ }
+
+ protected function assertHasJsonKeyWithValue( Polygon $polygon, $key, $value ) {
+ $json = $polygon->getJSONObject();
+
+ $this->assertArrayHasKey( $key, $json );
+ $this->assertEquals(
+ $value,
+ $json[$key]
+ );
+ }
+
+ /**
+ * @dataProvider instanceProvider
+ * @param Polygon $polygon
+ * @param array $arguments
+ */
+ public function testSetFillColor( Polygon $polygon, array $arguments ) {
+ $polygon->setFillColor( '#FFCCCC' );
+ $this->assertHasJsonKeyWithValue( $polygon, 'fillColor', '#FFCCCC' );
+ }
+
}
diff --git a/tests/phpunit/elements/RectangleTest.php b/tests/phpunit/elements/RectangleTest.php
index 43a758b11..09d08e8dc 100644
--- a/tests/phpunit/elements/RectangleTest.php
+++ b/tests/phpunit/elements/RectangleTest.php
@@ -1,20 +1,15 @@
*/
@@ -28,37 +23,29 @@ class RectangleTest extends BaseElementTest {
* @return string
*/
public function getClass() {
- return 'Maps\Rectangle';
+ return 'Maps\Elements\Rectangle';
}
- /**
- * @see BaseElementTest::constructorProvider
- *
- * @since 3.0
- *
- * @return array
- */
- public function constructorProvider() {
+ public function validConstructorProvider() {
$argLists = array();
- $argLists[] = array( false );
- $argLists[] = array( false, '' );
- $argLists[] = array( false, '4,2' );
- $argLists[] = array( false, new LatLongValue( 4, 2 ) );
- $argLists[] = array( false, array() );
- $argLists[] = array( false, array( new LatLongValue( 4, 2 ) ) );
- $argLists[] = array( false, new LatLongValue( 4, 2 ), 'foobar' );
- $argLists[] = array( false, 'foobar', new LatLongValue( 4, 2 ) );
+ $argLists[] = array( new LatLongValue( 4, 2 ), new LatLongValue( -4, -2 ) );
+ $argLists[] = array( new LatLongValue( -42, -42 ), new LatLongValue( -4, -2 ) );
+
+ return $argLists;
+ }
+
+ public function invalidConstructorProvider() {
+ $argLists = array();
- $argLists[] = array( true, new LatLongValue( 4, 2 ), new LatLongValue( 4, 2 ) );
- $argLists[] = array( true, new LatLongValue( 4, 2 ), new LatLongValue( -4, -2 ) );
+ $argLists[] = array( new LatLongValue( 4, 2 ), new LatLongValue( 4, 2 ) );
return $argLists;
}
/**
* @dataProvider instanceProvider
- * @param \Maps\Rectangle $rectangle
+ * @param Rectangle $rectangle
* @param array $arguments
*/
public function testGetCorners( Rectangle $rectangle, array $arguments ) {
@@ -68,7 +55,7 @@ public function testGetCorners( Rectangle $rectangle, array $arguments ) {
/**
* @dataProvider instanceProvider
- * @param \Maps\Rectangle $rectangle
+ * @param Rectangle $rectangle
* @param array $arguments
*/
public function testSetCorners( Rectangle $rectangle, array $arguments ) {
diff --git a/tests/phpunit/parserhooks/CoordinatesTest.php b/tests/phpunit/parserhooks/CoordinatesTest.php
index a26662179..3036ce5b9 100644
--- a/tests/phpunit/parserhooks/CoordinatesTest.php
+++ b/tests/phpunit/parserhooks/CoordinatesTest.php
@@ -2,14 +2,11 @@
namespace Maps\Test;
+use DataValues\LatLongValue;
+use ParamProcessor\ParamDefinition;
+
/**
- * Tests for the Maps\Coordinates class.
- *
- * @file
- * @since 2.0
- *
- * @ingroup Maps
- * @ingroup Test
+ * @covers MapsCoordinates
*
* @group Maps
* @group ParserHook
@@ -39,13 +36,18 @@ public function parametersProvider() {
$paramLists[] = array(
array(
- 'location' => '4,2'
+ 'location' => '4,2',
+ 'format' => 'dms',
+ 'directional' => 'no',
),
'4° 0\' 0", 2° 0\' 0"'
);
+
$paramLists[] = array(
array(
- 'location' => '55 S, 37.6176330 W'
+ 'location' => '55 S, 37.6176330 W',
+ 'format' => 'dms',
+ 'directional' => 'no',
),
'-55° 0\' 0", -37° 37\' 3.4788"'
);
@@ -54,10 +56,28 @@ public function parametersProvider() {
array(
'location' => '4,2',
'format' => 'float',
+ 'directional' => 'no',
),
'4, 2'
);
+ $paramLists[] = array(
+ array(
+ 'location' => '-4,-2',
+ 'format' => 'float',
+ 'directional' => 'yes',
+ ),
+ '4 S, 2 W'
+ );
+
+ $paramLists[] = array(
+ array(
+ 'location' => '55 S, 37.6176330 W',
+ 'directional' => 'yes',
+ ),
+ '55° 0\' 0" S, 37° 37\' 3.4788" W'
+ );
+
return $paramLists;
}
@@ -67,7 +87,7 @@ public function parametersProvider() {
* @return array
*/
public function processingProvider() {
- $definitions = \ParamDefinition::getCleanDefinitions( $this->getInstance()->getParamDefinitions() );
+ $definitions = ParamDefinition::getCleanDefinitions( $this->getInstance()->getParamDefinitions() );
$argLists = array();
$values = array(
@@ -75,7 +95,7 @@ public function processingProvider() {
);
$expected = array(
- 'location' => new \DataValues\LatLongValue( 4, 2 ),
+ 'location' => new LatLongValue( 4, 2 ),
);
$argLists[] = array( $values, $expected );
@@ -87,7 +107,7 @@ public function processingProvider() {
);
$expected = array(
- 'location' => new \DataValues\LatLongValue( 4, 2 ),
+ 'location' => new LatLongValue( 4, 2 ),
'directional' => !$definitions['directional']->getDefault(),
'format' => Maps_COORDS_DD,
);
@@ -101,7 +121,7 @@ public function processingProvider() {
);
$expected = array(
- 'location' => new \DataValues\LatLongValue( 4, 2 ),
+ 'location' => new LatLongValue( 4, 2 ),
'directional' => !$definitions['directional']->getDefault(),
'format' => Maps_COORDS_DD,
);
diff --git a/tests/phpunit/parserhooks/DisplayMapTest.php b/tests/phpunit/parserhooks/DisplayMapTest.php
index 8e97a57a3..c74d067a6 100644
--- a/tests/phpunit/parserhooks/DisplayMapTest.php
+++ b/tests/phpunit/parserhooks/DisplayMapTest.php
@@ -2,14 +2,10 @@
namespace Maps\Test;
+use Maps\Elements\Location;
+
/**
- * Tests for the Maps\DisplayMap class.
- *
- * @file
- * @since 2.0
- *
- * @ingroup Maps
- * @ingroup Test
+ * @covers MapsDisplayMap
*
* @group Maps
* @group ParserHook
@@ -66,10 +62,8 @@ public function testForSomeReasonPhpSegfaultsIfThereIsOneMethodLess() {
* @return array
*/
public function processingProvider() {
- $definitions = $this->getInstance()->getParamDefinitions();
$argLists = array();
- // TODO
$values = array(
'locations' => '4,2',
'width' => '420',
@@ -78,7 +72,7 @@ public function processingProvider() {
);
$expected = array(
- 'coordinates' => array( new \Maps\Location( new \DataValues\LatLongValue( 4, 2 ) ) ),
+ 'coordinates' => array( new Location( new \DataValues\LatLongValue( 4, 2 ) ) ),
'width' => '420px',
'height' => '420px',
'mappingservice' => 'openlayers',
diff --git a/tests/phpunit/parserhooks/DistanceTest.php b/tests/phpunit/parserhooks/DistanceTest.php
index fccf41766..3f25b02ea 100644
--- a/tests/phpunit/parserhooks/DistanceTest.php
+++ b/tests/phpunit/parserhooks/DistanceTest.php
@@ -3,13 +3,7 @@
namespace Maps\Test;
/**
- * Tests for the Maps\Distance class.
- *
- * @file
- * @since 2.0
- *
- * @ingroup Maps
- * @ingroup Test
+ * @covers MapsDistance
*
* @group Maps
* @group ParserHook
diff --git a/tests/phpunit/parserhooks/FinddestinationTest.php b/tests/phpunit/parserhooks/FinddestinationTest.php
index 56963b2ce..7bbfe53ba 100644
--- a/tests/phpunit/parserhooks/FinddestinationTest.php
+++ b/tests/phpunit/parserhooks/FinddestinationTest.php
@@ -2,14 +2,10 @@
namespace Maps\Test;
+use Maps\Elements\Location;
+
/**
- * Tests for the Maps\Finddestination class.
- *
- * @file
- * @since 2.0
- *
- * @ingroup Maps
- * @ingroup Test
+ * @covers MapsFinddestination
*
* @group Maps
* @group ParserHook
@@ -101,7 +97,7 @@ public function processingProvider() {
$expected = array(
'distance' => $expectedDistance,
'bearing' => (float)$bearing,
- 'location' => new \Maps\Location( $coordinateParser->parse( $location )->getValue() ),
+ 'location' => new Location( $coordinateParser->parse( $location )->getValue() ),
);
$argLists[] = array( $values, $expected );
diff --git a/tests/phpunit/parserhooks/GeocodeTest.php b/tests/phpunit/parserhooks/GeocodeTest.php
index 384fa879e..c3bb0878f 100644
--- a/tests/phpunit/parserhooks/GeocodeTest.php
+++ b/tests/phpunit/parserhooks/GeocodeTest.php
@@ -2,14 +2,10 @@
namespace Maps\Test;
+use Maps\Elements\Location;
+
/**
- * Tests for the Maps\Geocode class.
- *
- * @file
- * @since 2.0
- *
- * @ingroup Maps
- * @ingroup Test
+ * @covers MapsGeocode
*
* @group Maps
* @group ParserHook
@@ -55,7 +51,7 @@ public function processingProvider() {
);
$expected = array(
- 'location' => new \Maps\Location( new \DataValues\LatLongValue( 4, 2 ) ),
+ 'location' => new Location( new \DataValues\LatLongValue( 4, 2 ) ),
'allowcoordinates' => true,
);
diff --git a/tests/phpunit/parserhooks/GeodistanceTest.php b/tests/phpunit/parserhooks/GeodistanceTest.php
index 29c125f9f..632f21f8d 100644
--- a/tests/phpunit/parserhooks/GeodistanceTest.php
+++ b/tests/phpunit/parserhooks/GeodistanceTest.php
@@ -2,14 +2,11 @@
namespace Maps\Test;
+use DataValues\LatLongValue;
+use Maps\Elements\Location;
+
/**
- * Tests for the Maps\Geodistance class.
- *
- * @file
- * @since 2.0
- *
- * @ingroup Maps
- * @ingroup Test
+ * @covers MapsGeodistance
*
* @group Maps
* @group ParserHook
@@ -64,8 +61,8 @@ public function processingProvider() {
);
$expected = array(
- 'location1' => new \Maps\Location( new \DataValues\LatLongValue( 4, 2 ) ),
- 'location2' => new \Maps\Location( new \DataValues\LatLongValue( 42, 0 ) ),
+ 'location1' => new Location( new LatLongValue( 4, 2 ) ),
+ 'location2' => new Location( new LatLongValue( 42, 0 ) ),
);
$argLists[] = array( $values, $expected );
@@ -78,8 +75,8 @@ public function processingProvider() {
);
$expected = array(
- 'location1' => new \Maps\Location( new \DataValues\LatLongValue( 4, 2 ) ),
- 'location2' => new \Maps\Location( new \DataValues\LatLongValue( 42, 0 ) ),
+ 'location1' => new Location( new LatLongValue( 4, 2 ) ),
+ 'location2' => new Location( new LatLongValue( 42, 0 ) ),
'decimals' => 1,
);
diff --git a/tests/phpunit/parserhooks/MapsDocTest.php b/tests/phpunit/parserhooks/MapsDocTest.php
index 8285aa028..77151bacf 100644
--- a/tests/phpunit/parserhooks/MapsDocTest.php
+++ b/tests/phpunit/parserhooks/MapsDocTest.php
@@ -3,13 +3,7 @@
namespace Maps\Test;
/**
- * Tests for the Maps\MapsDoc class.
- *
- * @file
- * @since 2.0
- *
- * @ingroup Maps
- * @ingroup Test
+ * @covers MapsMapsDoc
*
* @group Maps
* @group ParserHook
diff --git a/tests/phpunit/parserhooks/ParserHookTest.php b/tests/phpunit/parserhooks/ParserHookTest.php
index c7b6ac2ac..f8a274182 100644
--- a/tests/phpunit/parserhooks/ParserHookTest.php
+++ b/tests/phpunit/parserhooks/ParserHookTest.php
@@ -2,22 +2,17 @@
namespace Maps\Test;
+use ParamProcessor\ParamDefinition;
+use ParamProcessor\Processor;
+
/**
- * Tests for the MapsCoordinates class.
- *
- * @file
- * @since 2.0
- *
- * @ingroup Maps
- * @ingroup Test
- *
* @group Maps
* @group ParserHook
*
* @licence GNU GPL v2+
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
-abstract class ParserHookTest extends \MediaWikiTestCase {
+abstract class ParserHookTest extends \PHPUnit_Framework_TestCase {
/**
* @since 2.0
@@ -77,16 +72,16 @@ public function processingProvider() {
public function testParamProcessing( array $parameters, array $expectedValues ) {
$definitions = $this->getInstance()->getParamDefinitions();
- $processor = \ParamProcessor\Processor::newDefault();
+ $processor = Processor::newDefault();
$processor->setParameters( $parameters, $definitions );
- $processor->validateParameters();
+ $result = $processor->processParameters();
- if ( $processor->hasFatalError() ) {
- throw new \MWException( 'Fatal error occurred during the param processing: ' . $processor->hasFatalError()->getMessage() );
+ if ( $result->hasFatal() ) {
+ $this->fail( 'Fatal error occurred during the param processing: ' . $processor->hasFatalError()->getMessage() );
}
- $actual = $processor->getParameterValues();
+ $actual = $result->getParameters();
$expectedValues = array_merge( $this->getDefaultValues(), $expectedValues );
@@ -95,8 +90,10 @@ public function testParamProcessing( array $parameters, array $expectedValues )
$this->assertEquals(
$expected,
- $actual[$name],
- 'Expected ' . var_export( $expected, true ) . ' should match actual ' . var_export( $actual[$name], true )
+ $actual[$name]->getValue(),
+ 'Expected ' . var_export( $expected, true )
+ . ' should match actual '
+ . var_export( $actual[$name]->getValue(), true )
);
}
}
@@ -109,7 +106,7 @@ public function testParamProcessing( array $parameters, array $expectedValues )
* @return array
*/
protected function getDefaultValues() {
- $definitions = \ParamDefinition::getCleanDefinitions( $this->getInstance()->getParamDefinitions() );
+ $definitions = ParamDefinition::getCleanDefinitions( $this->getInstance()->getParamDefinitions() );
$defaults = array();
@@ -122,4 +119,13 @@ protected function getDefaultValues() {
return $defaults;
}
+ protected function arrayWrap( array $elements ) {
+ return array_map(
+ function ( $element ) {
+ return array( $element );
+ },
+ $elements
+ );
+ }
+
}
\ No newline at end of file
diff --git a/tests/phpunit/parsers/CircleParserTest.php b/tests/phpunit/parsers/CircleParserTest.php
new file mode 100644
index 000000000..206ea3fd5
--- /dev/null
+++ b/tests/phpunit/parsers/CircleParserTest.php
@@ -0,0 +1,44 @@
+
+ */
+class CircleParserTest extends \PHPUnit_Framework_TestCase {
+
+ public function testCanConstruct() {
+ new CircleParser();
+ $this->assertTrue( true );
+ }
+
+ public function testGivenCoordinateAndRadius_parserReturnsCircle() {
+ $parser = new CircleParser();
+
+ $circle = $parser->parse( '57.421,23.90625:32684.605182' );
+
+ $this->assertInstanceOf( 'Maps\Elements\Circle', $circle );
+
+ $expectedLatLong = new LatLongValue( 57.421, 23.90625 );
+ $this->assertTrue( $expectedLatLong->equals( $circle->getCircleCentre() ) );
+
+ $this->assertEquals( 32684.605182, $circle->getCircleRadius() );
+ }
+
+ public function testGivenTitleAndText_circleHasProvidedMetaData() {
+ $parser = new CircleParser();
+
+ $circle = $parser->parse( '57.421,23.90625:32684.605182~title~text' );
+
+ $this->assertInstanceOf( 'Maps\Elements\Circle', $circle );
+
+ $this->assertEquals( 'title', $circle->getTitle() );
+ $this->assertEquals( 'text', $circle->getText() );
+ }
+
+}
diff --git a/tests/phpunit/parsers/DistanceParserTest.php b/tests/phpunit/parsers/DistanceParserTest.php
index 2caccefd8..8fcbdc581 100644
--- a/tests/phpunit/parsers/DistanceParserTest.php
+++ b/tests/phpunit/parsers/DistanceParserTest.php
@@ -3,16 +3,7 @@
namespace Maps\Test;
/**
- * Unit tests for the Maps\DistanceParser class.
- *
- * @since 3.0
- *
- * @ingroup MapsTest
- *
- * @group ValueParsers
- * @group Maps
- * @group DistanceParserTest
- *
+ * @covers Maps\DistanceParser
* @licence GNU GPL v2+
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
diff --git a/tests/phpunit/parsers/LineParserTest.php b/tests/phpunit/parsers/LineParserTest.php
index a58858071..846d4daf6 100644
--- a/tests/phpunit/parsers/LineParserTest.php
+++ b/tests/phpunit/parsers/LineParserTest.php
@@ -3,19 +3,10 @@
namespace Maps\Test;
use DataValues\LatLongValue;
-use Maps\Line;
+use Maps\Elements\Line;
/**
- * Unit tests for the Maps\LineParser class.
- *
- * @since 3.0
- *
- * @ingroup MapsTest
- *
- * @group ValueParsers
- * @group Maps
- * @group LineParserTest
- *
+ * @covers Maps\LineParser
* @licence GNU GPL v2+
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
diff --git a/tests/phpunit/parsers/LocationParserTest.php b/tests/phpunit/parsers/LocationParserTest.php
index 77b112982..b78b44666 100644
--- a/tests/phpunit/parsers/LocationParserTest.php
+++ b/tests/phpunit/parsers/LocationParserTest.php
@@ -3,19 +3,12 @@
namespace Maps\Test;
use DataValues\LatLongValue;
-use Maps\Location;
+use Maps\Elements\Location;
+use Maps\LocationParser;
+use Title;
/**
- * Unit tests for the Maps\LocationParser class.
- *
- * @since 3.0
- *
- * @ingroup MapsTest
- *
- * @group ValueParsers
- * @group Maps
- * @group LocationParserTest
- *
+ * @covers Maps\LocationParser
* @licence GNU GPL v2+
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
@@ -76,4 +69,75 @@ protected function requireDataValue() {
return false;
}
+ /**
+ * @dataProvider titleProvider
+ */
+ public function testGivenTitleThatIsNotLink_titleIsSetAndLinkIsNot( $title ) {
+ $parser = new LocationParser();
+ $location = $parser->parse( '4,2~' . $title );
+
+ $this->assertTitleAndLinkAre( $location, $title, '' );
+ }
+
+ public function titleProvider() {
+ return array(
+ array( '' ),
+ array( 'Title' ),
+ array( 'Some title' ),
+ array( 'link' ),
+ array( 'links:foo' ),
+ );
+ }
+
+ protected function assertTitleAndLinkAre( Location $location, $title, $link ) {
+ $this->assertHasJsonKeyWithValue( $location, 'title', $title );
+ $this->assertHasJsonKeyWithValue( $location, 'link', $link );
+ }
+
+ protected function assertHasJsonKeyWithValue( Location $polygon, $key, $value ) {
+ $json = $polygon->getJSONObject();
+
+ $this->assertArrayHasKey( $key, $json );
+ $this->assertEquals(
+ $value,
+ $json[$key]
+ );
+ }
+
+ /**
+ * @dataProvider linkProvider
+ */
+ public function testGivenTitleThatIsLink_linkIsSetAndTitleIsNot( $link ) {
+ $parser = new LocationParser();
+ $location = $parser->parse( '4,2~link:' . $link );
+
+ $this->assertTitleAndLinkAre( $location, '', $link );
+ }
+
+ public function linkProvider() {
+ return array(
+ array( 'https://semantic-mediawiki.org' ),
+ array( 'http://www.semantic-mediawiki.org' ),
+ array( 'irc://freenode.net' ),
+ );
+ }
+
+ /**
+ * @dataProvider titleLinkProvider
+ */
+// public function testGivenPageTitleAsLink_pageTitleIsTurnedIntoUrl( $link ) {
+// $parser = new LocationParser();
+// $location = $parser->parse( '4,2~link:' . $link );
+//
+// $linkUrl = Title::newFromText( $link )->getFullURL();
+// $this->assertTitleAndLinkAre( $location, '', $linkUrl );
+// }
+//
+// public function titleLinkProvider() {
+// return array(
+// array( 'Foo' ),
+// array( 'Some_Page' ),
+// );
+// }
+
}
diff --git a/tests/phpunit/parsers/RectlangleParserTest.php b/tests/phpunit/parsers/RectlangleParserTest.php
new file mode 100644
index 000000000..6a2788e2f
--- /dev/null
+++ b/tests/phpunit/parsers/RectlangleParserTest.php
@@ -0,0 +1,45 @@
+
+ */
+class RectangleParserTest extends \PHPUnit_Framework_TestCase {
+
+ public function testCanConstruct() {
+ new RectangleParser();
+ $this->assertTrue( true );
+ }
+
+ public function testGivenBoundingBox_parserReturnsRectangle() {
+ $parser = new RectangleParser();
+
+ $rectangle = $parser->parse( '51.8357775,33.83789:46,23.37890625' );
+
+ $this->assertInstanceOf( 'Maps\Elements\Rectangle', $rectangle );
+
+ $expectedNorthEast = new LatLongValue( 51.8357775, 33.83789 );
+ $this->assertTrue( $expectedNorthEast->equals( $rectangle->getRectangleNorthEast() ) );
+
+ $expectedSouthWest = new LatLongValue( 46, 23.37890625 );
+ $this->assertTrue( $expectedSouthWest->equals( $rectangle->getRectangleSouthWest() ) );
+ }
+
+ public function testGivenTitleAndText_rectangleHasProvidedMetaData() {
+ $parser = new RectangleParser();
+
+ $rectangle = $parser->parse( "51.8357775,33.83789:46,23.37890625~I'm a square~of doom" );
+
+ $this->assertInstanceOf( 'Maps\Elements\Rectangle', $rectangle );
+
+ $this->assertEquals( "I'm a square", $rectangle->getTitle() );
+ $this->assertEquals( 'of doom', $rectangle->getText() );
+ }
+
+}
diff --git a/tests/phpunit/parsers/WmsOverlayParserTest.php b/tests/phpunit/parsers/WmsOverlayParserTest.php
index 16707ca63..1b141af7b 100644
--- a/tests/phpunit/parsers/WmsOverlayParserTest.php
+++ b/tests/phpunit/parsers/WmsOverlayParserTest.php
@@ -2,19 +2,10 @@
namespace Maps\Test;
-use Maps\WmsOverlay;
+use Maps\Elements\WmsOverlay;
/**
- * Unit tests for the Maps\WmsOverlayParser class.
- *
- * @since 3.0
- *
- * @ingroup MapsTest
- *
- * @group ValueParsers
- * @group Maps
- * @group WmsOverlayParserTest
- *
+ * @covers Maps\WmsOverlayParser
* @licence GNU GPL v2+
* @author Mathias Mølster Lidal
*/