OSM.router.route("/note/new");
});
- function createNote(marker, form, url) {
+ function createNote(marker, text, url) {
var location = marker.getLatLng().wrap();
marker.options.draggable = false;
data: {
lat: location.lat,
lon: location.lng,
- text: $(form.text).val()
+ text
},
success: function (feature) {
noteCreated(feature, marker);
}
content.find("input[type=submit]").on("click", function (e) {
+ const text = content.find("textarea").val();
+
e.preventDefault();
$(this).prop("disabled", true);
- createNote(newNoteMarker, e.target.form, "/api/0.6/notes.json");
+ createNote(newNoteMarker, text, "/api/0.6/notes.json");
});
return map.getState();