在 Google API 上使用 LatLng 获取街景图像
Getting street view image with LatLng on Google API
我想获取一张来自 Google 街景视图的图像,其中包含 LatLng 信息。
https://developers.google.com/maps/documentation/javascript/
Google服务的文档里的内容我看了差不多,但是找不到我想要的选项。
还有什么可以参考的东西吗?
这里有一对来自 google sample1 的好例子
并且 sample2 这并不难构建一个合适的网页并包含所有相关信息作为一个良好的开端
示例 2 的代码
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Street View service</title>
<style>
html, body, #map-canvas {
height: 100%;
margin: 0;
padding: 0;
}
</style>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true"></script>
<script>
function initialize() {
var fenway = new google.maps.LatLng(42.345573, -71.098326);
var mapOptions = {
center: fenway,
zoom: 14
};
var map = new google.maps.Map(
document.getElementById('map-canvas'), mapOptions);
var panoramaOptions = {
position: fenway,
pov: {
heading: 34,
pitch: 10
}
};
var panorama = new google.maps.StreetViewPanorama(document.getElementById('pano'), panoramaOptions);
map.setStreetView(panorama);
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
</head>
<body>
<div id="map-canvas" style="width: 45%; height: 100%;float:left"></div>
<div id="pano" style="width: 45%; height: 100%;float:left"></div>
</body>
</html>
全部来自 google。
我想获取一张来自 Google 街景视图的图像,其中包含 LatLng 信息。
https://developers.google.com/maps/documentation/javascript/
Google服务的文档里的内容我看了差不多,但是找不到我想要的选项。
还有什么可以参考的东西吗?
这里有一对来自 google sample1 的好例子 并且 sample2 这并不难构建一个合适的网页并包含所有相关信息作为一个良好的开端
示例 2 的代码
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Street View service</title>
<style>
html, body, #map-canvas {
height: 100%;
margin: 0;
padding: 0;
}
</style>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true"></script>
<script>
function initialize() {
var fenway = new google.maps.LatLng(42.345573, -71.098326);
var mapOptions = {
center: fenway,
zoom: 14
};
var map = new google.maps.Map(
document.getElementById('map-canvas'), mapOptions);
var panoramaOptions = {
position: fenway,
pov: {
heading: 34,
pitch: 10
}
};
var panorama = new google.maps.StreetViewPanorama(document.getElementById('pano'), panoramaOptions);
map.setStreetView(panorama);
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
</head>
<body>
<div id="map-canvas" style="width: 45%; height: 100%;float:left"></div>
<div id="pano" style="width: 45%; height: 100%;float:left"></div>
</body>
</html>
全部来自 google。