问题
I am using leaflet in my project for displaying objects and elements in map (Open source map). I have drawn some objects in my map using Geojson
styles
While using Geojson
with the leaflet js implementation I am not able to use getBounds
option properties.
But normally if I am not using Geojson
and its features I am able to use this option getBounds
mentioned below.
var group = new L.featureGroup([marker, circle, polygon, rectangle]);
//alert(group);
map.fitBounds(group.getBounds());
My set view code:
var map = L.map('map').setView([39.75621, -104.99404], 13);
Whenever a page loaded it should find the objects and draw elements (trace components) and adjust its Zooming.
Jsfiddle
来源:https://stackoverflow.com/questions/23380886/adjusting-the-drawn-object-in-map-automatically-using-leaflet-geojson-property