Compare commits

..

No commits in common. "93302278790d9df145e54ce5a86c73a8ff866911" and "15e3248ee1caca3fb3ac3a1440c6ed4710460013" have entirely different histories.

2 changed files with 14 additions and 10 deletions

View File

@ -7,6 +7,10 @@
z-index: 1; z-index: 1;
} }
#jumpForm {
display: inline;
}
/* modify the cursor for the Leaflet map */ /* modify the cursor for the Leaflet map */
.leaflet-container { .leaflet-container {
cursor: crosshair; cursor: crosshair;

View File

@ -357,23 +357,23 @@
} }
}, },
extractCoordinates: function (coordinatesStr) { extractCoordinates: function(coordinatesStr) {
var coordinates = { valid: false, latlng: { lat: 0., lng: 0. } }; var coordinates = {valid: false, latlng: {lat: 0., lng: 0.}};
var delimiters = [',', ' ', ';']; var delimiters = [',', ' ', ';'];
coordinatesStr = coordinatesStr.trim(); coordinatesStr = coordinatesStr.trim();
if (coordinatesStr.length == 0) { if(coordinatesStr.length == 0) {
return coordinates; return coordinates;
} }
for (var delimiter of delimiters) { for(var delimiter of delimiters) {
if (coordinatesStr.indexOf(delimiter) != -1) { if(coordinatesStr.indexOf(delimiter) != -1) {
var coordinatesArr = coordinatesStr.split(delimiter); var coordinatesArr = coordinatesStr.split(delimiter);
coordinates.latlng.lat = parseFloat(coordinatesArr[0]); coordinates.latlng.lat = parseFloat(coordinatesArr[0]);
coordinates.latlng.lng = parseFloat(coordinatesArr[1]); coordinates.latlng.lng = parseFloat(coordinatesArr[1]);
if (!isNaN(coordinates.latlng.lat) && !isNaN(coordinates.latlng.lng)) { if( !isNaN(coordinates.latlng.lat) && !isNaN(coordinates.latlng.lng) ) {
coordinates.valid = true; coordinates.valid = true;
return coordinates; return coordinates;
} }
@ -477,7 +477,7 @@
var coordinatesStr = document.getElementById("jumpCoordinates").value; var coordinatesStr = document.getElementById("jumpCoordinates").value;
var coordinates = Util.extractCoordinates(coordinatesStr); var coordinates = Util.extractCoordinates(coordinatesStr);
if (coordinates.valid) { if(coordinates.valid) {
MapEditor.placeMarker(coordinates.latlng); MapEditor.placeMarker(coordinates.latlng);
} }
}; };
@ -487,10 +487,10 @@
var coordinates = Util.extractCoordinates(coordinatesStr); var coordinates = Util.extractCoordinates(coordinatesStr);
var jumpButton = document.getElementById("jumpButton"); var jumpButton = document.getElementById("jumpButton");
if (coordinates.valid) { if(coordinates.valid) {
jumpButton.disabled = false; jumpButton.disabled = false;
if (e.key == 'Enter') { if(e.key == 'Enter') {
MapEditor.placeMarker(coordinates.latlng); MapEditor.placeMarker(coordinates.latlng);
} }
} }