Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to set the zoom size of the cluster marker map. Please urgent help!!

Hi,

I have a Google Maps for Marker clustering. How can I set the zoom size of the map. Because every time I used to scroll the mouse to see the markers. Please can anyone suggest me. I changed in the script.js file but it seems there is no changes affecting in the map.

Thanks.

24 Replies
Not applicable
Author

Can anyone help me please

Anonymous
Not applicable
Author

Hi Amelia

I use a variable

=max(aggr(if(max( round(256*pow(2,(_zoom_level -1)))+([longitude > 0]*((256*pow(2,_zoom_level ))/360)) )-min( round(256*pow(2,(_zoom_level -1)))+([longitude > 0] *((256*pow(2,_zoom_level ))/360)) ) <map_size_x AND max((256*pow(2,(_zoom_level-1)))+((0.5*log((1+(sin(([latitude > 0])*pi()/180)))/(1-(sin(([latitude > 0])*pi()/180)))))*((-256*pow(2,_zoom_level))/(2*pi()))))-min((256*pow(2,(_zoom_level-1)))+((0.5*log((1+(sin(([latitude > 0])*pi()/180)))/(1-(sin(([latitude > 0])*pi()/180)))))*((-256*pow(2,_zoom_level))/(2*pi()))))<map_size_y,_zoom_level,1),_zoom_level))'

Where Latitude >0 and Longitude >0 are our database fields

Not sure if this helps but it works for our documents.

Not applicable
Author

Thanks. Where I need to create this variable in qvw? could please let me know.

Anonymous
Not applicable
Author

In the script editor with the code that defines your map variables

magavi_framsteg
Partner - Creator III
Partner - Creator III

So....

What happens if the variable, for whatever reason, gets lost?

Which can happen from time to time.

Make it a rule without exceptions to:

- Never declare variables in the variable editor.

- Always declare variables in the script editor.

Anonymous
Not applicable
Author

I personally have never had an issue with varible getting lost, and have variables that have been declared in both variable and script editor but for ones that will not change such as the above the script editor makes more sense.

Alexander_Thor
Employee
Employee

The extension will automatically zoom to fit the available markers.

If you don't want that behavior you would have to edit the script.js file and set your own zoomlevel and centers and remove the latlngbounds logic.

Not applicable
Author

Thanks very much. I tried to change the script but there is no change in the zoom level. moreover when I am refreshing it is showing an error which is in attached. Please could help me a this is very urgent for me priority task. I have tried in many ways but no luck for me. Please suggest me.

Not applicable
Author

Please could help me to know why it is showing that error.