- else
- {
- markerPosition = [mapSize.x / 2, mapSize.y];
- }
-
- var marker = L.marker(map.containerPointToLatLng(markerPosition), {
- icon: noteIcons["new"],
- opacity: 0.7,
- draggable: true
- });
-
- var popupContent = $(JST["templates/notes/new"]({ create_url: $(e.target).attr("href") }));
-
- popupContent.find("input[type=submit]").on("click", function (e) {
- e.preventDefault();
- createNote(marker, e.target.form, $(e.target).data("url"));
- });
-
- marker.addTo(noteLayer).bindPopup(popupContent[0], popupOptions()).openPopup();
-
- $(".leaflet-popup-close-button").on("click.close", function (e) {
- map.removeLayer(marker);
- });
-
- marker.on("dragend", function (e) {
- e.target.openPopup();
- });
- });
-});