[OpenLayers-Trac] [OpenLayers] #322: dynamic loading of JS libraries associated with Layers
OpenLayers
trac at openlayers.org
Wed Jan 31 07:09:04 EST 2007
#322: dynamic loading of JS libraries associated with Layers
----------------------+-----------------------------------------------------
Reporter: jrf | Owner:
Type: feature | Status: new
Priority: minor | Milestone: 2.5 Release
Component: Layer | Version:
Resolution: | Keywords:
----------------------+-----------------------------------------------------
Comment (by crschmidt):
So, the best way to do this, if you need this functionality:
* Create a map. add your non-commercial layers to the map. Make your map
variable global.
* Seperate the functionality of adding the commercial layers into a
seperate function.
* Add a script element to your page with an onload that calls that
function:
{{{
<script
src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhR2WgIWO4X4SoXnfmo_1F9_zl7r7hT7s7xvI_08hh6tzoOcqOGZ0zKkjA"
type="text/javascript"
onload="setTimeout(add_gmaps,1000)"></script>
}}}
This technique is used successfully on MetaCarta Maps.
--
Ticket URL: <http://trac.openlayers.org/ticket/322#comment:5>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer
More information about the Trac
mailing list