-1

I am drawing a Leaflet map. I also want the ability to add the coordinates via a form. How is that done? leaflet map

  • Welcome to GIS SE. As a new user, please take the Tour. Coding questions need the relevant code snippet in the question itself (external links are less likely to be reviewed if not present in the question, and fail over time, irreparably harming the question) – Vince Dec 24 '18 at 18:07
0

https://leafletjs.com/reference-1.3.4.html#rectangle

Your fiddle shows 4 textboxes, just add a button to read the 2 coordinates, then create the polygon and add to the map.

// define rectangle geographical bounds
var bounds = [[54.559322, -5.767822], [56.1210604, -3.021240]];
// create an orange rectangle
L.rectangle(bounds, {color: "#ff7800", weight: 1}).addTo(map);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.