Open RogueVortex opened 4 years ago
You can specify layers using the layers
parameter. Example: https://maps.extension.wiki/wiki/Leaflet_Maps_examples#Layers
Does that do what you want?
I mean a little different. I am making a request, for example {{#ask: [[Category: Events]] |? Coords |? TypeEvents | format = map | service = leaflet }} This way I get a map with a lot of marks. I would like to disable by filtering a number of labels on the map that are of the same type that are currently not of interest to me ...
You can use a more selective ask query: [[Category: Events]] [[SomeOtherRestriction]]
. Or do you want to do live filtering?
yes, live filtering using checkboxes, as made in leaflet https://leafletjs.com/examples/layers-control/ in the example, using the link, you can disable markers for the Cities group
Ok, now I understand: you where talking about the cities overlay
This is not currently possible. Would be nice to have though! If you have some funds available for development I could have a look.
Yes, I meant it. I can’t boast of a good income living in Ukraine, but still I wonder how much money is needed to arouse your interest in this task?
You should see the income of an open source contributor :D 100 EUR would do it, even though I barely break even with that. Like I said, this would be a nice feature.
I understand that this is not a lot of money, given the amount of work that has already been done and which is being carried out in the open source. I will try to support you at least a little in the near future, as I understand it is better to do this through sponsorship on git?
Sponsorship on GitHub is definitely welcome
@akuckartz I added a special tier for you ;)
@RogueVortex thank you :heart:
Ok, so what would this feature look like? Here is what comes to my mind:
{{#ask: [[Category: Cities]]
|? Coords
|? Continent
| format = leaflet
| layer property = Continent
}}
If the results of this query are
then the map would have a layer group named "Europe" with markers for Berlin and London, and one named "America" with a marker for New York.
Does that make sense? Any better approaches? @krabina you might also have some thoughts on this.
It’s quite logical, probably you should immediately think about the ability to apply different icons for labels to different layers
Implementation of marker icons could be done similarly: https://github.com/JeroenDeDauw/Maps/issues/621. That would be per marker though, not per Layer Group. Not clear how to do the latter nicely, ideas welcome.
Perhaps you should pay attention to how it is implemented here? https://www.semantic-mediawiki.org/wiki/Help:Filtered_format
I also found how interesting and possibly useful to me https://www.mediawiki.org/wiki/Extension:Semantic_Compound_Queries
Yeah Compound queries are quite similar to what we where talking about here. I'll get to documenting them properly on the Maps wiki soon.
After some thinking about the Layer Groups I've come to realize that they are not so simple to implement. At least not in a way they are a full citizen of Maps. They need special handing for a bunch of features such a marker clustering, ajaxquery and the visual editor. In an initial version these combinations could just be left not supported however.
How can this feature be combined with https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues/4611 ?
I'm not sure. Also unclear when and if this new faceted search will make it into SMW. And how it relates to the Filtered format, and to extensions adding visualizations to SMW. More a question for @mwjames since I have no idea what his plans here are and have not read through everything on the linked issue.
Hi, I was browsing the wiki that use the map extension (indicated on the expansion site), I came across such a solution, I'm not so strong in the code, but maybe this will give food for thought ?!
https://www.transit.wiki/Bay_Area_Rapid_Transit
P.S. using the link you can see the implementation of the filter, though through the widget ...
Finally got around to installing Semantic Compound Queries on the Maps wiki and creating an example: https://twitter.com/JeroenDeDauw/status/1265219491174244352
I haven’t put it into a working project yet, but used it on a local server, this is a useful thing, in the future I plan to add it to a working draft, but at the moment it does not solve the issue of disconnecting different marker groups assigned to a particular group in the request ...
If the below was supported, would it work for your usecase?
{{#compound_query:
[[Category:Cities]] [[Located in::Germany]] ; ?Coordinates ; layer=Germany
| [[Category:Cities]] [[Located in::Belgium]] ; ?Coordinates ; layer=Belgium
| [[Category:Cities]] [[Located in::!Germany]] [[Located in::!Belgium]] ; ?Coordinates
| format=map
}}
Both for the compound_query approach and the earlier suggested one (layer property = Continent
), markers end up in a specific layer group. But there is no way to customize those layer groups beyond their names. I imagine you might want to control if a layer group is shown by default or not. It's not obvious to me where such information would fit nicely.
I think if the labels of each set of query parameters find their class, then something can already be done with this, I think a good option
would the rest of the maps options work as well?
| format=map
| geojson=Europe
| zoom=9
|...
would the rest of the maps options work as well?
| format=map | geojson=Europe | zoom=9 |...
I just checked on the Maps version 7.19.0 - everything works
Hi, was it not possible to address the issue on the topic?
I have not looked into it yet.
I have not looked into it yet.
in any case, as far as I am allowed I'm trying to support you)
I'm interested in this feature as well. It has not been implemented, has it?
Not worked upon this, and personally no plans to do so in my free time, even if it is a cool feature
I'd be willing to give/collect some money for it as has been discussed before. Could that still change your interest? I just created a map of anthroposophic medicine in Berlin which is growing crowded (https://de.imedwiki.org/wiki/Anthroposophische_Medizin_in_Berlin). It is intended for a meeting of doctors and I could ask them if everyone chips in a bit. I'd like to support open source development and have a good opensource map extension to show diverse data. I like Maps so far.
So as far as I understand it, this feature request is basically about being able to filter items that are displayed on a map. While doing this with the leaflet function might be a good idea, we should also discuss the following:
There is another difference: both the filtered format and the leaflet layer groups rely on all data being loaded into the frontend. In very large maps, this can be a problem. SD has a different approach that is better suited for large data.
The SD topic is IMO not so important for this discussion: as it will be using the maps extension, it is just another alternative that you have.
When thinking about implementing layer groups in the maps extension, we might consider that this approach would be directly in "competition" with the filtered result format.
Maybe it would be an option to redesign the filtered result format in a way that is uses the maps extension. This way, implementing this feature (layer groups) might not be needed anymore or can be added later if still needed. Of course, I have no idea about the effort for both approaches.
Thank you for showing those different posibilities. I just tried fiddling with the existing maps capabilities and hide markers with javascript identified by their image files. This works for static situations but when things start moving like zooming or panning or unclustering new ones show up that can not easily be catched by a click event on a checkfield. I'm tempted to remove, hide or add markers using javascript and the leaflet map found in mapsLeafletList to hide/show also the hidden ones but it's a bit complicated to even get all existing markers.
Yeah that code got complicated with dynamic loading and especially with the clustering.
@JeroenDeDauw what is your opinion on the filtered format vs. filter feature in maps? Is there any chance we could "pug in" the maps extension in the filtered format?
Plugging things in sounds nice. Hard to tell what the best approach here is without significant investigation. Same for technical feasibility.
Good afternoon. There is a need to disable some groups of requested tags using #ask. Perhaps you have thoughts on how best to implement this. https://leafletjs.com/examples/layers-control/ Thank you very much for your great work!