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

support for WMS #54

Open
pktrigg opened this issue May 27, 2018 · 12 comments
Open

support for WMS #54

pktrigg opened this issue May 27, 2018 · 12 comments

Comments

@pktrigg
Copy link

pktrigg commented May 27, 2018

Evening

just wondering if your leaflet plugin for WP supports a reference to a WMS (Web Map Service)?

regards
pk

@bozdoz
Copy link
Owner

bozdoz commented May 28, 2018

Nope, but it looks like I should add this!

https://leafletjs.com/examples/wms/wms.html

Thanks for the heads up!

@bozdoz bozdoz added the Feature label May 28, 2018
@pktrigg
Copy link
Author

pktrigg commented May 28, 2018

indeed. Many thanks for getting back to me. I am still trying to sort this one out. I tried out OSM without luck.
I prefer Leaflet anyhow.

are you active on this project?

cheers
pk

@bozdoz
Copy link
Owner

bozdoz commented May 28, 2018

I'm on and off, depending on when I find an issue I'd find easy or worthwhile to tackle. This one seems like it could be easy, but I'm unsure at the moment how I would implement it. Would you expect a WMS to be alone on a map, or be on top of a basemap?

@bozdoz bozdoz added priority Helps maintainer decide which issues to work on and removed priority Helps maintainer decide which issues to work on labels Sep 18, 2018
@bozdoz
Copy link
Owner

bozdoz commented Sep 25, 2018

Think I'm going to have to bump this again. I'm still unsure of how to implement this. I'm thinking it could be similar in nature to the layer control issue: #43

I'm not sure how easy it would be to do something like that though. I might need to stop assuming one basemap, stop assuming it would be openstreetmap, for example... I was thinking adding a name attribute to all shortcodes, to identify them in a layer control:

[leaflet-map]
[leaflet-layer name="OSM" src="osm.org/{x}/{y}/{z}"]
[leaflet-wms name="Another basemap" src="./wms/src/"]
[leaflet-marker name="Home"]
[leaflet-geojson name="Anonymous shapes" src="github.com/geo.json"]

Another idea might be to nest shortcodes, but I haven't had much experience trying something like that. Maybe another shortcode which gathers previously named layers:

[leaflet-control basemaps="OSM, Another basemap" layers="Home, Anonymous shapes"]

I'm not sure how easy that is to do with basemaps still, assuming we will typically force a default basemap.

@jmarchand-jive
Copy link

That would be an awesome addition to the plugin.

One way I would see it would be to have a base/overlay parameter to each layer, which could control in which group they show up in the Layer Control... The name parameter would be the label in the Layer Control and the Type would decide whether they show up in either the base group or the overlays...

[leaflet-map]
[leaflet-layer name="OSM" type="base" src="osm.org/{x}/{y}/{z}"]
[leaflet-wms name="Another basemap" type="base" src="./wms/src/"]
[leaflet-marker name="Home" type="overlay"]
[leaflet-geojson name="Anonymous shapes" type="overlay" src="github.com/geo.json"]

@bozdoz
Copy link
Owner

bozdoz commented Nov 6, 2018

Just thinking specific to this issue, it may make more sense to add an attribute to the map to omit the basemap, then add the WMS layers/any other:

[leaflet-map noBasemap]
[leaflet-wms src="./wms/src/"]

I'm merely assuming that the basemap might be an issue. I should think about solving the base/overlay control issue separately (#43)

@jmarchand-jive
Copy link

Yes, that might work. But, at least in my case, I would ideally have 2-3 wms containing different informations and would like the user to be able to toggle between one and the others (while keeping the overlays - geojson files - visible).

I understand that it might not be possible now, but would be awesome to have!

@arteteco
Copy link

arteteco commented Dec 5, 2020

This would be an awesome addition, any news?

@bozdoz
Copy link
Owner

bozdoz commented Dec 8, 2020

What is your use case @arteteco ? Trying to get a feel as to what is needed before beginning anything.

@arteteco
Copy link

arteteco commented Dec 11, 2020

Hi @bozdoz , I could imagine 2 scenarios for me: in one, I have a map that I serve via WMS and I want a front end to show it. In another I may want to collect WMSs relevant to data I already have, so that users can easily overlay them.

For example, I may have a collection of points where a certain plant was found, and I'd like to overlay the geological map or the protected areas map in WMS

WMS layers should be another kind of layer in the layers panel.

Hope I made myself clear on what my use case would be, I think it's pretty common and would be useful to many I reckon.

All the best, thanks!

@bozdoz
Copy link
Owner

bozdoz commented Dec 11, 2020

So a layer control panel would be necessary? Also, would there be a base map? I think I'm mostly concerned about WMS layers as basemaps. If they are just overlays over top of a basemap, then that seems easy. My main concern is how to make it flexible enough to do both.

@arteteco
Copy link

arteteco commented Dec 11, 2020

Yes, my use case would be WMS as layer. Maybe we could make it so that for every WMS added we can choose if consider it a basemap or a layer?

EDIT: WMS also oftentimes give a lot of information, especially the legend should be very important to display. Seems like leaflet doesn't support it, so I'm not entirely sure if it's doable without a sort of a hack

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants