Leaflet in google maps

后端 未结 3 1375
滥情空心
滥情空心 2020-12-18 04:12

Can we use leaflet in google maps? Searching and reading articles about it, we found that there are some leaflet plugins available. Using that we can build application using

3条回答
  •  臣服心动
    2020-12-18 04:36

    You can use leaflet JS API kit and use google maps imagery in it.

    Edit:

    Check this example in which google tiles/imagery is used along leaflet kit.

    var map = new L.Map(
      'map', 
      {
        center: new L.LatLng(51.51, -0.11), 
        zoom: 9
      }
    );
    
    var googleLayer = new L.Google('ROADMAP');
    
    map.addLayer(googleLayer);
    #map {
      height: 500px;
      width: 500px;
    }
    
    
    
    
    

    Source: https://gist.github.com/crofty/2197701

提交回复
热议问题