Click here to Skip to main content
15,850,685 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,
I have a map in my ASP.NET page. My map is refreshed every 2 minutes automatically.When a user make zoom level from 6 to 13, if time goes 2 munites, then map is refreshed again and zoom level goes the first level 6.
I want to retain the zoom level. When map is refreshed after 2 minutes later,zoom level should be 13.
How Can I do this friends?

Please help me.
Thanks in Advance.
Posted
Updated 7-Jun-11 2:55am
v2

I take it you're talking of google maps and the their API and that you are refreshing the map from javascript.

  1. Read the current zoom level with map.getZoom() where map is a GMap2 javascript object.
  2. Write the zoom level to a GMap2 map object using map.setZoom().
  3. Alternatively you can append a parameter to the map URL. The parameter that conrols the zoom level is z


Hope that helps!

-MRB
 
Share this answer
 
Comments
Abhinav S 5-Jun-11 8:26am    
Saw your solution. Yes, my 5.
nacves6 5-Jun-11 9:14am    
Your opinion is very good, but I don't know how can I apply. I use googleMapSubgurim. And the I don't have map.getZoom(), map.setZoom()and Map URL property. I only have these properties; addKeyDragZoom enableDoubleClickZoom enableHookMouseWheelToZoom getBoundsZoomLevel resetKeyDragZoom ZoomEnd How can I use parameter? Can you write some codes please?
I guess you need to build some logic to zoom into the map after it refreshes.
Maybe you could store the zoom level somewhere temporarily, and then zoom to this temporary level once the map reloads.
 
Share this answer
 
Comments
Manfred Rudolf Bihy 5-Jun-11 8:18am    
More or less what I had in mind with my solution. 5+
nacves6 5-Jun-11 9:17am    
Your opinion is perfect, but have can I get a current zoom level?
use googleMapSubgurim.I only have these properties; addKeyDragZoom enableDoubleClickZoom enableHookMouseWheelToZoom getBoundsZoomLevel resetKeyDragZoom ZoomEnd How can I use parameter? Can you write some codes about getting current zoom level please?
Why don't you fetch yourself help where you got this control?
Please refer to this site for information: http://en.googlemaps.subgurim.net/ejemplos/ejemplo_200_Zoom.aspx[^].

Best of luck!

Cheers!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900