We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 26bd15ec authored by Brion Vibber's avatar Brion Vibber

Mapstraction plugin: use minified sources for OpenLayers

The default full build of OpenLayers.js is 943kb as of 2.10; this gzips down to a couple hundred kb
but is still rather nasty, plus loading it off a remote host could slow things down.

Using a local copy let us cut down the size significantly by discarding unused features, and further
minification with yui-compressor shaves a bit more off. Cuts down to about 1/5 the size of the

Also threw in a bundled & minified copy of the Mapstraction classes plus our usermap.js,
which covers the common case of using the default OpenLayers provider. This cuts out three
additional script loads, two of which weren't getting launched until after the mxn.js main
file got loaded.
parent fb315c6f
......@@ -128,8 +128,8 @@ class MapstractionPlugin extends Plugin
case 'openlayers':
// XXX: is this not nice...?
// Use our included stripped & minified OpenLayers.
case 'yahoo':
......@@ -140,11 +140,19 @@ class MapstractionPlugin extends Plugin
return true;
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.
} else {
$action->inlineScript(sprintf('var _provider = "%s";', $this->provider));
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment