CUSTOMIZATION.txt 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. Current for 6.x-2.0-alpha3
  2. Obviously there are many points at which advanced users will want to push the
  3. limits of what the OpenLayers module can do. In many cases, these changes can be
  4. make without any 'hacks' to the module, and before hacking, it is highly
  5. recommended to think about ways that changes could be incorporated into the
  6. module proper via patches.
  7. # Performance
  8. The largest performance hit of OpenLayers at the moment seems to be in the very
  9. large size of the OpenLayers.js library. The real route to fixing this problem
  10. is by narrowing down the set of components included in the Javascript file. In
  11. order to do this:
  12. ## Manually
  13. svn checkout http://svn.openlayers.org/trunk/openlayers/ cd openlayers/build
  14. edit full.cfg or lite.cfg to include the components your map uses.
  15. python build.py [yourcustomized.cfg]
  16. This will produce a compacted, slimmed OpenLayers.js file.
  17. After doing this, make sure to set the ImgPath and ThemePath in the OpenLayers
  18. administration - these are per-map settings. The OpenLayers library guesses
  19. the location of its style.css and images, so if you make a compacted
  20. OpenLayers.js in an otherwise empty folder, it will fail in this task and have
  21. blank images and a nonfunctional ZoomBox control (the red 'zooming box') will
  22. not appear.
  23. ## Map Performance
  24. Using multiple domain names for layers will [dodge the browser connection
  25. limit](http://trac.openlayers.org/wiki/OpenLayersOptimization) and allow more
  26. tiles to load in parallel. However, this has a bad interaction with the default
  27. buffer setting, making tiles outside the viewport load first in many cases, so
  28. buffer should be set to 0 if multiple urls are enabled.
  29. # Custom Behaviors
  30. If behaviors similar to those included are necessary, just clone the behaviors
  31. and create a tiny new module that includes the copy. The same goes for layers,
  32. etc.