Page 1 of 1

cggooglemaps Uncaught ReferenceError: my_location is not def

Posted: Mon Jan 23, 2012 10:57 pm
by stetman
CGgooglemaps works fine on cmsms 1.10.3 except for the routing.
When I click "to here" nothing happens and I see an error:
Uncaught ReferenceError: my_location is not defined

in developer tools.

Can anybody help me ?

Re: cggooglemaps Direction form doesn't show up

Posted: Tue Jan 24, 2012 2:51 pm
by Masweb
Same problem. The direction form doesn't show up.

Using CMSMS 1.10.3 and CGGooglemaps 2.2.7

I was waiting for this version because 2.2.5 had the same problem.

Re: cggooglemaps Uncaught ReferenceError: my_location is not

Posted: Sat Feb 18, 2012 11:33 am
by KC
Is there any clue yet?

Same problem over here...

Re: cggooglemaps Uncaught ReferenceError: my_location is not

Posted: Sat Feb 18, 2012 6:18 pm
by Dr.CSS
Did anyone file a bug report in the modules forge page?...

Re: cggooglemaps Uncaught ReferenceError: my_location is not

Posted: Sat Feb 18, 2012 7:09 pm
by KC
Dr.CSS wrote:Did anyone file a bug report in the modules forge page?...
You're right... Done.

Cheers,
Kees

Re: cggooglemaps Uncaught ReferenceError: my_location is not

Posted: Wed Apr 04, 2012 12:51 pm
by tomgsd
I've just downloaded the latest version and ran into this problem with the directions function.

You have two options for fixing this:

1. Under the "Advanced" tab when you edit the map, set the "Supply Geographic location information to the map" option to "Yes" (this enables the browser location tracking and in most instances shows a warning to the user).

2. In the "Javascript Template" tab you have something like this:

Code: Select all

{* javascript template *}
{if $mapinstance == 1}
<__script__ type="text/javascript" charset="utf-8" {$map_defertxt}>{literal}//<![CDATA[
if( typeof(jQuery) == 'undefined' ){
  alert('JQuery is required for this map to function');
}
{/literal}{if $map->sensor}{literal}
var my_location;
jQuery(document).ready(function(){
// a function to determine the current browser location.
// this function is asynchronous in nature.
    .......
The "var my_location;" line (line 8 ) needs to be moved out of the "{if $map->sensor}" block (line 7 will do). Eg:

Code: Select all

{* javascript template *}
{if $mapinstance == 1}
<__script__ type="text/javascript" charset="utf-8" {$map_defertxt}>{literal}//<![CDATA[
if( typeof(jQuery) == 'undefined' ){
  alert('JQuery is required for this map to function');
}
var my_location;
{/literal}{if $map->sensor}{literal}
jQuery(document).ready(function(){
// a function to determine the current browser location.
// this function is asynchronous in nature.
    .......
Hope this helps someone.

Re: cggooglemaps Uncaught ReferenceError: my_location is not

Posted: Wed Apr 04, 2012 4:45 pm
by Masweb
That's it! :)

Thanks! :)

Re: cggooglemaps Uncaught ReferenceError: my_location is not

Posted: Thu Nov 01, 2012 11:35 pm
by Eric Pesser
Thanks for this help!