谷歌地图Subgurim - 多边形不工作了 [英] Google Maps Subgurim - Polygons are not working anymore

查看:559
本文介绍了谷歌地图Subgurim - 多边形不工作了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发基于ASP.NET和谷歌地图Subgurim一个Geolocalisation应用程序。

I'm developing a Geolocalisation application based on ASP.NET and Google Maps Subgurim .

不过,由于今天早上,在我的应用程序停止显示多边形。

However , since this morning , the Polygons on my application stop showing .

我想这是我的code,直到我看到的多边形和官方网站不工作自理。

I thought it was my code , until i saw that the polygons and the official website are not working themself .

多边形官方示例
有没有人一个想法,为什么它采空?甚至一个解决方案?我不知道如何联系Subgurim ...

Official Example of Polygon Has anyone an idea why it stoped ? Or even a solution ? I don't know how to contact Subgurim ...

(另外,如果你检查页面subgurim控制的JavaScript返回此错误
未捕获InvalidValueError:在索引0:不是经纬度或LatLngLiteral:物业纬度:不是一个数字)

( Also if you inspect page with subgurim control , the javascript return this error "Uncaught InvalidValueError: at index 0: not a LatLng or LatLngLiteral: in property lat: not a number")

编辑:我已经改变了所有的GPolygon到用于GPolyline,它工作正常。但是,这是不可能的,填补了用于GPolyline他们只能弥补通过显示一个区域的轮廓。

EDIT : I've changed all the "GPolygon" to "GPolyline" , it works fine . But it will be impossible to fill the GPolyLine they can only make up by showing the contours of an area .

推荐答案

它有今天的东西用JavaScript数组定义。

It has something today with the Javascript array definition.

当你调用GMap1.Add(),你会发现,polygon.ToString()导致[在最终的JavaScript。

When you call GMap1.Add() you will notice that the polygon.ToString() causes a [[ in the resulting Javascript.

更换[[与[将解决您的问题。

Replacing the [[ with a [ will solve your issue.

如果您使用的是添加过载接受你需要改变你的code了一下,利用自定义JavaScript超载多边形。

If you are using the Add overload accepting a polygon you will need to change your code a bit, to make use of the custom Javascript overload.

要重现在 HTTP坐落在其网站上的第一个多边形例如:/ /en.googlemaps.subgurim.net/ejemplos/ejemplo_94100_Pol%C3%ADgonos.aspx 的大意如下的东西就可以了:

To reproduce the first polygon example located on their website at http://en.googlemaps.subgurim.net/ejemplos/ejemplo_94100_Pol%C3%ADgonos.aspx something along the following lines will do:

GLatLng latlng = new GLatLng( 46, 21 );
GMap1.setCenter( latlng, 4 );
List<GLatLng> puntos = new List<GLatLng>();
puntos.Add( latlng + new GLatLng( 0, 8 ) );
puntos.Add( latlng + new GLatLng( -0.5, 4.2 ) );
puntos.Add( latlng );
puntos.Add( latlng + new GLatLng( 3.5, -4 ) );
puntos.Add( latlng + new GLatLng( 4.79, +2.6 ) );
GPolygon poligono = new GPolygon( puntos, "557799", 3, 0.5, "237464", 0.5 );
poligono.close();

var objJs = new StringBuilder();
objJs.Append("function addborder" + 0 + "()");
objJs.Append("{");
objJs.Append( poligono.ToString( GMap1.GMap_Id ) );
objJs.Replace("clickable:False", "clickable:false");//  ' Replace incorrect False statement
objJs.Append("}");

GMap1.Add( "addborder" + 0 + "();", true );
var objString = objJs.ToString();
var newstring = objString.Replace( "[[", "[" ).Replace( "]]", "]" );
GMap1.Add( newstring );

这篇关于谷歌地图Subgurim - 多边形不工作了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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