保持缩放水平 [英] retaining the zoom level

查看:77
本文介绍了保持缩放水平的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我的ASP.NET页面中有一张地图.我的地图每2分钟自动刷新一次.当用户将缩放级别从6更改为13时,如果时间达到2毫秒,则地图会再次刷新,并且缩放级别达到第6级.
我要保留缩放级别. 2分钟后刷新地图时,缩放比例应为13.
我该怎么做这个朋友?

请帮帮我.
在此先感谢.

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.

推荐答案

我认为您正在谈论Google地图及其API,并且您正在从javascript刷新地图.
I take it you''re talking of google maps and the their API and that you are refreshing the map from javascript.

  1. 使用map.getZoom()读取当前缩放级别,其中map是GMap2 javascript对象.
  2. 使用map.setZoom()将缩放级别写入GMap2地图对象.
  3. 或者,您可以将参数附加到地图URL.控制缩放级别的参数是z

  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



希望对您有所帮助!

-MRB



Hope that helps!

-MRB


我想您需要构建一些逻辑以在刷新 后放大地图.
也许您可以将缩放级别临时存储在某个地方,然后在重新加载地图后缩放到该临时级别.
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.


为什么在获取此控件的地方不获取帮助?
请访问此网站以获取信息: http://en.googlemaps.subgurim.net/ejemplos/ejemplo_200_Zoom.aspx [^ ].

祝你好运!

干杯!
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!


这篇关于保持缩放水平的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆