【发布时间】:2015-03-23 22:35:11
【问题描述】:
我正在开发我开发的应用程序的前端,并希望从此处显示的 Google StreetView 嵌入中删除控件:
function displayGoogleSV(address_str) {
var geocoder = new google.maps.Geocoder();
var myStreetView = null;
var marker = null;
var address = address_str;
geocoder.geocode({
'address': address
}, function (results, status) {
//alert (results);
if (status == google.maps.GeocoderStatus.OK) {
//alert(results[0].geometry.location);
myStreetView = new google.maps.StreetViewPanorama(document.getElementById("streetview"));
myStreetView.setPosition(results[0].geometry.location);
google.maps.event.addListenerOnce(myStreetView, 'status_changed', function () {
var heading = google.maps.geometry.spherical.computeHeading(myStreetView.getLocation().latLng, results[0].geometry.location);
myStreetView.setPov({
heading: heading,
pitch: 0
});
我会在哪里看到这里看到的控件:https://developers.google.com/maps/documentation/javascript/examples/streetview-controls
谢谢!
【问题讨论】:
-
如果您仔细查看链接的代码,您会发现它们设置了
linksControl: false, panControl: false,。你试过吗? 提示:myStreetView.setOptions(...); -
我看到了我需要实现的代码,我只是不确定我需要将它粘贴到我的应用程序的 javascript 中的哪个位置。
标签: javascript api google-street-view