No longer crashes when the lat or lon values are empty or NaN closes #62
rodzic
9e01c70c73
commit
eb9b61c86a
|
@ -421,6 +421,8 @@ function plotClick() {
|
||||||
// get the new values from the form
|
// get the new values from the form
|
||||||
click_lat = parseFloat($("#lat").val());
|
click_lat = parseFloat($("#lat").val());
|
||||||
click_lon = parseFloat($("#lon").val());
|
click_lon = parseFloat($("#lon").val());
|
||||||
|
// Make sure the data is valid before we try and do anything with it
|
||||||
|
if ( isNaN(click_lat) || isNaN(click_lon) ) return;
|
||||||
var click_pt = new google.maps.LatLng(click_lat, click_lon);
|
var click_pt = new google.maps.LatLng(click_lat, click_lon);
|
||||||
clickMarker = new google.maps.Marker({
|
clickMarker = new google.maps.Marker({
|
||||||
position: click_pt,
|
position: click_pt,
|
||||||
|
|
Ładowanie…
Reference in New Issue