diff options
author | Brion Vibber <brion@pobox.com> | 2010-12-15 11:59:31 -0800 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-12-15 11:59:31 -0800 |
commit | bf20258f4b61dd8396db9a1980463c060dab292c (patch) | |
tree | f43d7d73e9877bb40fe373afcf3849f9cd5c3398 /plugins/Mapstraction/MapstractionPlugin.php | |
parent | 9df856e667a12cd217576263efbc72fff12692d9 (diff) | |
parent | 6c671141982c5837a2e5bf1e90de389c728d5dee (diff) |
Merge branch '0.9.x' into 1.0.x
Diffstat (limited to 'plugins/Mapstraction/MapstractionPlugin.php')
-rw-r--r-- | plugins/Mapstraction/MapstractionPlugin.php | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/plugins/Mapstraction/MapstractionPlugin.php b/plugins/Mapstraction/MapstractionPlugin.php index d1a7bd0ed..d5b4e5052 100644 --- a/plugins/Mapstraction/MapstractionPlugin.php +++ b/plugins/Mapstraction/MapstractionPlugin.php @@ -128,8 +128,8 @@ class MapstractionPlugin extends Plugin $action->script((StatusNet::isHTTPS()?'https':'http') + '://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6'); break; case 'openlayers': - // XXX: is this not nice...? - $action->script('http://openlayers.org/api/OpenLayers.js'); + // Use our included stripped & minified OpenLayers. + $action->script(common_path('plugins/Mapstraction/OpenLayers/OpenLayers.js')); break; case 'yahoo': $action->script(sprintf('http://api.maps.yahoo.com/ajaxymap?v=3.8&appid=%s', @@ -140,11 +140,19 @@ class MapstractionPlugin extends Plugin return true; } - $action->script(sprintf('%s?(%s)', - common_path('plugins/Mapstraction/js/mxn.js'), - $this->provider)); - - $action->script(common_path('plugins/Mapstraction/usermap.js')); + if ($this->provider == 'openlayers') { + // We have an optimized path for our default case. + // + // Note that OpenLayers.js needs to be separate, or it won't + // be able to find its UI images and styles. + $action->script(common_path('plugins/Mapstraction/usermap-mxn-openlayers.min.js')); + } else { + $action->script(sprintf('%s?(%s)', + common_path('plugins/Mapstraction/js/mxn.js'), + $this->provider)); + + $action->script(common_path('plugins/Mapstraction/usermap.js')); + } $action->inlineScript(sprintf('var _provider = "%s";', $this->provider)); |