Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Google Maps - let user choose zoomlevel

Hi, working with the standard Google Maps Scatter Chart setup (no extensions). Works fine. Tried to let users change the zoomlevel with a slider (var_zoom from 1 to 17). Works, but not quite. After user interaction I've lost the 'autozooming' since var_zoom now is a fixed number. Tried using a button to reset to the original formula (works) but zooming stays less stable then. Any examples on this?

Regards, Zach

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Attached.

I applied action to the text box.  Also applied the same action "on any select".  Created macro for demo purpose, but didn't use it here, actions are more reliable.

As for the setting 5 by default - I can suggest to modify the var_zoom expression.  For example, add -1 at the end of the expression in action.  See the second text box.

(You can notice that the dynamic image expression has changed.  No more key among other changes.)

View solution in original post

4 Replies
Anonymous
Not applicable
Author

Zach,

I'm using macro which is triggered on any select (you can use something else), and sets var_zoom to it's original expression:

sub Autozoom

     ActiveDocument.Variables("var_zoom").SetContent "=<expression>", true

end sub

Regards,

Michael


Not applicable
Author

Hi, could you show me in the attached sample. Only add your Google Maps Key and it should be a running example. Can't figure out how to get it right in terms of zooming in and out by users and not messing up the basic functionality. The example .qvw first gets the long/lat for 3 locations and then displays them in the standard scatter. Slider-zoom is working but I need to get back to original behaviour (without reloading). Another issue here is that the map starts out at zoom level 6 with these locations, but I would want it to start in 5; then showing all three and not only two (missing Germany). Thanks, Zach.

Anonymous
Not applicable
Author

Attached.

I applied action to the text box.  Also applied the same action "on any select".  Created macro for demo purpose, but didn't use it here, actions are more reliable.

As for the setting 5 by default - I can suggest to modify the var_zoom expression.  For example, add -1 at the end of the expression in action.  See the second text box.

(You can notice that the dynamic image expression has changed.  No more key among other changes.)

Not applicable
Author

Hi, Thank you for your help and editing the qvw. This is great! Thx, Zach