繁体   English   中英

如何停止刷新Google地图?

[英]How to stop refresh Google maps?

aspx :code:    
        <asp:Timer ID="Timer1" runat="server" OnTick="Timer1_Tick">
        </asp:Timer>
        <div id="map">
        <cc1:GMap ID="GMap1" runat="server" />
        </div>            
    C# cod:    
    protected void Timer1_Tick(object sender, EventArgs e)
    {
     GMap1.resetMarkers(); 
     Subgurim.Controles.GLatLng gLatLng = new  Subgurim.Controles.GLatLng(Convert.ToDouble(status.Rows[0][0]), Convert.ToDouble(status.Rows[0][1]));
     GMap1.setCenter(gLatLng, 16, Subgurim.Controles.GMapType.GTypes.Normal);
     Subgurim.Controles.GMarker oMarker = new Subgurim.Controles.GMarker(gLatLng);
     GMap1.addGMarker(oMarker);
  }                

每40秒GMap就会刷新一次。 我想在不刷新GMap的情况下在GMap上设置新的经纬度。 我如何在Gmap上设置这个新点或标记

断开计算机与互联网的连接

对不起,队友,必须这样做:D:D:D

// Enable the visual refresh
google.maps.visualRefresh = true;

var map;
function initialize() {
  var mapOptions = {
    zoom: 8,
    center: new google.maps.LatLng(-34.397, 150.644),
    mapTypeId: google.maps.MapTypeId.ROADMAP
  };
  map = new google.maps.Map(document.getElementById('map-canvas'),
      mapOptions);
}

google.maps.event.addDomListener(window, 'load', initialize);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM