]> git.openstreetmap.org Git - nominatim.git/blobdiff - website/js/nominatim-ui.js
responsive details-error page. Shared header and footer
[nominatim.git] / website / js / nominatim-ui.js
index bb4fa37786fbb85fe33911e4cc6e9671c96ffac0..b99def9a7eedbae47701445c6957e2c92110431d 100644 (file)
@@ -165,14 +165,18 @@ jQuery(document).on('ready', function(){
 
                var layerGroup = new L.layerGroup().addTo(map);
 
 
                var layerGroup = new L.layerGroup().addTo(map);
 
-
-               var outline = omnivore.wkt.parse(nominatim_result.outlinestring);
-               map.addLayer(outline);
-
                var circle = L.circleMarker([nominatim_result.lat,nominatim_result.lon], { radius: 10, weight: 2, fillColor: '#ff7800', color: 'blue', opacity: 0.75});
                map.addLayer(circle);
 
                var circle = L.circleMarker([nominatim_result.lat,nominatim_result.lon], { radius: 10, weight: 2, fillColor: '#ff7800', color: 'blue', opacity: 0.75});
                map.addLayer(circle);
 
-               map.fitBounds(outline.getBounds());
+               if ( nominatim_result.outlinestring ){
+                       var outline = omnivore.wkt.parse(nominatim_result.outlinestring);
+                       map.addLayer(outline);
+                       map.fitBounds(outline.getBounds());
+               } else {
+                       map.setView([nominatim_result.lat,nominatim_result.lon],10);
+               }
+
+
 
 });
 
 
 });