本文介绍了在Google Maps Streetview上绘制折线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Google Maps v3.exp上绘制一些标记和折线.

I'm drawing some Markers and Polylines on Google Maps v3.exp.

当我切换到StreetView时,标记在那里,折线没有.通过Google,SO和所有其他已知资源进行搜索,令人惊讶的是,对于这个特定问题,绝对没有任何提示.是否有人对这个问题有更深入的信息,还是希望在街景视图上显示一些道路信息叠加层?

When I switch to StreetView, the markers are there, Polylines are not. Searched over the Google, SO, and all other known resources, and surprisingly there are absolutely no hints whatever about this particular question. Does anyone have any deeper information about the issue or is it hopeless to display for example some road information overlay on Streetview?

关于不同主题的一点(尽管相关)-我在上下文中尝试的第二件事是使用THREE.js画布在Streetview上方使用线,使用Streetview Panorama Position/POV-在那碰到了更多的陌生人问题-确实无法以任何方式设置PerspectiveCamera设置以将Streetview影像与我的绘画对象相匹配.在第一级变焦中使用从45度到75度的增量FOV并没有取得很好的匹配,尽管它确实类似于我最后需要看到的正确结果.

A bit on different topic (although, related) - second thing I tried in the context was to use THREE.js canvas with lines above Streetview, using Streetview Panorama Position/POV - in there i bumped into more stranger problem - did not manage anyhow to set PerspectiveCamera settings to match Streetview imagery to my painted objects. Using FOV of increments from 45 to 75 degrees on first level zoom gave no good matches although it DOES resemble correct result I need to see at the end.

更新:为第一种情况创建的简单的JSFiddle .如您在切换到街景视图时所看到的,标记是可见的.不是简单的折线.

UPDATED: for first case created simple JSFiddle. As you can see when switching to Streetview, marker is visible. Simple Polyline is not.

<div id="map" style="width: 500px; height: 500px;" />
<script type="text/javascript">
var map = new google.maps.Map(
    document.getElementById('map'),
    {zoom: 18, center: new google.maps.LatLng(59.4372, 24.7453), mapTypeId: google.maps.MapTypeId.TERRAIN});

var marker = new google.maps.Marker({map: map, position: new google.maps.LatLng(59.4372, 24.7453)});

var polyline = new google.maps.Polyline({map: map, path: [
    new google.maps.LatLng(59.4372, 24.7453),
    new google.maps.LatLng(59.4572, 24.7553)
], strokeColor: '#ff0000', strokeWeight: 5});
</script>

推荐答案

街景视图不支持折线.

StreetView文档

街景视图中的叠加层

这篇关于在Google Maps Streetview上绘制折线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-11 04:21