b2科目四模拟试题多少题驾考考爆了怎么补救
b2科目四模拟试题多少题 驾考考爆了怎么补救

谷歌手机地图google maps691_google地图_安装google maps(11)

电脑杂谈  发布时间:2017-05-05 01:04:31  来源:网络整理

此部分中的概念仅适用于google.maps.panoramio库中提供的地图项。默认情况下,系统在加载 Maps JavaScript API 时不会加载该库,您必须使用libraries引导程序参数进行明确指定。

使用 PanoramioLayer 对象

您可以使用PanoramioLayer对象将Panoramio中的照片添加为地图的图层。PanoramioLayer会在地图上将 Panoramio 中的照片图标(已加注地理位置标签)的图层呈现为一系列不同大小的照片图标。

要向您的地图添加PanoramioLayer,只需创建以下对象并设置其地图属性即可:

var panoramioLayer = new google.maps.panoramio.PanoramioLayer();
panoramioLayer.setMap(map);

以下示例显示了华盛顿州西雅图的 Panoramio 图层。您每点击一张照片,右侧面板中就会增加一个指向的 Panoramio 照片页的链接:

var fremont = new google.maps.LatLng(47.651743, -122.349243);
var mapOptions = {
  zoom: 16,
  center: fremont,
  mapTypeId: google.maps.MapTypeId.ROADMAP
};

var map = new google.maps.Map(
    document.getElementById("map_canvas"),
    mapOptions);

var panoramioLayer = new google.maps.panoramio.PanoramioLayer();

panoramioLayer.setMap(map);

google.maps.event.addListener(panoramioLayer, 'click', function(event) {
  var photoDiv = document.getElementById('photoPanel');
  var attribution = document.createTextNode(event.featureDetails.title + ": " + event.featureDetails.author);
  var br = document.createElement("br");
  var link = document.createElement("a");
  link.setAttribute("href", event.featureDetails.url);
  link.appendChild(attribution);
  photoDiv.appendChild(br);
  photoDiv.appendChild(link);
});
按标记或用户 ID 限制照片

您可以将要显示在PanoramioLayer上的照片组限制为与特定文本标记或特定用户相匹配的照片。

要仅显示与特定标记相匹配的照片,请对PanoramioLayer对象调用setTag()。系统会将图层更新为仅显示地图视口内与该标记相匹配的照片。要仅显示与特定用户相匹配的照片,请对PanoramioLayer对象调用setUserId()。


本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/shouji/article-45243-11.html

相关阅读
    发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

    • 周艺璇
      周艺璇

      既然在南海奈何不了他

    热点图片
    拼命载入中...