Page MenuHomePhabricator

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


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


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 }


Event Timeline

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.
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: patch-welcome.
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:

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

We use a library for maps:

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°.