Use 3D View Google Map in Leaflet plugin
Asked Answered
P

2

1

I Use Leaflet Map Plugin. i Write this code for create and load google map tiles in 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);

this code work fine. But I Want Load another google Map option in this plugin Like 3D View map enter image description here

But will this be done? thanks for help me.

Penton answered 6/12, 2016 at 10:16 Comment(0)
D
4

Two things:

  1. Loading map tiles from Google using just a L.TileLayer contravenes the terms&conditions of Google Maps (the part about "accessing the content only through the Google Maps API"). Do not be surprised if Google gets angry at that.

    As pointed out in the answers to the question «Leaflet Map API with Google Satellite Layer» , look in the Leaflet plugins list. In particular, GoogleMutant might be of interest.

  2. As of now, Leaflet is able to display 2D maps only. There are no plans to make it display oblique imagery, or provide tilt capabilities.

    If you need these features, you might want to have a look at other web mapping libraries, such as https://www.mapbox.com/mapbox-gl-js/api/ or https://cesiumjs.org/. These can handle more degrees of camera freedom, and some degree of terrain elevation display.

Dachia answered 6/12, 2016 at 10:58 Comment(0)
M
-2

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

pls see the source code of it , as

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); 

may it help

Maximomaximum answered 30/9, 2020 at 8:56 Comment(1)
jquery makes any code completely unreadable, avoid, it's over, it's been obsolete for over 10 years nowTegular

© 2022 - 2024 — McMap. All rights reserved.