You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

bg360

Trainee

  • "bg360" started this thread

Posts: 120

Location: Bulgaria

  • Send private message

1

Monday, December 20th 2021, 6:55pm

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

Tuesday, December 21st 2021, 12:10pm

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:

Source code

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

bg360

Trainee

  • "bg360" started this thread

Posts: 120

Location: Bulgaria

  • Send private message

3

Tuesday, December 21st 2021, 3:07pm

Thank you, Klaus!