为什么谷歌地图会在几个帖子后面冻结页面

时间:2011-05-23 03:37:09

标签: c# javascript asp.net google-maps updatepanel

我遇到了最奇怪的问题。我无法弄清楚为什么我正在建设的网站上的谷歌地图在大约5或6个帖子后面慢慢冻结页面。我目前正在更新面板中使用日历,后面和下一个按钮会导致谷歌地图做出奇怪的事情。我删除了更新面板,它仍然做同样的事情。大约3次点击后,标记图标开始减慢模糊,最终变黑。它让我疯了。任何想法都会非常有用。谢谢。指向具有问题的页面的链接是http://adkrenter.com/properties/106-plum-poppy-north,它在ie和firefox中都可以。

1 个答案:

答案 0 :(得分:2)

您的根本问题是,每次点击PrevNext时,您都会将之前标记数量的3倍添加到同一位置的地图上。

我无法告诉你为什么这种情况正在发生(或如何解决)而没有看到更多的代码(这很痛苦地浏览页面源代码,所以如果你可以为你发布一些相关的代码“点击即可,这可能会有所帮助”

<强>更新

我在大约7-10次点击之后查看了响应并且它是一个巨大的(相对来说,初始响应只有KB的几十个)168 KB其中143 KB是用于向两个添加相同标记的JavaScript代码页面上的地图 - 每次162次!难怪页面冻结了。

这是回复的一部分:

var GoogleMap1 = new Artem.Web.GoogleMap({"Address":"106 Plum Poppy North, Malta , NY, 12020","BaseCountryCode":null,"ClientID":"ctl05_GoogleMap1","ClientMapID":"GoogleMap1","DefaultAddress":null,"DefaultMapView":0,"Directions":[],"EnableContinuousZoom":false,"EnableDoubleClickZoom":false,"EnableDragging":true,"EnableGoogleBar":false,"EnableInfoWindow":true,"EnableMarkerManager":false,"EnableReverseGeocoding":false,"EnableScrollWheelZoom":false,"EnterpriseKey":null,"Height":"130px","IsStreetView":false,"IsStatic":false,"Key":"ABQIAAAATFt6mjpmHxeLQ689NDV5WhTHwM4h-1LWnzPqjMrWYJQMyFF86hTACw-YJNmRQV0Dk4jcB3zQHvdUsw","Latitude":42.968839,"Longitude":-73.777681,"MapEvents":{},"MarkerEvents":{},"MarkerManagerOptions":{"borderPadding":null,"maxZoom":null,"trackMarkers":null},"PolygonEvents":{},"PolylineEvents":{},"ShowMapTypeControl":false,"ShowScaleControl":false,"ShowTraffic":false,"StreetViewMode":0,"StreetViewPanoID":null,"Width":"190px","Zoom":14,"ZoomPanType":0});
GoogleMap1.addMarker({"Address":"106 Plum Poppy North, Malta , NY, 12020","AutoPan":true,"Bouncy":false,"Clickable":true,"Draggable":false,"DragCrossMove":false,"IconAnchor":{"X":0,"Y":0},"IconSize":{"Height":0,"Width":0},"IconUrl":null,"InfoWindowAnchor":{"X":0,"Y":0},"Latitude":42.968839,"Longitude":-73.777681,"MaxZoom":null,"MinZoom":null,"OpenInfoBehaviour":0,"ShadowSize":{"Height":0,"Width":0},"ShadowUrl":null,"Text":null,"Title":null});
GoogleMap1.addMarker({"Address":"106 Plum Poppy North, Malta , NY, 12020","AutoPan":true,"Bouncy":false,"Clickable":true,"Draggable":false,"DragCrossMove":false,"IconAnchor":{"X":0,"Y":0},"IconSize":{"Height":0,"Width":0},"IconUrl":null,"InfoWindowAnchor":{"X":0,"Y":0},"Latitude":42.968839,"Longitude":-73.777681,"MaxZoom":null,"MinZoom":null,"OpenInfoBehaviour":0,"ShadowSize":{"Height":0,"Width":0},"ShadowUrl":null,"Text":null,"Title":null});
GoogleMap1.addMarker({"Address":"106 Plum Poppy North, Malta , NY, 12020","AutoPan":true,"Bouncy":false,"Clickable":true,"Draggable":false,"DragCrossMove":false,"IconAnchor":{"X":0,"Y":0},"IconSize":{"Height":0,"Width":0},"IconUrl":null,"InfoWindowAnchor":{"X":0,"Y":0},"Latitude":42.968839,"Longitude":-73.777681,"MaxZoom":null,"MinZoom":null,"OpenInfoBehaviour":0,"ShadowSize":{"Height":0,"Width":0},"ShadowUrl":null,"Text":null,"Title":null});
//repeated a few hundred times

GoogleMap2.addMarker({"Address":"106 Plum Poppy North, Malta , NY, 12020","AutoPan":true,"Bouncy":false,"Clickable":true,"Draggable":false,"DragCrossMove":false,"IconAnchor":{"X":0,"Y":0},"IconSize":{"Height":0,"Width":0},"IconUrl":null,"InfoWindowAnchor":{"X":0,"Y":0},"Latitude":42.968839,"Longitude":-73.777681,"MaxZoom":null,"MinZoom":null,"OpenInfoBehaviour":0,"ShadowSize":{"Height":0,"Width":0},"ShadowUrl":null,"Text":null,"Title":null});
GoogleMap2.addMarker({"Address":"106 Plum Poppy North, Malta , NY, 12020","AutoPan":true,"Bouncy":false,"Clickable":true,"Draggable":false,"DragCrossMove":false,"IconAnchor":{"X":0,"Y":0},"IconSize":{"Height":0,"Width":0},"IconUrl":null,"InfoWindowAnchor":{"X":0,"Y":0},"Latitude":42.968839,"Longitude":-73.777681,"MaxZoom":null,"MinZoom":null,"OpenInfoBehaviour":0,"ShadowSize":{"Height":0,"Width":0},"ShadowUrl":null,"Text":null,"Title":null});
GoogleMap2.addMarker({"Address":"106 Plum Poppy North, Malta , NY, 12020","AutoPan":true,"Bouncy":false,"Clickable":true,"Draggable":false,"DragCrossMove":false,"IconAnchor":{"X":0,"Y":0},"IconSize":{"Height":0,"Width":0},"IconUrl":null,"InfoWindowAnchor":{"X":0,"Y":0},"Latitude":42.968839,"Longitude":-73.777681,"MaxZoom":null,"MinZoom":null,"OpenInfoBehaviour":0,"ShadowSize":{"Height":0,"Width":0},"ShadowUrl":null,"Text":null,"Title":null});
GoogleMap2.addMarker({"Address":"106 Plum Poppy North, Malta , NY, 12020","AutoPan":true,"Bouncy":false,"Clickable":true,"Draggable":false,"DragCrossMove":false,"IconAnchor":{"X":0,"Y":0},"IconSize":{"Height":0,"Width":0},"IconUrl":null,"InfoWindowAnchor":{"X":0,"Y":0},"Latitude":42.968839,"Longitude":-73.777681,"MaxZoom":null,"MinZoom":null,"OpenInfoBehaviour":0,"ShadowSize":{"Height":0,"Width":0},"ShadowUrl":null,"Text":null,"Title":null});
GoogleMap2.addMarker({"Address":"106 Plum Poppy North, Malta , NY, 12020","AutoPan":true,"Bouncy":false,"Clickable":true,"Draggable":false,"DragCrossMove":false,"IconAnchor":{"X":0,"Y":0},"IconSize":{"Height":0,"Width":0},"IconUrl":null,"InfoWindowAnchor":{"X":0,"Y":0},"Latitude":42.968839,"Longitude":-73.777681,"MaxZoom":null,"MinZoom":null,"OpenInfoBehaviour":0,"ShadowSize":{"Height":0,"Width":0},"ShadowUrl":null,"Text":null,"Title":null});
//repeated a few hundred times

GoogleMap2.load();

我不熟悉.NET和C#所以除了这个之外我真的无法帮助,因为我不知道这个'更新面板'是如何工作的。但似乎问题在于服务器 - 它正在发回相同的标记,其计数似乎在几何上增长 - 标记的输入数量是之前标记数量的3倍。