问题描述
我使用Subgurim的StaticGMap控件.我已经使用Subgurim的StaticPath()方法在地图上定义了3个静态点.我在静态路径变量上使用以下参数.
Hi,
Iam using Subgurim''s StaticGMap control. I have defined 3 static points on the map using Subgurim''s StaticPath() method. I use below params on static path variable.
path.colorNet = Color.Black;<br />
path.weight = 3;<br />
path.alpha = 150;
地图显示正常,没有问题.但是,当多次调用同一方法(页面在提交按钮时重新加载)时,路径权重会自动增加,此后,我将丢失地图图像,而只会丢失一条消息-"Google通过Subgurim对ASP.NET的Google地图控件"http://googlemaps.subgurim.net"显示在页面上.有人遇到过这个问题吗?我试图在调用方法之前清除点/处理掉静态地图控件,但是没有代码通过subgurim做到这一点.
完整代码如下-
The map displays fine without issues. However when the same method is called multiple times (when the page reloads on submit of a button),the path weight increases by itself and after that I lose the map image instead only a message - "Google maps control for ASP.NET by Subgurim. http://googlemaps.subgurim.net " is displayed on page. Has anyone come across this issue? I attempted to clear the points/dispose off the static map control before calling the method but there is no code to do this through subgurim.
Full code is below -
private void plotPoints()
{
GLatLng latLng = new GLatLng(-38, 176);
StaticGMap1.GCenter = latLng;
StaticGMap1.GZoom = 6;
path = new StaticPath();
path.points.Clear();
path.colorNet = Color.Black;
path.weight = 3;
path.alpha = 150;
StaticGMarker.ColorEnum color = (StaticGMarker.ColorEnum)3;
StaticGMarker.SizeEnum size = (StaticGMarker.SizeEnum)2;
path.points.Add(new GLatLng(-41.360319, 174.781494));
path.points.Add(new GLatLng(-40.9301, 175.6714));
path.points.Add(new GLatLng(-40.346544, 175.627441));
StaticGMap1.addStaticPath(path);
}
protected void Page_Load(object sender, EventArgs e)
{
plotPoints();
}
OP更新:
他下面的解决方案有效.
重定向到相同页面或不同页面会卸载控件.
UPDATE from OP:
he below solution works.
Redirecting to the same page or a different page unloads the control.
推荐答案
这篇关于[已解决] Subgurim静态路径错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!