1

I have an issue with google maps marker where am passing position with longitude and latitude with some values which, after passing to the code below, the value for longitude is slightly changing (some trailing values are being added). Can someone please help me on this? PFB code.

var lat = parseFloat(asset.latitude);
var lon = parseFloat(asset.longitude);
window.marker[i] = new google.maps.Marker({
    position: new google.maps.LatLng(lat, lon),
    icon: image,
    map: that.map,
    animation: google.maps.Animation.DROP,
    title: asset.Description,
    equipment: ""
});

Values passed to marker API:
Coordinates passed to API

Trailing value added to coordinate from console:
trailing value added to coordinate from console

Here, I have passed longitude as -68.83577 but after it is passed to marker API, its value got changed as -68.83577000000002. My issue is why some trailing values are being added.

Boghyon Hoffmann
  • 17,103
  • 12
  • 72
  • 170
Vishnu Gk
  • 11
  • 1

0 Answers0