Added TileLayer.WMS feature #409
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'm developing an application that uses StoryMapJS, but needed to also have access to the Leaflet WMS Layer functionality to generate custom StoryMapJS basemaps, so I extended the library to include a wms map type.
The changes I made aren't complex, and are as follows:
To use this feature:
During preparation of the JSON data object describing map configuration and slides, one would simply indicate map_type as a top-level field, as usual, but prepend the service URL with wms: . For example, this is a successful wms map_type value:
"map_type":"wms:https://nfi.nfis.org/mapserver/cgi-bin/nfis-kNN.cgi?"
To provide the wms options object to the service call, one would also indicate wms_options as a top level field. The value of this shall be formatted as per leaflet documentation. For example, the following is a successful wms_options object:
"wms_options" : { "layers":"kNN_DominantGenus_250m", "format":"image/png", "transparent":true}
I hope this is something that could be of use to the library, I am planning to include more leaflet features that would allow layer and base-map switching, and would love to contribute back to StoryMap anything successful I come up with!
Thanks for doing all the work needed to develop this library; it is a great resource and alternative to commercial story map software.