Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for #1239 add public gps tiles layer for debugging purposes #1406

Closed
wants to merge 4 commits into from

Conversation

IOOI-SqAR
Copy link
Contributor

this pull request adds a checkbox in the debug area of the layers selection to show public GPS traces overlayed to the map. This comes in handy in sparsely mapped areas where GPS tracks might exist but no mapping has been done yet.
screenshot

@IOOI-SqAR
Copy link
Contributor Author

this fixes #1239

subdomains: 'abc'
}
});

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a vendored library this needs to be patched upstream (at https://github.com/jfirebaugh/leaflet-osm) first.

That rule basically applies to anything under the vendor directory - you can look in Vendorfile to see where they come from.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I basically create a new pull request with https://github.com/jfirebaugh/leaflet-osm first and remove that part here then?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@derickr well that builds on this - they're two components of the same things although I agree the split is a bit arbitrary.

@IOOI-SqAR open the upstream PR but there's not need to remove it here as we still need it, we just don't want out version diverging from upstream.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have just created openstreetmap/leaflet-osm#15

@@ -2211,6 +2211,7 @@ en:
header: Map Layers
notes: Map Notes
data: Map Data
gps: GPS
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think something like "Public GPS Traces" would be a better label here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@@ -176,6 +176,7 @@ L.OSM.layers = function(options) {

addOverlay(map.noteLayer, 'notes', OSM.MAX_NOTE_REQUEST_AREA);
addOverlay(map.dataLayer, 'data', OSM.MAX_REQUEST_AREA);
addOverlay(map.gpsLayer, 'gps', OSM.MAX_REQUEST_AREA);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We either need to pass a larger value for the second argument here (because I think the GPS tiles don't have a limit) or we need to add javascripts.site.map_gps_zoom_in_tooltip to the resources.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using Number.POSITIVE_INFINITY for the second argument is probably best I suspect.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

this.gpsLayer = new L.OSM.GPS({
attribution: copyright,
code: "G",
keyid: "gps",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only base layers need keyid as there is no support for showing keys for overlays.

The code member is fine, but it needs code adding at https://github.com/openstreetmap/openstreetmap-website/blob/master/app/assets/javascripts/index.js#L160 to actually add the layer if that code is present when the page is loaded.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just one question: is the attribution key needed here? If I add it (as it currently is) I see the copyright twice one I check that box

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question and I believe the answer is no, because attribution is only shown for base layers.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

jfirebaugh pushed a commit to openstreetmap/leaflet-osm that referenced this pull request Jan 4, 2017
@IOOI-SqAR
Copy link
Contributor Author

openstreetmap/leaflet-osm#15 is now merged

@tomhughes tomhughes closed this in df17b99 Jan 4, 2017
@talllguy
Copy link

talllguy commented Jan 4, 2017

Thanks for adding. This looks great. 💯
chrome_2017-01-04_14-46-28

@polarbearing
Copy link
Contributor

polarbearing commented Jan 4, 2017

I don't get the tiles delivered:
https://b.gps-tile.openstreetmap.org/lines/16/35185/21489.png

b.gps-tile.openstreetmap.org uses an invalid security certificate. 
The certificate is only valid for *.tile.openstreetmap.org

Naturally with this problem, it works when I call the site via plain-http.

@talllguy
Copy link

talllguy commented Jan 4, 2017 via email

@tomhughes
Copy link
Member

Yes that was the wrong URL to use for https support - should be fixed in 757ef87.

@polarbearing
Copy link
Contributor

confirmed, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants