Skip to content

Commit 3aca24d

Browse files
committed
fixed default map settings empty case issue #124
1 parent f1b7af4 commit 3aca24d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

assets/javascripts/app.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,17 @@ var App = (function ($, publ) {
5959
defaults = $("#ol-defaults").data();
6060
defaults.geocoderUrl = "https://***REMOVED***/geojson";
6161

62-
if (defaults.lon === null) {
62+
// Check if params are null or undefined (use "==" instead of "===" to detect both)
63+
if (defaults.lon == null) {
6364
defaults.lon = quick_hack.lon;
6465
}
65-
if (defaults.lat === null) {
66+
if (defaults.lat == null) {
6667
defaults.lat = quick_hack.lat;
6768
}
68-
if (defaults.zoom === null) {
69+
if (defaults.zoom == null) {
6970
defaults.zoom = quick_hack.zoom;
7071
}
71-
if (defaults.maxzoom === null) {
72+
if (defaults.maxzoom == null) {
7273
defaults.maxzoom = quick_hack.maxzoom;
7374
}
7475

0 commit comments

Comments
 (0)