Zen Cart Logo
Forums / All Other Contributions/Addons / Google Mapinator

Google Mapinator

Views: 28,724

Results 41 to 60 of 108
5 Oct 2006, 11:04 PM
#41
alik avatar

alik

Zen Follower

Join Date:
Mar 2006
Posts:
126
Plugin Contributions:
0

Google Mapinator

got the same problem, though it seems that the map loads above the header and leaves the map window div open and empty...

it works fine in 1.3.2 the problem seems to be in 1.3.5 only

5 Oct 2006, 11:25 PM
#42
alik avatar

alik

Zen Follower

Join Date:
Mar 2006
Posts:
126
Plugin Contributions:
0

Re: Google Mapinator

just changed in** jscript_googlemapinator.php**

var map = new GMap2(document.getElementById("map")); to > var map = new GMap2(document.getElementById("map1"));

and then in define_ contact_us i changed the div id to same "map1"

that seemed to put the map in it's window, but still left a space above header...

i don't know much about this stuff but i got this far, for now.

12 Oct 2006, 2:30 PM
#43
alik avatar

alik

Zen Follower

Join Date:
Mar 2006
Posts:
126
Plugin Contributions:
0

Re: Google Mapinator

still not working properly.:unsure:

16 Oct 2006, 11:25 PM
#44
rnbchills avatar

rnbchills

New Zenner

Join Date:
Mar 2005
Location:
Australia
Posts:
5
Plugin Contributions:
0

Re: Google Mapinator

Woodymon:

Very cool. Checking the demo it works for me in my IE6 but not Firefox 1.5.0.4. I've disabled firefox Adblock extension and demo site still does not display map (although I can see google.com connection attempts in Firefox browser bottom info/status bar). I have JavaScript enabled. I see Address and Telephone links and map copyright in box where map should appear. But no map.

Woody

The Latitude and Longitude in the admin / My Store has been labelled wrong. I put the co-ordinates in reverse. Where it said to put Google Maps API Longitude - this should be a positive co-ordinate, not a negative, and vice versa for the Google Maps API Latitude, it should be a negative co-ordinate and not a positive...

Great mod tho'!

16 Oct 2006, 11:41 PM
#45
pixxi avatar

pixxi

Totally Zenned

Join Date:
Jan 2004
Location:
UK
Posts:
1,065
Plugin Contributions:
1

Re: Google Mapinator

I have the longitude as a negative coordinate, and the latitude as a positive coordinate and the map appears fine ...:blink:

Are you in the southern hemisphere/on the other side of the world? :smile:

17 Oct 2006, 2:13 PM
#46
rnbchills avatar

rnbchills

New Zenner

Join Date:
Mar 2005
Location:
Australia
Posts:
5
Plugin Contributions:
0

Re: Google Mapinator

Pixxi:

I have the longitude as a negative coordinate, and the latitude as a positive coordinate and the map appears fine ...:blink:

Are you in the southern hemisphere/on the other side of the world? :smile:

Yes, Australia. I couldn't get the map to load, everything but the map. Got the co-ordinates from Google and Maporama. When everything else failed, I reversed the co-ordinates thinking 'theres no way this is going to work' but da-daa. The mod developer had a few typo's apparently in the SQL, I was also wondering if the Language defines were supposed to be around the other way...anyway, I'm happy now, but thought I'd just post an alternative solution if others may be having the same problem.

So maybe its a Southern Hemisphere thing? I don't know...hmm interesting tho'.

17 Oct 2006, 3:56 PM
#47
pixxi avatar

pixxi

Totally Zenned

Join Date:
Jan 2004
Location:
UK
Posts:
1,065
Plugin Contributions:
1

Re: Google Mapinator

I'm not an expert on geography, but it appears from a quick bit of Googling that latitude is expressed in relation to the equator, usually suffixed by North or South, and longitude is expressed in relation to the Greenwich meridian, suffixed by East or West. Longitude is a maximum of 180 degrees east or west.

So when you use a decimal notation for entering latitude and longitude the 'South or 'West' parts are expressed as a negative number.

So it would seem that it really does depend on where you live in the world whether the numbers are positive or negative - although, of course, latitude would still need to be entered in the 'Latitude' box in the mod, and longitude in the 'Longitude' box in the mod.

Clear as mud? :smile:

5 Nov 2006, 9:17 PM
#48
firehorse avatar

firehorse

Zen Follower

Join Date:
Oct 2004
Posts:
98
Plugin Contributions:
0

Re: Google Mapinator

Hi,> snorkpants:

btw. Any suggestions for this contrib would be greatly appreciated as I've been wondering where to go next with it. One thing I'm looking at at the moment is a way interface with a reliable geocoordinate lookup site. One other way is to have an admin map that allows you to adjust the position of your entered coordinates as I've noticed that sometimes they're not as accurate as I would like.I would like to have several ezpages, each with their own map.

Could you have a javascript version that you can cut and paste into an ezpage?

Thanks
Alan

6 Nov 2006, 9:42 AM
#49
firehorse avatar

firehorse

Zen Follower

Join Date:
Oct 2004
Posts:
98
Plugin Contributions:
0

Re: Google Mapinator

Hi,> firehorse:

Hi,I would like to have several ezpages, each with their own map.

Could you have a javascript version that you can cut and paste into an ezpage?

Thanks
AlanI signed up, had a look at the code and documentation
http://www.google.com/apis/maps/documentation/

After reading the documentation I started experimenting and this is what I came up with. Just cut and paste into an ezpage, and customize to your own requirements.

Put your key (from the signup) in where the abcdefg is and the rest should be self explanatory.

I only require one tab so I deleted the second tab from the original contribution. You can easily add it back in if you want the telephone number/other details on another tab.

<div class="center">
<script src="http://maps.google.com/maps?file=api&v=2&key=abcdefg"
      type="text/javascript"></script>
    <script type="text/javascript">

//<![CDATA[

function load() {
      if (GBrowserIsCompatible()) {
        var GOOGLE_LAT = 37.4419;
        var GOOGLE_LNG = -122.1419;
        var GOOGLE_ZOOM = 13;
        var STORE_NAME_ADDRESS = "Test<br />99 Road<br />Any Town<br />Any City<br />T:999 999 999";

        var map = new GMap2(document.getElementById("map"));
        map.setCenter(new GLatLng(GOOGLE_LAT, GOOGLE_LNG), GOOGLE_ZOOM);
	  map.addControl(new GMapTypeControl());
	  map.addControl(new GSmallMapControl());
	  map.addControl(new GOverviewMapControl());

	var point = new GLatLng(GOOGLE_LAT, GOOGLE_LNG);
	var infoTabs = [ 
		new GInfoWindowTab("Address", STORE_NAME_ADDRESS)
            ];

	var marker = new GMarker(point);
	GEvent.addListener(marker, "click", function() { marker.openInfoWindowTabsHtml(infoTabs);});
	map.addOverlay(marker);
	marker.openInfoWindowTabsHtml(infoTabs);
      }
    }

    //]]>
    </script>
  </head>
  <body onload="load()" onunload="GUnload()">
    <div id="map" style="width: 500px; height: 300px"></div>
</div>

Best regards
Alan

6 Nov 2006, 12:17 PM
#50
firehorse avatar

firehorse

Zen Follower

Join Date:
Oct 2004
Posts:
98
Plugin Contributions:
0

Re: Google Mapinator

Hi,

Many thanks to Graham (snorkpants) :thumbsup: for the contribution otherwise I wouldn't have begun to look at this.

But before he comes out with a version that can do different pages, my hack, and it definitely is a hack, seems to work ok with ezpages, but it doesn't when I paste it into 'contact us' (original contribution works fine though :thumbsup:).

When I paste my hack into 'page 2' as a part of define pages, it works fine so I'm very puzzled on the finer details of html & zencart.

Just my own little puzzle :lamo:

Best regards
Alan

6 Nov 2006, 1:49 PM
#51
firehorse avatar

firehorse

Zen Follower

Join Date:
Oct 2004
Posts:
98
Plugin Contributions:
0

Re: Google Mapinator

Hi,> firehorse:

Just my own little puzzle :lamo:I've found out why my 'hack' doesn't work with the contact us page. It's because there's already an onload function being executed in the body tag. And if you execute an onload in a body later on it is ignored.

So the correct thing is to put the onload in the includes/module/page/contact us so it gets included in and executed in the right place in the 'body' tag at the start of the page.

My hack executes the body onload half down the page which breaks html coding but functions ok in opera 9.02, firefox 1.5.0.7 & IE6.0.2900.2180

So stick with the original contribution for the contact us page :D

Best regards
Alan

5 Feb 2007, 11:44 AM
#52
pablosan avatar

pablosan

Zen Follower

Join Date:
Jan 2007
Location:
Bellingham, Wa
Posts:
171
Plugin Contributions:
0

Re: Google Mapinator

rambo:

To put a get driving directions field above the map:

in includes/templates/template_default/templates/tpl_contact_us_default.php

move line: 17

<?php echo zen_draw_form('contact_us', zen_href_link(FILENAME_CONTACT_US, 'action=send')); ?>

down below

<?php } ?>
> 
> then in:
> includes/language/english/html_includes/YOURTEMPLATE/define_contact_us.php
> 
> ```
<form action="http://maps.google.com/maps" method="get" target="blank">
<p><label for="mapsUsSaddr">Where are you coming from? <br>
 Please enter street address, city, and ZIP Code:<br></label><input class="text" id="maps" size="40" name="saddr"> <input class="submit" value="Get directions" type="submit">  <input value="11111 Yourstreet Boulevard Beverly Hills, CA. 90210" name="whateva" type="hidden"> <input value="en" name="hl" type="hidden"></p>
</form>
```place this above the map code:
> ```
<div id="map" style="width: 100%; height: 350px; border:solid black 1px;" ></div>
```Please try it out and let me know if you run into any problems posting to either form on the page.  Thanks.I got all these errors with the form ```
  Sorry, is your name correct? Our system requires a minimum of 2 characters. Please try again.    [IMG]http://www.estore.haskellgraphics.com/includes/templates/template_default/images/icons/error.gif[/IMG]  Sorry, my system does not understand your email address. Please try again.
    [IMG]http://www.estore.haskellgraphics.com/includes/templates/template_default/images/icons/error.gif[/IMG]  Did you forget your message? We would like to hear from you. You can type your comments in the text area below.
5 Feb 2007, 12:25 PM
#53
titangen avatar

titangen

Zen Follower

Join Date:
May 2005
Location:
Brussels belgium
Posts:
177
Plugin Contributions:
0

Re: Google Mapinator

Hi,

i've installed this contrib successfully but I have a little bug I can see the adress + tel data in the map see the print sreen

best regards

chris

6 Feb 2007, 12:24 AM
#54
pablosan avatar

pablosan

Zen Follower

Join Date:
Jan 2007
Location:
Bellingham, Wa
Posts:
171
Plugin Contributions:
0

Re: Google Mapinator

Are they entered in the admin panel: Configuration > My store ...?

18 Feb 2007, 10:08 AM
#55
gabbytwin avatar

gabbytwin

Zen Follower

Join Date:
Jun 2005
Posts:
94
Plugin Contributions:
0

Re: Google Mapinator

I dont know if others have had problems getting the exact fix like i did. but once i got the basic areas long and lat. I found this link so I could place it EXACTLY where i am to get the right numbers. I hope the link helps others

http://www.gorissen.info/Pierre/maps/googleMapLocationv4.php?lat=-27.558599&lon=152.78&setLatLon=Set

Oh by the way thats my place :) in Australia

11 May 2007, 11:00 AM
#56
thm avatar

thm

New Zenner

Join Date:
Mar 2007
Posts:
16
Plugin Contributions:
0

Re: Google Mapinator

Thanks for the download. However I can't seem to be able to make it work. I followed the instructions and nothing appears under Admin>My Store. No references to lat, long, or anything else in the google mapinator.

I tried inputting the lat and long into the configuration.sql.
It also says that my API key is wrong. I registered it for http://www.mysite.com/
does it matter that my store is at http://www.mysite.com/store? In other words do I have to register it for /store instead of just / ?

16 May 2007, 12:21 AM
#57
thm avatar

thm

New Zenner

Join Date:
Mar 2007
Posts:
16
Plugin Contributions:
0

Re: Google Mapinator

Just a quick update. I got a new API for xxx/store and it still says that the API code is used by another site.

Does anyone know why it is doing this?

Cheers.

10 Jun 2007, 11:46 AM
#58
high_octane avatar

high_octane

New Zenner

Join Date:
Jan 2006
Posts:
37
Plugin Contributions:
0

Re: Google Mapinator

I have installed this on ZenCart v1.3.7 and it works great!
Thank You :o)

I did have a discrepancy in the instructions.

"3. Add the following code to your define_contact_us.php
this is usually located in includes/languages/english/YOURTEMPLATE/define_contact_us.php"

For me at least it should read...

"3. Add the following code to your define_contact_us.php
this is usually located in includes/languages/english/html_includes/YOURTEMPLATE/define_contact_us.php"

Other than that, Everything else was correct, and it is probably due to different versions having different file structures.
I'm posting this to help others who's file structure is like mine, so they install it correctly.

Thanks again for your hard work!

27 Jul 2007, 8:19 AM
#59
alex_clarke avatar

alex_clarke

Totally Zenned

Join Date:
Mar 2006
Posts:
909
Plugin Contributions:
1

Re: Google Mapinator

thm:

Just a quick update. I got a new API for xxx/store and it still says that the API code is used by another site.

Does anyone know why it is doing this?

Cheers.

I am also receiving this error message. The funny thing is, everything works fine on my localhost (running Apache), but when I test this on my live server (IIS 6) I get the error message.

Has anyone found a fix for this yet?

Also, my Contact Us page uses SSL. Is there a way to use SSL with Google Maps (to make all the objects on the Contact Us page secure)?

Thanks in advance! :)

30 Aug 2007, 12:50 PM
#60
alex_clarke avatar

alex_clarke

Totally Zenned

Join Date:
Mar 2006
Posts:
909
Plugin Contributions:
1

Re: Google Mapinator

Finally I've managed to solve my problem. I edited the code a little and everything is now working fine.

The final code I'm using is listed below. Hopefully it'll help someone else out.

<?php
// Zen Cart Google Mapinator
// (k) Graham Bevins (Snorkpants)
// (c) 2006 Phoenix Web Development
// Email: [email protected]
// Version 0.1a

/*
 This is my first solo contrib. I hope you like it and find use for it
*/

/*
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/
?>
<?php
function nl2brStrict($text, $replacement = '<br />')
{
   return preg_replace("((\r\n)+)", trim($replacement), $text);
}
?>

<script src="http://maps.google.com/maps?file=api&v=2&key=<?php echo nl2brStrict(GOOGLEMAP_KEY);?>"
  type="text/javascript"></script>
  <script type="text/javascript">

//<![CDATA[

function GoogleMapLoad() 
{
  if (GBrowserIsCompatible()) 
  {
	var map = new GMap2(document.getElementById("map"));
	map.setCenter(new GLatLng(<?php echo nl2brStrict(GOOGLEMAP_LAT);?>, <?php echo nl2brStrict(GOOGLEMAP_LNG);?>), <?php echo nl2brStrict(GOOGLEMAP_ZOOM);?>);
	map.addControl(new GMapTypeControl());
	map.addControl(new GSmallMapControl());

	var point = new GLatLng(<?php echo nl2brStrict(GOOGLEMAP_LAT);?>, <?php echo nl2brStrict(GOOGLEMAP_LNG);?>);
	var infoTabs = [ 
		new GInfoWindowTab("Address", "<?php echo nl2brStrict(STORE_NAME_ADDRESS);?>"),
		new GInfoWindowTab("Telephone", "<?php echo nl2brStrict(STORE_TELEPHONE);?>")
	
	];
	
	var marker = new GMarker(point);
	GEvent.addListener(marker, "click", function() { marker.openInfoWindowTabsHtml(infoTabs);});
	map.addOverlay(marker);
	marker.openInfoWindowTabsHtml(infoTabs);
   }
}

//]]>
</script>