- if (OSM.STATUS != 'api_offline' && OSM.STATUS != 'database_offline') {
- map.layersControl.addOverlay(noteLayer, I18n.t("browse.start_rjs.notes_layer_name"));
-
- if (params.layers) setMapLayers(params.layers);
- if (params.notes) map.addLayer(noteLayer);
-
- if (params.note) {
- $.ajax({
- url: "/api/" + OSM.API_VERSION + "/notes/" + params.note + ".json",
- success: function (feature) {
- var marker = updateMarker(notes[feature.properties.id], feature);
-
- notes[feature.properties.id] = marker;
-
- map.addLayer(noteLayer);
- marker.openPopup();
- }
- });
- }
- }
+ noteLayer.showNote = function(id) {
+ $.ajax({
+ url: "/api/" + OSM.API_VERSION + "/notes/" + id + ".json",
+ success: function (feature) {
+ var marker = updateMarker(notes[feature.properties.id], feature);
+ notes[feature.properties.id] = marker;
+ map.addLayer(noteLayer);
+ marker.openPopup();
+ }
+ });
+ };