Don't try and look at params.layers when it isn't set

This commit is contained in:
Tom Hughes 2013-07-19 12:12:58 +01:00
parent c8fb5ad24c
commit 5f95fb6b78

View file

@ -50,7 +50,10 @@ function initializeNotes(map) {
});
if (OSM.STATUS != 'api_offline' && OSM.STATUS != 'database_offline') {
if (params.notes || params.layers.indexOf('N') >= 0) map.addLayer(noteLayer);
if (params.notes || (params.layers && params.layers.indexOf('N')) >= 0) {
map.addLayer(noteLayer);
}
if (params.note) {
$.ajax({
url: "/api/" + OSM.API_VERSION + "/notes/" + params.note + ".json",