Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added TileLayer.WMS feature #409

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Added TileLayer.WMS feature #409

wants to merge 6 commits into from

Conversation

jeannettestrand
Copy link

@jeannettestrand jeannettestrand commented Aug 31, 2018

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:

  • Added "map/leaflet/leaflet-src/layer/tile/TileLayer.WMS.js" to the build directives in VCO.StoryMap.js
  • Added a new property, wms_options: {}, to VCO.StoryMap class.
  • Added a case to the VCO.Map.Leaflet.js _createTileLayer() function to detect a wms map_type and execute TileLayer.WMS.js with the user's parameters

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.

@JoeGermuska
Copy link
Member

Wow, thanks! This has just recently been under discussion with some users on our tech support. We'll try to review this and merge it sooner than later. It looks like you've provided an example WMS URL in your PR, so hopefully that will let us see this in action. I feel like "options" is so generalized that it's hard to see how we'd work this into the "user-friendly" authoring interface, but even if this is something just for more expert users, it's a win...

@jeannettestrand
Copy link
Author

Wow, thanks! This has just recently been under discussion with some users on our tech support. We'll try to review this and merge it sooner than later. It looks like you've provided an example WMS URL in your PR, so hopefully that will let us see this in action. I feel like "options" is so generalized that it's hard to see how we'd work this into the "user-friendly" authoring interface, but even if this is something just for more expert users, it's a win...

The only issue with this is that the mini-map navigation element looks really terrible in some circumstances where the WMS provides a strange rendering at the zoom level used by the mini-map. I'd like to try and add an additional option in the storymap options object that would pull in a basic map from OSM or something like that.

Glad that this is useful! Thanks Joe!

@scott2b
Copy link
Member

scott2b commented Jun 3, 2022

I am trying to clean up old contributions that we never got around to merging. There have been some significant structural changes since this was originally submitted.

I don't really know anything about WMS layer functionality, but based on the discussion, this seems like a useful contribution? This PR has since fallen into conflict, so I'm wondering if this is still applicable functionality and if it would be too much trouble to ask for a rebase and general review of the functionality so we can move this forward?

@JoeGermuska JoeGermuska mentioned this pull request Jul 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants