How to dynamically add zoomcontrol, radar etc to map plugin?

  • Hello,
    I want to add a map plugin only if the visitor decides to open the map. Otherwise, I suppose, I'll be billed by Google for every visitor, no matter if he uses the map.
    I successfully create plugin[map] but I don't know how to add zoomcontrol, radar, spotstyle, and spot.


    Kind Regards!

  • Hi,

    either predefine the maps plugin xml structure, but with an empty url and set the url later when needed (like the vtourskin.xml does), or just set all (or only parts) dynamically:

    Code
    addplugin(map);
    set(plugin[map].url, 'googlemap.js');
    ...
    set(plugin[map].controls, 'zoom');
    set(plugin[map].radar.visible, true);
    ...

    Best regards,
    Klaus

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!