Sie sind nicht angemeldet.

1

Montag, 20. Dezember 2021, 18:55

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!

2

Dienstag, 21. Dezember 2021, 12:10

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:

Quellcode

1
2
3
4
5
6
addplugin(map);
set(plugin[map].url, 'googlemap.js');
...
set(plugin[map].controls, 'zoom');
set(plugin[map].radar.visible, true);
...


Best regards,
Klaus

3

Dienstag, 21. Dezember 2021, 15:07

Thank you, Klaus!