Hi there,

as the Openlayers JS file is pretty big I am wondering what the best strategy is to deal with that.

Using the hosted version might have the advantage, that the Browser might already have this file in its cache, if the user has already visited another site, which includes it from the same place. One disadvantage of using the hosted file probably is that the server is probably not as fast as it could be?

Using a local version one could compress the file, I have read. But, isn't it compressed already? Which ways could it be further optimzed?

And last not least - how big is the OpenLayers Lib in comparison to lets say Google Maps? Are there big differences, or is it more or less the same for every mapping library?

I hope someone has already had similar concerns and can share her thoughts..

Thanks,
Walter

Comments

tmcw’s picture

Using the hosted version might have the advantage, that the Browser might already have this file in its cache, if the user has already visited another site, which includes it from the same place. One disadvantage of using the hosted file probably is that the server is probably not as fast as it could be?

Use a local version if at all possible. The openlayers.org server is slow and unreliable.

Using a local version one could compress the file, I have read. But, isn't it compressed already? Which ways could it be further optimzed?

By removing the parts of the library you don't use. See OpenLayerer

And last not least - how big is the OpenLayers Lib in comparison to lets say Google Maps?

OpenLayers is much larger than Google Maps, and than most other mapping libraries, due to years of code additions and overly verbose coding technique.

zzolo’s picture

Component: OpenLayers API » OL API
Status: Active » Closed (works as designed)

Closing. Ask more questions if needed.

Patroclas’s picture

Version: 7.x-2.0-alpha1 » 7.x-2.0-beta1

I have been attempting to reduce the size of a locally hosted OL library with OpenLayerer but cannot get anything but the full version to work.

Is there any guidance available for the essential elements for an OL Drupal install?

I am using OL to render layers created from kml files with Google maps.

Thanks

tom_o_t’s picture

Can you add some more detail about what doesn't work when you try to reduce the size?

Patroclas’s picture

I have another issue at http://drupal.org/node/1358290 which supercedes this - will come back to this when that is solved.