cggooglemaps Uncaught ReferenceError: my_location is not def

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
stetman
Forum Members
Forum Members
Posts: 20
Joined: Fri Feb 12, 2010 9:39 am

cggooglemaps Uncaught ReferenceError: my_location is not def

Post 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 ?
Masweb
Forum Members
Forum Members
Posts: 173
Joined: Sat May 09, 2009 4:26 pm

Re: cggooglemaps Direction form doesn't show up

Post 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.
KC
Forum Members
Forum Members
Posts: 33
Joined: Fri Feb 02, 2007 12:28 am

Re: cggooglemaps Uncaught ReferenceError: my_location is not

Post by KC »

Is there any clue yet?

Same problem over here...
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: cggooglemaps Uncaught ReferenceError: my_location is not

Post by Dr.CSS »

Did anyone file a bug report in the modules forge page?...
KC
Forum Members
Forum Members
Posts: 33
Joined: Fri Feb 02, 2007 12:28 am

Re: cggooglemaps Uncaught ReferenceError: my_location is not

Post by KC »

Dr.CSS wrote:Did anyone file a bug report in the modules forge page?...
You're right... Done.

Cheers,
Kees
tomgsd
Forum Members
Forum Members
Posts: 74
Joined: Tue Feb 12, 2008 10:00 am

Re: cggooglemaps Uncaught ReferenceError: my_location is not

Post 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.
Masweb
Forum Members
Forum Members
Posts: 173
Joined: Sat May 09, 2009 4:26 pm

Re: cggooglemaps Uncaught ReferenceError: my_location is not

Post by Masweb »

That's it! :)

Thanks! :)
User avatar
Eric Pesser
Forum Members
Forum Members
Posts: 27
Joined: Mon Oct 13, 2008 8:59 am

Re: cggooglemaps Uncaught ReferenceError: my_location is not

Post by Eric Pesser »

Thanks for this help!
Post Reply

Return to “Modules/Add-Ons”