MapComplete icon indicating copy to clipboard operation
MapComplete copied to clipboard

Make a map layer showing the community index

Open pietervdvn opened this issue 2 years ago • 9 comments

It would be nice if the OSM-community-index would be shown into MapComplete as well.

This should be done by creating a new map layer which loads the geojson externally. Ideal issue to get started with the repo.

pietervdvn avatar Oct 07 '22 12:10 pietervdvn

Hey, I would like to get familiar with the repo with this. Where do you think the toggle layer button should be added? Next to the satellite view maybe?

Nadhum avatar Oct 07 '22 16:10 Nadhum

Awesome!

First of all, giving such a prominent button to the community index is too prominent for a relatively minor feature.

I would start out with creating a (read only) layer and corresponding theme to consult the OSM community index.

In other words: first steps are probably to create a 'community_index.json' layer in assets/layers/community_index and a corresponding theme in assets/themes/community_index. The theme will only be a small stub, similar to the drinking water theme.

(Edit: having a map like this is already a really good PR)

pietervdvn avatar Oct 07 '22 16:10 pietervdvn

Once that the data is in MC, we should think about the right time and place to show this to new contributors in other themes as well.

pietervdvn avatar Oct 07 '22 16:10 pietervdvn

Got it! I'll start working on it

Nadhum avatar Oct 07 '22 18:10 Nadhum

Thanks for the awesome work already!

A test version is deployed on https://pietervdvn.github.io/mc/develop/osm_community_index.htm

I did spot some small issues though

  • maybe we should reverse the logic for the filters: checking a filter (e.g. country) will only show the country-level areas, but checking another (e.g. region) will hide all. There is a flag to enable a filter by default, so we could instead ley people uncheck what they don't need.
  • I had it often that I wanted to click a polygon, but the 'world'-polygon was clicked instead. Perhaps we can hide that one and use the special rendering 'steal' to include the global links in every popup?
  • If we are really ambitious, we can detect embedding polygons and steal their info to, to make a recursive list of links.
  • the minimap is broken for polugons such as London. I'll debug that when I do have some time for it.

In any case, I really appreciate the work you did! It is a nice addition which'll flow to the production version in any case.

pietervdvn avatar Oct 09 '22 10:10 pietervdvn

Another possible improvement: Adding the name of the selected community in the info panel. Something like…

Ways to connect to the OSM Community "NAME" LIST

Reference


For the layout, you could use something like https://play.tailwindcss.com/h0wvIRbhme inspired by https://tailwindui.com/components/application-ui/lists/stacked-lists

<ul class="divide-y divide-gray-200">
  <li class="py-5">
    <a href="#" class="block group focus-within:ring-2 focus-within:ring-indigo-600 focus:outline-none">
      <h3 class="text-sm font-semibold text-gray-800 group-hover:underline">OpenStreetMap World Discord</h3>
      <p class="mt-1 text-sm text-gray-600">Get in touch with other mappers on Discord</p>
    </a>
  </li>
  <li class="py-5">
    <a href="#" class="block group focus-within:ring-2 focus-within:ring-indigo-600 focus:outline-none">
      <h3 class="text-sm font-semibold text-gray-800 group-hover:underline">OpenStreetMap World Discord</h3>
      <p class="mt-1 text-sm text-gray-600">Get in touch with other mappers on Discord</p>
    </a>
  </li>
  <li class="py-5">
    <a href="#" class="block group focus-within:ring-2 focus-within:ring-indigo-600 focus:outline-none">
      <h3 class="text-sm font-semibold text-gray-800 group-hover:underline">OpenStreetMap World Discord</h3>
      <p class="mt-1 text-sm text-gray-600">Get in touch with other mappers on Discord</p>
    </a>
  </li>
</ul>

tordans avatar Oct 09 '22 12:10 tordans

Cool thanks for feedback, I also had some thoughts around how to improve it similar to your suggestions.

Another possible improvement: Adding the name of the selected community in the info panel. Something like…

Ways to connect to the OSM Community "NAME" LIST

Reference

Do you mean the info panel title by "adding the name to the info panel" because the current format of the info panel is

Community NAME
     Description

If we are really ambitious, we can detect embedding polygons and steal their info to, to make a recursive list of links.

Is there something we can leverage for this already or there is no straight forward way for the moment?

the minimap is broken for polygons such as London. I'll debug that when I do have some time for it.

Yeah noticed that especially with "the other communities" polygons they seem all broken

Nadhum avatar Oct 09 '22 16:10 Nadhum

Yeah noticed that especially with "the other communities" polygons they seem all broken

As it turns out, the minimap tries to interpret lists as lists with ID's to show multiple values. Now, the OSM-community-index has some values around a coordinate, such as [0.12,3.45], hence the many failing minimaps.

I deployed a fix that the key id is never interpreted as a list anymore.

pietervdvn avatar Oct 10 '22 19:10 pietervdvn

If we are really ambitious, we can detect embedding polygons and steal their info to, to make a recursive list of links.

Is there something we can leverage for this already or there is no straight forward way for the moment?

Somewhat. With steal you can grab a tagRendering from another object - if you know the ID of this object.

That can be calculated with a calculated tag - as you already used. This can be done with enclosingFeatures, e.g. "calculatedTags" : ["_encosing_feature_ids=feat.enclosingFeatures('osm_community_index').map(f => f.properties.id)" (or something in this line - not tested)

pietervdvn avatar Oct 10 '22 23:10 pietervdvn

wouldn't it be nice to be able to add the theme's from the community index also into the layer pane (with checkboxes)? E.g. I have the restaurant theme open and I'd like to see the cafe's and Pub's theme on the same map. So I'd checkmark the cafe's and pub's theme and get the POI's into the same map as restaurants. Maybe it also make's sense to show open toilet theme or the hotel theme on the same map as Restaurants. Other combinations may also make sense, like playgrounds and toilets or fries shops, fast food and parking theme. Just as a few examples of many I could envision. Of course that could result in many POI's shown on the map, but maybe there are ways to deal with that. I.e. limit the number of POI's shown on a map (concentrating mulitple POI's into one depending on zoom level).

hermann-san avatar Apr 13 '23 09:04 hermann-san

@hermann-san This issue is specifically about a dataset which contains contact information for the local OSM-communities.

To mix and match, the personal theme contains all layers.

pietervdvn avatar Apr 13 '23 11:04 pietervdvn

Furthermore, as the community index has a separate map and a special, inviting view, I feel that this issue is completed.

pietervdvn avatar Apr 13 '23 11:04 pietervdvn

@pietervdvn Awesome, thanks!

hermann-san avatar Apr 13 '23 16:04 hermann-san