-
Notifications
You must be signed in to change notification settings - Fork 0
Usage
Rainiery Valerio edited this page May 8, 2024
·
9 revisions
leaflet-x is quite flexible and was developed thinking about most of the needs that may arise when working with maps. Here are some of the inputs and modules:
| Decorator | Name | Type | Description |
|---|---|---|---|
| @Input | defaultInitMapCoords | L.LatLngExpression | Default render map coordinate |
| @Input | defaultZoomLevel | Number | Set the default zoom to see in the rendered map |
| @Input | featureCollectionInput | GeoJsonResult | This @Input receives an object of type GeoJsonResult, which is nothing more than the structure of a FeatureCollection or a GeoJson, you could say that it is the same structure of a drawing object that is already exported in GeoJson format. You can see such an object if you draw a figure and export it with the export file module and export a GeoJson of the drawing. |
| @Input | prefix | String | This will write a footer on the map, it is often used to put @copyright messages. |
| @Input | watermarkImagePath | String | This @Input receives a path (preferably from the assets folder) in which you can call an image you have in that folder, to draw the image on the map (preferably an image with transparency). |
| @Input | readonly | Boolean | Enable or disable the toolbar utility to draw or not. |
| @Input | mainColor | #{string} | Set this input if you want to set a shape color. Blue shape color is default, but you can set a custom color, eg: #ffcc66 |
| @Output | featureCollectionOutput | GeoJsonResult | This is part of I/O mainstream, emits every action made in the map |
<leaflet-x prefix="@Copyright give me a star in GH" watermarkImagePath="assets/exampleImage.png" mainColor="#00ff00" (featureCollectionOutput)="watchFeatureCollectionOutput($event)"></leaflet-x>
Give me a ⭐️ if you like this project.