CGGoogleMaps lat long for directions

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
Mantlet
Forum Members
Forum Members
Posts: 114
Joined: Fri Apr 28, 2006 9:42 am
Location: Haarlem - Netherlands

CGGoogleMaps lat long for directions

Post by Mantlet »

Hi,

I'm trying to get the lat and long variables into the directions window. Since {$marker->get_marker_id()} and {$marker->get_title()} both work and show up in {$marker|print_r}, I also tried {$marker->get_lat()} and {$marker->get_long()}.

However, those don't give anything, while they seem filled in the {$marker|print_r}.

What is the proper syntax to get the lat and long from a marker?
Emir
New Member
New Member
Posts: 7
Joined: Wed Apr 08, 2009 7:11 am

Re: CGGoogleMaps lat long for directions

Post by Emir »

It's a bit outadated...but somebody can find it useful.

In order to get latitude and logitude of current marker inside CGGoogleMaps, you should use following methods:
  • $marker->get_latitude() and
  • $marker->get_longitude()
Keep in mind that these method will return data with incorrect number format when called from template, so after correction it would like like this:

{$marker->get_latitude()|number_format:6:".":","}
Post Reply

Return to “Modules/Add-Ons”