Published unlisted
Edited
Aug 9, 2019
Insert cell
Insert cell
Insert cell
Insert cell
Changed in fork
-
viewof inputCoordinates = text({ title: "Location", description: "Submit XY (Longitude/Latitude) coordinates for location as 'X,Y'", submit: "Submit", value: "-78.638176,35.779591" })
+
viewof inputCoordinates = { const input = text({ title: "Location", description: "Submit XY (Longitude/Latitude) coordinates for location as 'X,Y'", submit: "Submit", value: "-78.638176,35.779591" }); input.oninput = ({detail}) => { input[0].value = detail; }; return input; }
Insert cell
Insert cell
Removed in fork
viewof newCoordinates = {
  map.on('click', e => {
    newCoordinates = `${e.latlng.lng},${e.latlng.lat}`
    inputCoordinates = newCoordinates
  })
}
Insert cell
Changed in fork
viewof map = { let container = DOM.element('div', { style: `width:${width}px;height:${width/4}px`}); yield container;
-
+
const map = container.value = L.map(container).setView([35.779591,-78.638176],15);
-
let base = L.esri.basemapLayer('DarkGray').addTo(map) }
+
let base = L.esri.basemapLayer('DarkGray').addTo(map); map.on('click', e => { const newval = `${e.latlng.lng},${e.latlng.lat}`; console.log(newval); viewof inputCoordinates.dispatchEvent(new CustomEvent('input', {detail: newval})); // inputCoordinates = newCoordinates }); }
Insert cell
Insert cell
Insert cell