Skip to content

Commit

Permalink
leaflet draw zoom after click cond
Browse files Browse the repository at this point in the history
  • Loading branch information
joelclems committed Jan 21, 2020
1 parent 02055d7 commit f03d502
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,9 @@ export class LeafletDrawComponent implements OnInit, OnChanges {
console.log(geojson);
layer = L.marker(new L.LatLng(geojson.coordinates[1], geojson.coordinates[0]), {});
this.mapservice.leafletDrawFeatureGroup.addLayer(layer);
// this.map.setView(layer.getLatLng(), 15);
if (this.bZoomOnPoint) {
this.map.setView(layer.getLatLng(), 15);
}
}
if (geojson.type === 'Point') {
const latLng = L.GeoJSON.coordsToLatLng(geojson.coordinates);
Expand Down

0 comments on commit f03d502

Please sign in to comment.