[feature] provide mapview on across 180 longitude line, selection with wikibase:box
Open, NormalPublic

Description

The following bounding box stretches across 180 long. The wikibase:box correctly interprets the coordinates, but the map can't zoom on the area.

#defaultView:Map
SELECT * WHERE {

wd:Q47863 wdt:P625 ?SCloc . #Midway Atoll as NorthEast Point(-177.35 28.2)
wd:Q43296 wdt:P625 ?SJloc . #Wake Island as SouthWest Point(166.633333333 19.3)
SERVICE wikibase:box {
    ?place wdt:P625 ?location .
    bd:serviceParam wikibase:cornerNorthEast ?SCloc .
    bd:serviceParam wikibase:cornerSouthWest ?SJloc .
  }
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . ?place rdfs:label ?placeLabel }

}

https://query.wikidata.org/?#%23defaultView%3AMap%0ASELECT%20%2a%20WHERE%20%7B%0A%20%20wd%3AQ47863%20wdt%3AP625%20%3FSCloc%20.%20%23Midway%20Atoll%20as%20NorthEast%20Point%28-177.35%2028.2%29%0A%20%20wd%3AQ43296%20wdt%3AP625%20%3FSJloc%20.%20%23Wake%20Island%20as%20SouthWest%20Point%28166.633333333%2019.3%29%0A%20%20SERVICE%20wikibase%3Abox%20%7B%0A%20%20%20%20%20%20%3Fplace%20wdt%3AP625%20%3Flocation%20.%0A%20%20%20%20%20%20bd%3AserviceParam%20wikibase%3AcornerNorthEast%20%3FSCloc%20.%0A%20%20%20%20%20%20bd%3AserviceParam%20wikibase%3AcornerSouthWest%20%3FSJloc%20.%0A%20%20%20%20%7D%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22en%22%20.%20%3Fplace%20rdfs%3Alabel%20%3FplaceLabel%20%7D%0A%7D

Esc3300 created this task.Jul 9 2016, 5:24 AM
Restricted Application added subscribers: Zppix, Aklapper. · View Herald TranscriptJul 9 2016, 5:24 AM
Restricted Application added a project: Discovery. · View Herald TranscriptJul 9 2016, 5:24 AM
Esc3300 added a project: Maps.
MaxSem added a subscriber: MaxSem.

Please don't add unrelated projects.

Smalyshev triaged this task as Normal priority.Jul 22 2016, 12:08 AM
Smalyshev assigned this task to Jonas.
Smalyshev moved this task from Ready for work to GUI on the Wikidata-Query-Service board.
Jonas added a comment.EditedJul 22 2016, 8:44 AM

Sorry I don't understand the actual problem. Could you please provide steps to reproduce and a screenshot if possible?

I think the issue is that if the box crosses the 180/-180 longitude line, the points show on the different sides of the map - i.e. left and right borders - and if you move/zoom the map around so that the line would be in the center of the screen, only one half of points is displayed, and the other half goes off screen.

yes. Ideally the map would just focus on the area covered by the bounding box.

Jonas added a subscriber: aude.Aug 5 2016, 8:32 AM

I am not sure if we can solve this maybe @aude has an idea.

How does the zoom calculation currently work?

Esc3300 added a comment.EditedAug 5 2016, 1:02 PM

Maybe a manual option to center the map on 180° could do?

Starting from there points would be split between the left and right and focus determined as currently.

It might be interesting for APAC users in general.

Esc3300 added a comment.EditedAug 17 2016, 10:37 AM

What could work is the following:

If the zoom is for more than 270°, it could attempt to re-calculate it on a center with 180°.

If this leads to less than 270°, use the map centered on 180°.

Not sure if 270° is the ideal limit: it could be 330°, but it neededn't be 360°.

Jonas removed Jonas as the assignee of this task.Nov 16 2016, 8:31 AM
Jonas added a project: Need-volunteer.
Jonas added a subscriber: Jonas.
Jonas closed this task as Declined.May 3 2017, 10:42 AM

So it seems we cannot fix the issue, but you could report it to upstream: leafletjs.com

What prevents us from fixing this ?

Esc3300 reopened this task as Open.Jul 27 2017, 2:20 PM
Restricted Application added a subscriber: PokestarFan. · View Herald TranscriptJul 27 2017, 2:20 PM
Esc3300 renamed this task from [bug] mapview on Wikidata Query Service misaligned across 180 longitude line, selection with wikibase:box to [feature] provide mapview on across 180 longitude line, selection with wikibase:box.Jul 27 2017, 2:21 PM
Jonas added a comment.Jul 27 2017, 5:25 PM

We use a library for maps: leafletjs.com

Nikki added a subscriber: Nikki.Jul 27 2017, 6:05 PM

It is possible to manually adjust the coordinates to get the desired display using the same method I used for my locations in Fiji example, e.g. this query. Unfortunately I had to split it into two parts to stop it timing out so it's more complicated than it should be.

Why not provide an additional map view centred on 180° so that users can choose a Pacific-friendly style when it's a better fit for their query? That would be simple to implement because (as you can see above) if you provide Leaflet with coordinates ranging from 0° to 360°, it will map them from 0° to 360°.