-
Notifications
You must be signed in to change notification settings - Fork 36
Open
Description
When I load a map and there is a polygon in it, the map automatically centers on the polygon. How can I prevent this?
My code:
Map::make('location')
->label('Ubicación en mapa')
->columnSpanFull()
->defaultLocation(
-36.721273880045004,
-56.66748046875001
)
->afterStateHydrated(function (?array $state, ?object $record, Set $set): void {
$lat = $state['lat'] ?? $record?->latitude ?? -36.721273880045004;
$lng = $state['lng'] ?? $record?->longitude ?? -56.66748046875001;
$geojson = $state['geojson'] ?? $record?->geojson ?? null;
$set('location', [
'lat' => (float) $lat,
'lng' => (float) $lng,
'geojson' => json_decode(strip_tags($geojson))
]);
})
->extraAttributes([
'style' => 'min-height: 50vw; border-radius: 10px;'
])
->showMarker()
->markerColor('#fbbf24')
->liveLocation(true, false, 5000)
->showFullscreenControl()
->geoMan(true)
->geoManEditable(true)
->dragMode()
->editPolygon()
->deleteLayer()
->drawPolygon()
->drawMarker(false)
->drawText(false)
->drawCircle(false)
->drawCircleMarker(false)
->drawPolyline(false)
->geoManPosition('topright')
->showZoomControl()
->draggable(true)
->clickable(true)
->tilesUrl('https://mt1.google.com/vt/lyrs=y&x={x}&y={y}&z={z}')
->zoom(15),Metadata
Metadata
Assignees
Labels
No labels