On Nov 4, 9:33 am, Thomas <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am trying to slice the point given to the GMarker. I am reading the
> points from a text file and i want to get rid of some decimals shown
> in the sidebar. The alert(point) gives me the full value seperated by
> a , back, but whatever I am going to do to the point (e.g. var x =
> point.slice(0, 9); ) isn't working and the function isn't producing
> any output in the sidebar at all. I have to say I added var x =
> point.slice(0, 9); a line below the alert call.
>
> How can I slice the point values? I need the precission for locating
> the points on the map but the user should not see all the decimals...

.slice() is used on Strings, and your point is a GLatLng(). alert
forces the point to be returned as a String, but .slice() doesn't do
that.

Why not use what is documented? 
http://code.google.com/apis/maps/documentation/reference.html#GLatLng
point.toUrlValue(4)
or whatever. You can specify any number: the default is 6.

Andrew
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to