Page MenuHomePhabricator

Add styling options (properties) for GeoPoints
Closed, ResolvedPublic8 Estimated Story Points

Description

Following up on T300042 and based on the POC developed there, we want to allow properties for GeoPoints (example map with Geopoints + properties).

Possible properties

  • icon type marker-symbol (list of available icons)
  • color of the icon marker-color (hexadecimal color)
  • size marker-size (large, medium, small)

Implementation

Steps:

  • Set a fall back styling of markers when the user doesn't add any themselves.
  • Allow users to set a default styling of the markers outside of the sparql query, similar to geoshapes.
  • Allow users to to define properties for geopoints (e.g. title, description, maybe image) as part of the sparql query (the same way as for geoshapes: example output).

Open questions

  • UI/UX: What should be the default styling look like (see above for options)? The current one looks like this:

Screenshot from 2022-03-24 15-34-35.png (401×423 px, 225 KB)

How to tech review

Set enableGeopoints: true in the config.docker.yaml file.

Here are my test queries for geopoints and shapes:

<mapframe text="Churches in Jerusalem via sparql" width="300" height="300" zoom="5" longitude="31.77917" latitude="35.22361" align="center">
{
  "type": "ExternalData",
  "service": "geopoint",
  "query": "SELECT DISTINCT ?id ?geo (IF(?language = wd:Q56473, '#000080', IF(?language = wd:Q56469, '#008000', '#800000')) AS ?marker_color) WHERE { ?id wdt:P31 wd:Q193560; wdt:P625 ?geo; wdt:P2936 ?language.} LIMIT 2"
}
</mapframe>


<mapframe text="Geoshapes in Israel via sparql" width="300" height="300" zoom="5" longitude="31.77917" latitude="35.22361" align="center">
{
  "type": "ExternalData",
  "service": "geoshape",
  "query": "SELECT DISTINCT ?id (IF(?language = wd:Q56473, '#000080', IF(?language = wd:Q56469, '#008000', '#800000')) AS ?fill) WHERE {  ?id wdt:P31 wd:Q193560; wdt:P2936 ?language.} LIMIT 2",
  "properties": {
      "stroke": "#ffb100",
      "stroke-width": 6
   }
}
</mapframe>

Details

Related Changes in Gerrit:

Event Timeline

Here is the terminology used by the Wikidata Query Service: https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/Wikidata_Query_Help/Result_Views#Map. Note this was made up very ad-hoc back when it was implemented. When we can use the GeoJSON terminology we should definitely favor that! See https://docs.mapbox.com/help/tutorials/markers-js/#style-markers as well as the section about "popups" for that.

lilients_WMDE set the point value for this task to 8.Mar 3 2022, 9:26 AM

On hold until WMF geoshapes work winds down.

Change 763242 had a related patch set uploaded (by Svantje Lilienthal; author: Svantje Lilienthal):

[mediawiki/services/kartotherian@master] Geopoints via sparql

https://gerrit.wikimedia.org/r/763242

Change 763242 merged by jenkins-bot:

[mediawiki/services/kartotherian@master] Geopoints via sparql

https://gerrit.wikimedia.org/r/763242