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

Add kml and geojson support to gpx layer #3811

Merged
merged 1 commit into from
Feb 2, 2017

Conversation

mertemin
Copy link
Contributor

@mertemin mertemin commented Feb 1, 2017

After @bhousel's comment on #3808 I updated existing gpx layer, added ability to read in .kml and .geojson files based on file extension.

@mertemin mertemin changed the title Add geojson data layer Add geojson data layer supporting gpx, kml and geojson Feb 1, 2017
@mertemin mertemin changed the title Add geojson data layer supporting gpx, kml and geojson Add kml and geojson support to gpx layer Feb 1, 2017
@bhousel
Copy link
Member

bhousel commented Feb 2, 2017

Awesome! Yes this is what I had in mind 👍 I'll try it out tonight or tomorrow...

@bhousel bhousel merged commit 7b17145 into openstreetmap:master Feb 2, 2017
@bhousel
Copy link
Member

bhousel commented Feb 2, 2017

Works perfectly! Just merged, thanks again!

@@ -139,7 +166,8 @@ export function svgGpx(projection, context, dispatch) {
drawGpx.url = function(url) {
d3.text(url, function(err, data) {
if (!err) {
drawGpx.geojson(toGeoJSON.gpx(toDom(data)));
var extension = getExtension(url);
Copy link
Member

Choose a reason for hiding this comment

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

FYI: this caused #3820 since url is just a string and getExtension() expects a File object. I fixed it by changing getExtension() to expect a string instead.

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.

3 participants