The problem is google.maps.LatLng is expecting two numbers and you are passing it a string from your database (assuming searchMapDataResult[‘latlong’] is returning a comma delimited string). So you will need to
- Split the latitude and longitude
- Convert them into numbers
- Generate the google.maps.LatLng
Like this:
var latLngArray = searchMapDataResult['latlong'].split(',');
var latitude = parseFloat(latLngArray[0]);
var longitude = parseFloat(latLngArray[1]);
var myLatLong = new google.maps.LatLng(latitude,longitude );
2
solved Displaying marker with latlong json data in Biostall-google-maps-V3 API Library issue