[英]Static map with encoded polygon not displaying
I'm having a difficult time figuring out why this static map isn't displaying.. I'm using encoded lines and polygons. 我很难弄清楚为什么不显示此静态地图。.我正在使用编码的线和多边形。 The lines display ok but not the polygon.
线显示确定,但多边形显示不出来。 I put the encoded polygon string into google's Interactive decoder and it works fine.
我将编码的多边形字符串放入Google的Interactive解码器中 ,并且工作正常。
Encoded Polygon 编码多边形
wl}vFlm{zN?gNfKIM}L|h@OSlB`Bj@l@h@nEGD{D|CNXrO`CHDdFaCHMxCkKNGgNyX{@?zOk^
This url is: 这个网址是:
http://maps.googleapis.com/maps/api/staticmap?size=400x400&path=weight:3|color:0x000000|enc:a||vFze|zN|E}cA&path=weight:3|color:0x000000|enc:qj{vFny{zNyTaO}QtWoE|W&path=weight:3|fillcolor:0x0000FF|color:0x0000FF|enc:wl}vFlm{zN?gNfKIM}L|h@OSlB`Bj@l@h@nEGD{D|CNXrO`CHDdFaCHMxCkKNGgNyX{@?zOk^&maptype=hybrid&sensor=false
I also tried url encoding the polygon string with no luck. 我也尝试用URL编码多边形字符串而没有运气。
http://maps.googleapis.com/maps/api/staticmap?size=400x400&path=weight:3|color:0x000000|enc:a%7C%7CvFze%7CzN%7CE%7DcA&path=weight:3|color:0x000000|enc:qj%7BvFny%7BzNyTaO%7DQtWoE%7CW&path=weight:3|fillcolor:0x0000FF|color:0x0000FF|enc:wl%7DvFlm%7BzN%3FgNfKIM%7DL%7Ch%40OSlB%60Bj%40l%40h%40nEGD%7BD%7CCNXrO%60CHDdFaCHMxCkKNGgNyX%7B%40%3FzOk%5E&maptype=hybrid&sensor=false
They were encoded using: 它们使用以下方式编码:
points_array = mapOverlays[i].getPath();
enc = google.maps.geometry.encoding.encodePath(points_array);
Was hoping someone more knowledgeable than I could spot why this isn't displaying for me. 希望有人比我能发现的更多知识,为什么这对我不显示。
It seems that there is something missing in the encoded path, when I decode the path and then encode the path again there is a additional @-sign at the end(it will also be added when I use the interactive encoder). 似乎在编码的路径中缺少一些内容,当我解码路径然后再次对路径进行编码时,末尾会有一个附加的@符号(当我使用交互式编码器时也会添加它)。
With the @ the polygon will be loaded: http://maps.googleapis.com/maps/api/staticmap?size=400x400&path=weight:3|color:0x000000|enc:a%7C%7CvFze%7CzN%7CE%7DcA&path=weight:3|color:0x000000|enc:qj%7BvFny%7BzNyTaO%7DQtWoE%7CW&path=weight:3|fillcolor:0x0000FF|color:0x0000FF|enc:wl%7DvFlm%7BzN%3FgNfKIM%7DL%7Ch%40OSlB%60Bj%40l%40h%40nEGD%7BD%7CCNXrO%60CHDdFaCHMxCkKNGgNyX%7B%40%3FzOk%5E%40&maptype=hybrid&sensor=false 使用@会加载多边形: http : //maps.googleapis.com/maps/api/staticmap?size=400x400&path= weight:3| color : 0x000000| enc:a% 7C%7CvFze%7CzN%7CE%7DcA&path =重:3 |颜色:0x000000处| ENC:QJ%7BvFny%7BzNyTaO%7DQtWoE%7CW&路径=重量:3 |填充颜色:0x0000FF |颜色:0x0000FF | ENC:WL%7DvFlm%7BzN%3FgNfKIM%7DL%7CH%40OSlB%60Bj %40升%40H%40nEGD%7BD%7CCNXrO%60CHDdFaCHMxCkKNGgNyX%7B%40%3FzOk%5E%40&地图类型=混合&传感器=假
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.