Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Raruto committed Nov 20, 2018
2 parents 2b8003e + 01c99bd commit 331b19e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions leaflet-pegman.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,15 @@ L.Control.Pegman = L.Control.extend({
this._googleStreetViewLayer = L.tileLayer('https://{s}.googleapis.com/vt?lyrs=svv&style=40,18&x={x}&y={y}&z={z}', {
attribution: 'Map data: &copy; <a href="https://www.google.com/intl/en/help/terms_maps.html">Google</a>',
subdomains: ['mts1', 'mts2', 'mts3'],
pane: "overlayPane",
});
this._mouseTileTracker = new this.MouseTileTracker(this._map);
} else {
// @link https://gitlab.com/IvanSanchez/Leaflet.GridLayer.GoogleMutant
// GoogleMutant SHOULD PROVIDE a ToS compliant way of loading Google Map's tiles into Leaflet
this._googleStreetViewLayer = L.gridLayer.googleMutant({
attribution: 'Map data: &copy; <a href="https://www.google.com/intl/en/help/terms_maps.html">Google</a>',
pane: "overlayPane",
//type: null, // (illegal?) workaround used to force a transparent background using null maptype_id
type: "roadmap",
styles: [{
Expand Down Expand Up @@ -122,6 +124,7 @@ L.Control.Pegman = L.Control.extend({

this._pegmanMarker.on("dragend", this.onPegmanMarkerDragged, this);
this._map.on("click", this.onMapClick, this);
this._map.on("layeradd", this.onMapLayerAdd, this);

google.maps.event.addListener(this._panorama, 'closeclick', L.bind(this.onStreetViewPanoramaClose, this));

Expand Down Expand Up @@ -299,6 +302,10 @@ L.Control.Pegman = L.Control.extend({
this.findStreetViewData(e.latlng.lat, e.latlng.lng);
},

onMapLayerAdd: function(e) {
this._googleStreetViewLayer.bringToFront();
},

onStreetViewPanoramaClose: function() {
this.clear();
},
Expand Down

0 comments on commit 331b19e

Please sign in to comment.