I need to validate latitude and longitude values within the range of -180 to 180. If a number falls outside of this range, an error should be displayed.
Below is the code I have written for this validation:
if((markerPoint[0] && parseInt(markerPoint[0],10) < -180 || parseInt(markerPoint[0],10) > 180)) {
this.latlngError.push("Invalid coordinates");
} else {
this.isLanLngValid = true;
}
However, it seems that the comparison is not working correctly.