1

我使用传单地图插件。我编写此代码以在 LeafLet 中创建和加载谷歌地图图块

 var map = L.map('map').setView([31.2744015, 48.7251283], 18);

    // load a tile layer

    //Satellite:
    L.tileLayer('http://{s}.google.com/vt/lyrs=s&x={x}&y={y}&z={z}', {
        maxZoom: 20,
        mapTypeId: google.maps.MapTypeId.SATELLITE,
        subdomains: ['mt0', 'mt1', 'mt2', 'mt3']
    }).addTo(map);

此代码工作正常。But I Want Load another google Map option in this plugin Like 3D View map 在此处输入图像描述

但这会完成吗?谢谢你的帮助。

4

2 回答 2

4

两件事情:

  1. 仅使用 a 从 Google 加载地图图块L.TileLayer违反了 Google Maps 的条款和条件(关于“仅通过Google Maps API访问内容”的部分)。如果 Google 对此感到愤怒,请不要感到惊讶。

    正如问题« Leaflet Map API with Google Satellite Layer » 的答案中指出的那样,请查看Leaflet 插件列表。特别是,GoogleMutant可能会引起人们的兴趣。

  2. 目前,Leaflet 只能显示 2D地图。没有计划让它显示倾斜图像或提供倾斜功能。

    如果您需要这些功能,您可能需要查看其他 Web 地图库,例如https://www.mapbox.com/mapbox-gl-js/api/https://cesiumjs.org/。这些可以处理更多的相机自由度,以及一定程度的地形高程显示。

于 2016-12-06T10:58:02.113 回答
0

https://labs.mapbox.com/bites/00093/

请看它的源代码,如

window.setInterval(function(){
        $('.rotating').attr('style','-webkit-transform:rotateZ('+angle+'deg);-moz-transform:rotateZ('+angle+'deg);-moz-transition:-moz-transform 0.75s;');
        if ($('.rotating').length>0) $('.pivotmarker').attr('style','-webkit-transform: rotateY('+angle+'deg);-moz-transform: rotateY('+angle+'deg);-moz-transition:-moz-transform 0.75s;');
        angle=angle*-1;
    },1500); 

有帮助吗

于 2020-09-30T08:56:46.860 回答