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

Overpass generator string now includes version number #30

Closed
mmd-osm opened this issue Nov 13, 2017 · 2 comments
Closed

Overpass generator string now includes version number #30

mmd-osm opened this issue Nov 13, 2017 · 2 comments

Comments

@mmd-osm
Copy link

mmd-osm commented Nov 13, 2017

Recently, a version number was added to the generator string, e.g. <osm version="0.6" generator="Overpass API 0.7.54.12 054bb0bb">. Unfortunately, this change breaks Achavi. The following patch should fix it:

diff --git a/js/FormatRegistry.js b/js/FormatRegistry.js
index 59c350c..1c534b2 100644
--- a/js/FormatRegistry.js
+++ b/js/FormatRegistry.js
@@ -36,7 +36,7 @@ FormatRegistry.prototype.getFormatType = function(doc) {
     // special cases with common root node name but different content 
     if (type === 'osm') {
         var generatorAttribute = doc.documentElement.getAttribute('generator');
-        if (generatorAttribute && generatorAttribute === 'Overpass API') {
+        if (generatorAttribute && generatorAttribute.indexOf('Overpass API') == 0) {
             type = 'osmDiff';
         } else {
             var node = doc.documentElement.firstChild
@HolgerJeromin
Copy link
Contributor

startsWith does not work with Internet Explorer. So i would suggest indexOf

@mmd-osm
Copy link
Author

mmd-osm commented Nov 14, 2017

@HolgerJeromin : good point, patch updated accordingly.

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

No branches or pull requests

2 participants