From da49d98cc6ca527594768d6dba24080bd84c1622 Mon Sep 17 00:00:00 2001 From: Abdullah Ghanem <3bdullah.ghanem@gmail.com> Date: Thu, 28 Mar 2024 05:04:45 +0200 Subject: [PATCH] Update index.ts --- resources/js/index.ts | 231 ++++++++++++++++++++++++------------------ 1 file changed, 130 insertions(+), 101 deletions(-) diff --git a/resources/js/index.ts b/resources/js/index.ts index 0ac44e5..7a94e60 100644 --- a/resources/js/index.ts +++ b/resources/js/index.ts @@ -1,111 +1,140 @@ -import Map from 'ol/Map' -import MousePosition from 'ol/control/MousePosition' -import OSM from 'ol/source/OSM' -import TileLayer from 'ol/layer/Tile' -import View from 'ol/View' -import { Coordinate, createStringXY } from 'ol/coordinate' -import { defaults as defaultControls } from 'ol/control' -import { Feature } from 'ol' -import { fromLonLat, ProjectionLike } from 'ol/proj' -import VectorSource from 'ol/source/Vector' -import VectorLayer from 'ol/layer/Vector' -import { Point } from 'ol/geom' -import Geocoder from 'ol-geocoder' -import { Icon, Style } from 'ol/style' +@php + use Filament\Support\Facades\FilamentView; - -class mPoint { - constructor(public view: View, public projection: ProjectionLike) { + $hasInlineLabel = $hasInlineLabel(); + $isConcealed = $isConcealed(); + $isDisabled = $isDisabled(); + $rows = $getRows(); + $shouldAutosize = $shouldAutosize(); + $statePath = $getStatePath(); + $startLat = $getLatitude(); + $startLon = $getLongitude(); + $zoom = $getZoom(); + $initialHeight = ($rows ?? 2) * 1.5 + 0.75; +@endphp + + + $hasInlineLabel, + ])> + {{ $getLabel() }} + - public onChange(callback: (lat: number, lon: number) => void) { - this.view.on('change', () => { - const [lon, lat] = this.getCoordinates() - callback(lat, lon) - }) - } + - public getCoordinates() { - return this.view.getCenter() - } +
+
+
- public setCoordinates(lat: number, lon: number) { - this.view.setCenter(fromLonLat([lon, lat], this.projection)) - } -} + +
+ + + + + + -function GetPointMap(id: string, lat: number = 0, lon: number = 0, zoom: number = 10) { - const projection = 'EPSG:4326' + +