forked from symfony/ux
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Map] Second iteration, simplify configuration a lot, make Map/Marker…
…s/InfoWindow generic!
- Loading branch information
Showing
120 changed files
with
2,886 additions
and
3,024 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
vendor | ||
composer.lock | ||
.php_cs.cache | ||
.phpunit.result.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,29 @@ | ||
import { Controller } from '@hotwired/stimulus'; | ||
import 'leaflet/dist/leaflet.min.css'; | ||
import type { MarkerOptions } from 'leaflet'; | ||
type MarkerId = number; | ||
import type { MapOptions } from 'leaflet'; | ||
import type { MapView } from './map'; | ||
type LeafletOptions = Pick<MapOptions, 'center' | 'zoom'>; | ||
type AdditionalOptions = { | ||
tileLayer: { | ||
url: string; | ||
attribution: string; | ||
options: Record<string, unknown>; | ||
}; | ||
}; | ||
export default class extends Controller<HTMLElement> { | ||
static values: { | ||
view: ObjectConstructor; | ||
}; | ||
viewValue: { | ||
center: null | { | ||
lat: number; | ||
lng: number; | ||
}; | ||
zoom: number | null; | ||
tileLayer: { | ||
url: string; | ||
attribution: string; | ||
} & Record<string, unknown>; | ||
fitBoundsToMarkers: boolean; | ||
markers: Array<{ | ||
_id: MarkerId; | ||
position: { | ||
lat: number; | ||
lng: number; | ||
}; | ||
} & MarkerOptions>; | ||
popups: Array<{ | ||
_markerId: MarkerId | null; | ||
content: string; | ||
position: { | ||
lat: number; | ||
lng: number; | ||
}; | ||
opened: boolean; | ||
autoClose: boolean; | ||
}>; | ||
}; | ||
viewValue: MapView<LeafletOptions & AdditionalOptions>; | ||
private map; | ||
private markers; | ||
private popups; | ||
private infoWindows; | ||
connect(): void; | ||
private setupTileLayer; | ||
private createTileLayer; | ||
private createMarkers; | ||
private createMarker; | ||
private createInfoWindows; | ||
private createInfoWindow; | ||
private dispatchEvent; | ||
} | ||
export {}; |
Oops, something went wrong.