[Leaflet JS Web Plugin] Sample implementation of map parameters?

Forge Component
(5)
Published on 14 May by Vincent Koning
5 votes
Published on 14 May by Vincent Koning

Hello,


This component looks promising.

Would you perhaps be able to provide a sample implementation of the parameters for the Leaflet webblock?

There seem to be many parameters obligatory, however no guideline or easy way to determine how to fill them.

Perhaps this could be posted here as a response, or released as an 'example' module in the application.


Many thanks

Hi Carina,

There is a demo application inside the component. I think that should answer your question.  I'm also working on a new version of the Leaflet component and am trying to get myself into this components team. So far no luck. 

I will release mine in a few week as a separate component should my attempts fails. This version has less mandatory requirements for initialization (only height is a requirement) and has a lot of server actions to add data to the map.


Vincent Koning wrote:

Hi Carina,

There is a demo application inside the component. I think that should answer your question.  I'm also working on a new version of the Leaflet component and am trying to get myself into this components team. So far no luck. 

I will release mine in a few week as a separate component should my attempts fails. This version has less mandatory requirements for initialization (only height is a requirement) and has a lot of server actions to add data to the map.


Hi Vincent,

Thank you for your swift response.

I installed the component today - it only contains a module with the webblock to implement elsewhere: 

I see no demo application for an end-user. Was that perhaps in an earlier release?

Regards,

Carina


Carina,

I checked and indeed, the demo is not there anymore. Without testing I think you can use the following values;

- Width: any number
- Height: any number
- UseDraw. Enabling Leafletdraw (demo: https://leaflet.github.io/Leaflet.draw/docs/examples/full.html)
- OsmUrl: the url of the tile provider. You can choose any of these (some require a apikey): https://leaflet-extras.github.io/leaflet-providers/preview/.  I would use this as a start: https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png
- MaxZoom: Is tied to the selected tile provider. My recommended provider value would be 19
- Attibution: Additional text in the lower right corner. I would use "..." myself as a start
- Version: I would leave this blank. Not really sure why this is needed
- Latitude: The point on which the map centers after load
- Longitude: The point on which the map centers after load
- Zoom: Initial zoom value. Can be between 0 and the MaxZoom
- MarkerList: An array of markers on the map that you want to have after load. The structure tells you what you need to provide. 

I hope this helps you a bit. 

Vincent,

Thank you very much, this is helpful!