commit aba2a930f823bde218fe054b07ad80eec2f7a108
parent d3b6e8e076e131185a15852091545cc94bd6fb6e
Author: Sergey Orlov <wladimirych@gmail.com>
Date: Wed, 5 Aug 2020 00:18:19 +0200
search, links: allow any tld for OSM
Diffstat:
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/lib/leaflet.control.search/providers/links.js b/src/lib/leaflet.control.search/providers/links.js
@@ -195,7 +195,7 @@ const MapyCzUrl = {
const OpenStreetMapUrl = {
isOurUrl: function(url) {
- return Boolean(url.hostname.match(/\bopenstreetmap\.org$/u));
+ return Boolean(url.hostname.match(/\bopenstreetmap\./u));
},
getResults: function(url) {
diff --git a/test/test_search_links.js b/test/test_search_links.js
@@ -158,6 +158,10 @@ suite('LinksProvider - parsing valid links');
{title: 'Google map view', latlng: {lat: 50.1568257, lng: 16.754047}, zoom: 12},
],
],
+ [
+ 'http://openstreetmap.ru/?mapid=497235296#map=12/60.9426/29.849&layer=C',
+ [{title: 'OpenStreetMap view', latlng: {lat: 60.9426, lng: 29.849}, zoom: 12}],
+ ],
].forEach(function([query, expectedResults]) {
test(`Parse link ${query}`, async function() {
this.timeout(10000);