diff --git a/extension.json b/extension.json index 5b2662434..f0bcddc8e 100644 --- a/extension.json +++ b/extension.json @@ -204,6 +204,74 @@ "scripts": [ "leaflet/ext.sm.leafletajax.js" ] + }, + + "ext.maps.googlemaps3": { + "dependencies": [ + "ext.maps.common" + ], + "scripts": [ + "GoogleMaps/jquery.googlemap.js", + "GoogleMaps/ext.maps.googlemaps3.js" + ], + "messages": [ + "maps-googlemaps3-incompatbrowser", + "maps-copycoords-prompt", + "maps-searchmarkers-text", + "maps-fullscreen-button", + "maps-fullscreen-button-tooltip" + ] + }, + + "ext.maps.gm3.markercluster": { + "dependencies": [ + "ext.maps.googlemaps3" + ], + "scripts": [ + "GoogleMaps/gm3-util-library/markerclusterer.js" + ] + }, + + "ext.maps.gm3.markerwithlabel": { + "dependencies": [ + "ext.maps.googlemaps3" + ], + "scripts": [ + "GoogleMaps/gm3-util-library/markerwithlabel.js" + ], + "styles": [ + "GoogleMaps/gm3-util-library/markerwithlabel.css" + ] + }, + + "ext.maps.gm3.geoxml": { + "dependencies": [ + "ext.maps.googlemaps3" + ], + "scripts": [ + "GoogleMaps/geoxml3/geoxml3.js", + "GoogleMaps/geoxml3/ZipFile.complete.js", + "GoogleMaps/geoxml3/ProjectedOverlay.js" + ] + }, + + "ext.maps.gm3.earth": { + "dependencies": [ + "ext.maps.googlemaps3" + ], + "scripts": [ + "GoogleMaps/gm3-util-library/googleearth-compiled.js" + ] + }, + + "ext.sm.googlemaps3ajax": { + "dependencies": [ + "ext.maps.googlemaps3", + "ext.sm.common" + ], + "scripts": [ + "GoogleMaps/ext.sm.googlemaps3ajax.js" + ] } }, diff --git a/src/MapsSetup.php b/src/MapsSetup.php index 5e0bbf4e4..245d39150 100644 --- a/src/MapsSetup.php +++ b/src/MapsSetup.php @@ -49,7 +49,6 @@ public function setup() { private function registerAllTheThings() { $this->registerParserHooks(); - $this->registerGoogleMapsModules(); $this->registerPermissions(); $this->registerParameterTypes(); $this->registerHooks(); @@ -146,99 +145,6 @@ function ( $text, array $arguments, Parser $parser ) { }; } - private function registerGoogleMapsModules() { - global $wgResourceModules; - - $localBasePath = __DIR__ . '/../resources/GoogleMaps'; - $remoteExtPath = 'Maps/resources/GoogleMaps'; - - $wgResourceModules['ext.maps.googlemaps3'] = [ - 'dependencies' => [ 'ext.maps.common' ], - 'localBasePath' => $localBasePath, - 'remoteExtPath' => $remoteExtPath, - 'targets' => [ - 'mobile', - 'desktop' - ], - 'scripts' => [ - 'jquery.googlemap.js', - 'ext.maps.googlemaps3.js' - ], - 'messages' => [ - 'maps-googlemaps3-incompatbrowser', - 'maps-copycoords-prompt', - 'maps-searchmarkers-text', - 'maps-fullscreen-button', - 'maps-fullscreen-button-tooltip', - ] - ]; - - $wgResourceModules['ext.maps.gm3.markercluster'] = [ - 'localBasePath' => $localBasePath . '/gm3-util-library', - 'remoteExtPath' => $remoteExtPath . '/gm3-util-library', - 'targets' => [ - 'mobile', - 'desktop' - ], - 'scripts' => [ - 'markerclusterer.js', - ], - ]; - - $wgResourceModules['ext.maps.gm3.markerwithlabel'] = [ - 'localBasePath' => $localBasePath . '/gm3-util-library', - 'remoteExtPath' => $remoteExtPath . '/gm3-util-library', - 'targets' => [ - 'mobile', - 'desktop' - ], - 'scripts' => [ - 'markerwithlabel.js', - ], - 'styles' => [ - 'markerwithlabel.css', - ], - ]; - - $wgResourceModules['ext.maps.gm3.geoxml'] = [ - 'localBasePath' => $localBasePath . '/geoxml3', - 'remoteExtPath' => $remoteExtPath . '/geoxml3', - 'targets' => [ - 'mobile', - 'desktop' - ], - 'scripts' => [ - 'geoxml3.js', - 'ZipFile.complete.js', //kmz handling - 'ProjectedOverlay.js', //Overlay handling - ], - ]; - - $wgResourceModules['ext.maps.gm3.earth'] = [ - 'localBasePath' => $localBasePath . '/gm3-util-library', - 'remoteExtPath' => $remoteExtPath . '/gm3-util-library', - 'targets' => [ - 'mobile', - 'desktop' - ], - 'scripts' => [ - 'googleearth-compiled.js', - ], - ]; - - $wgResourceModules['ext.sm.googlemaps3ajax'] = [ - 'localBasePath' => $localBasePath, - 'remoteExtPath' => $remoteExtPath, - 'dependencies' => [ - 'ext.maps.googlemaps3', - 'ext.sm.common' - ], - 'scripts' => [ - 'ext.sm.googlemaps3ajax.js' - ] - ]; - } - private function registerPermissions() { $this->mwGlobals['wgAvailableRights'][] = 'geocode';