fitExtent doesn't work at the second time
maptalks's version and what browser you use?
v1.0.0-beta.7
Issue description
fitExtent doesn't work at the second time
Please provide a reproduction URL (on any jsfiddle like site)
`var map = new maptalks.Map('map', { center: [-0.113049, 51.498568], zoom: 14, baseLayer: new maptalks.TileLayer('base', { urlTemplate: 'https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png', subdomains: ['a', 'b', 'c', 'd'], attribution: '© OpenStreetMap contributors, © CARTO ' }), layers: [ new maptalks.VectorLayer('v') ] });
var center = map.getCenter(); var polygon = new maptalks.Polygon([ center.add(-0.005, 0.005), center.add(0.005, 0.005), center.add(0.005, -0.005), center.add(-0.005, -0.005) ], { symbol: { polygonFill: '#fff', polygonOpacity: 0.5 } }); map.getLayer('v').addGeometry(polygon);
function fitExtent() { // fit map's extent to polygon's // 0 is the zoom offset map.fitExtent(polygon.getExtent(), 0); map.setZoom(15); }`
https://user-images.githubusercontent.com/50706050/147749831-7e163c43-6aef-4496-918f-563dc8942873.mp4
https://codepen.io/pzd2937/pen/abLqaBj