HowTo: Create/display a Google Maps Mashup with GeoDirection

Dynamically redirect a web surfer based on their geographic location.
Can also insert localized, geographic content into a web page.

Moderators: Moderators, GeobytesAdmins

HowTo: Create/display a Google Maps Mashup with GeoDirection

Postby Adrian » Thu Mar 06, 2008 12:14 pm

Here is how to get a Google map to display the location of the visitor, (as in this example here: http://www.geobytes.com/MashupGeoDirect ... leMap.html )
This example can be added to any web page on any server without any other changes, or software. (In other words, this is all that is required.)

Note: First, you will need to replace the key=xxxxxxxxxxx...xxxxxxxxxxxxxxx with the correct key for your web site. You can get a key for free here:
http://code.google.com/apis/maps/signup.html

Now, you can either view and copy the source of the page at http://www.geobytes.com/MashupGeoDirect ... leMap.html and use it as the bases of your own new page. (remember to change the key or it won't work) or you can add the following to an existing page.

To add to an existing page:
1. Add this line where you want the map to display:
Code: Select all
<div id="map" style="width: 700px; height: 400px"></div>

and
2. Add this block of code to the header section of your page:
Code: Select all
<script language="Javascript" src="http://gd.geobytes.com/gd?after=-1&variables=GeobytesCountry,GeobytesCity,GeobytesRegion,GeobytesLatitude,GeobytesLongitude">
    </script>
<script src="http://maps.google.com/maps?file=api&amp;v=2&key=xxxxxxxxxxx...xxxxxxxxxxxxxxx" type="text/javascript"></script>
 <script type="text/javascript">
 //<![CDATA[

   function load()
   {
      if (GBrowserIsCompatible())
      {
         var map = new GMap2(document.getElementById("map"));
         map.addControl(new GLargeMapControl());
         map.addControl(new GMapTypeControl());
         map.addControl(new GScaleControl());
         map.enableContinuousZoom();
      
            map.setCenter(new GLatLng(sGeobytesLatitude, sGeobytesLongitude), 11);
         
      }
   }

   function GUnload()
   {
      if (window.GUnloadApi)
      {
         GUnloadApi();
      }
   }

//]]>
</script>

3. Add these parameters to the <body tag of your page:
Code: Select all
<body onload="load()" onunload="GUnload()">


4. Finally, if you don't want any pop-up ads then you will need some Mapbytes. ($50 will give you 50,000 accesses)

Please let us know how you go, I would love to see it, and in any case please let me know if I can assist further.
Adrian
“When it absolutely, positively has to be there, try looking in your Spam folder.” - Adrian McElligott - July 2009
--
Have you tried the Local Search facility on the IP Locator Page yet?
User avatar
Adrian
Moderator
 
Posts: 970
Joined: Thu Nov 20, 2003 9:58 am

Re: HowTo: Create/display a Google Maps Mashup with GeoDirection

Postby chittahchattah » Thu Dec 04, 2008 6:21 pm

Adrian,
How can I include parameter to display traffic information (if available) for the google map displayed using your script. For example, I am in San Francisco California, and I can get realtime traffic data with my google-map on my mobile. I guess traffic is not available for all locations, but if available would be nice to display for the user. Thx - Chittahchattah
chittahchattah
 
Posts: 3
Joined: Thu Dec 04, 2008 6:12 pm

Re: HowTo: Create/display a Google Maps Mashup with GeoDirection

Postby Adrian » Fri Dec 05, 2008 9:06 am

chittahchattah wrote:How can I include parameter to display traffic information (if available) for the google map displayed using your script.
Unfortunately, I am not familiar enough with the Google Maps API to be able to advise you, however I did find their documentation here:
http://code.google.com/apis/maps/documentation/
I am not sure if it allows you to plot traffic levels - I am not sure it they have opened that information up to their API, but it is a good place to start.
Adrian
“When it absolutely, positively has to be there, try looking in your Spam folder.” - Adrian McElligott - July 2009
--
Have you tried the Local Search facility on the IP Locator Page yet?
User avatar
Adrian
Moderator
 
Posts: 970
Joined: Thu Nov 20, 2003 9:58 am

Re: HowTo: Create/display a Google Maps Mashup with GeoDirection

Postby chittahchattah » Fri Dec 05, 2008 9:15 am

Thx Adrian,
I do not see any traffic parms in this listing so I assume API for traffic data is not available. Thx for really rapid response. //.. chittahchattah.
chittahchattah
 
Posts: 3
Joined: Thu Dec 04, 2008 6:12 pm

Re: HowTo: Create/display a Google Maps Mashup with GeoDirection

Postby Adrian » Sat Dec 06, 2008 8:50 am

Yes, I could not find any reference to their "traffic" facility either, but it may be there somewhere - they usually introduce new stuff via their blog at http://googlegeodevelopers.blogspot.com/ and then they update their documentation sometime later, so perhaps there is something there.
Adrian
“When it absolutely, positively has to be there, try looking in your Spam folder.” - Adrian McElligott - July 2009
--
Have you tried the Local Search facility on the IP Locator Page yet?
User avatar
Adrian
Moderator
 
Posts: 970
Joined: Thu Nov 20, 2003 9:58 am

Re: HowTo: Create/display a Google Maps Mashup with GeoDirection

Postby chittahchattah » Sat Dec 06, 2008 2:55 pm

Adrian,
Thx again. I will keep searching and then post the switch/string back here if I find it. Thx again for all your help. //.. chittahchattah
chittahchattah
 
Posts: 3
Joined: Thu Dec 04, 2008 6:12 pm

Re: HowTo: Create/display a Google Maps Mashup with GeoDirection

Postby Lakseninord » Wed Jan 07, 2009 9:15 am

This is a great feature.
But i dont understand that they are still doing the whole pop-up commercial thing. I can't imagining anyone making any money at all from it, it's just too annoying...
Lakseninord
 
Posts: 1
Joined: Wed Jan 07, 2009 9:10 am

Re: HowTo: Create/display a Google Maps Mashup with GeoDirection

Postby Adrian » Wed Jan 07, 2009 1:35 pm

Lakseninord wrote:But i dont understand that they are still doing the whole pop-up commercial thing. I can't imagining anyone making any money at all from it, it's just too annoying...
You're right - the pop-ups are not there to "make money" - they are there so that people can use the server for free (sponsored by advertising) - either for testing and development, evaluation, or indefinitely. While at the same time providing an incentive for people to upgrade to the paid service.
Adrian
“When it absolutely, positively has to be there, try looking in your Spam folder.” - Adrian McElligott - July 2009
--
Have you tried the Local Search facility on the IP Locator Page yet?
User avatar
Adrian
Moderator
 
Posts: 970
Joined: Thu Nov 20, 2003 9:58 am

Re: HowTo: Create/display a Google Maps Mashup with GeoDirection

Postby Josh » Tue Apr 21, 2009 12:20 am

Adrian wrote:4. Finally, if you don't want any pop-up ads then you will need some Mapbytes. ($50 will give you 50,000 accesses)
Please let us know how you go, I would love to see it, and in any case please let me know if I can assist further.


I am interested to know something. If someone will use the free version of your IP address lookup script, then every visitor of his website will get a pop-up or just random users ? :wink:
Josh
 
Posts: 1
Joined: Tue Apr 21, 2009 12:09 am

Re: HowTo: Create/display a Google Maps Mashup with GeoDirection

Postby sumitarora » Sun Jun 28, 2009 6:13 pm

can i use this service integrated with google map for free?

I mean can i use this for free:
<script language="Javascript" src="http://gd.geobytes.com/gd?after=-1&variables=GeobytesCountry,GeobytesCity,GeobytesRegion,GeobytesLatitude,GeobytesLongitude"></script>

If yes, then what if this service goes down?

Thanks,
Sumit Arora
sumitarora
 
Posts: 1
Joined: Sun Jun 28, 2009 6:08 pm

Re: HowTo: Create/display a Google Maps Mashup with GeoDirection

Postby Adrian » Mon Jun 29, 2009 2:04 am

Hi Sumit,

sumitarora wrote:can i use this service integrated with google map for free?

Yes, in free mode your usage is sponsored by advertising - there is more info on how this works here:
http://www.geobytes.com/GeoDirection.ht ... thisbefree

sumitarora wrote:If yes, then what if this service goes down?

RackSpace provide our hosting - they are very reliable. We have been hosted with them now for almost 4 years now and we have had almost no downtime. We do however need to reboot our server about once per month to apply Microsoft Patches - this reboot normally takes less then a minute. However, after saying all of that, if the service did go down then the effect on your web site would depend on both how you have implemented the script, and on the particular browser that the user was user to view it. Basically, the service is implement as JavaScript that runs on the browser, and I do not have sufficient knowledge about JavaScript and how it is implemented in different browsers to provide a more concise answer sorry. Perhaps another reader could address this aspect.

In any case, please let me know if I can assist further.
Adrian
“When it absolutely, positively has to be there, try looking in your Spam folder.” - Adrian McElligott - July 2009
--
Have you tried the Local Search facility on the IP Locator Page yet?
User avatar
Adrian
Moderator
 
Posts: 970
Joined: Thu Nov 20, 2003 9:58 am

Re: HowTo: Create/display a Google Maps Mashup with GeoDirection

Postby althearim » Tue Nov 17, 2009 9:56 am

How much would it cost if we avail Rackspace's services? I'm seriously looking for a provider. Any suggestions? Thanks in advance!

Regards,
althearim
Pret voiture
althearim
 
Posts: 1
Joined: Tue Nov 17, 2009 9:32 am

Re: HowTo: Create/display a Google Maps Mashup with GeoDirection

Postby Adrian » Tue Nov 17, 2009 11:45 am

Hi althearim,
althearim wrote:How much would it cost if we avail Rackspace's services?

Depends on your unique requirements. Perhaps speak to someone from RackSpace, I am sure that they would be keen to help.
http://www.rackspace.com

In any case, please let me know if I can assist further.
Adrian
“When it absolutely, positively has to be there, try looking in your Spam folder.” - Adrian McElligott - July 2009
--
Have you tried the Local Search facility on the IP Locator Page yet?
User avatar
Adrian
Moderator
 
Posts: 970
Joined: Thu Nov 20, 2003 9:58 am

Re: HowTo: Create/display a Google Maps Mashup with GeoDirection

Postby GeorgeDanner » Wed Feb 17, 2010 10:42 am

Thanks Adrian this is great. I've been looking around for ages for a solution to show my visitors location on the Google map when they enter my page but keep just finding incomplete tutorials but yours is pretty good so thanks.
Last edited by GeorgeDanner on Sun Apr 25, 2010 4:10 pm, edited 1 time in total.
GeorgeDanner
 
Posts: 1
Joined: Wed Feb 17, 2010 10:37 am

Re: HowTo: Create/display a Google Maps Mashup with GeoDirection

Postby Adrian » Fri Feb 19, 2010 2:53 pm

You're welcome George - thank you for the feedback - I very much appreciate it.
Adrian
“When it absolutely, positively has to be there, try looking in your Spam folder.” - Adrian McElligott - July 2009
--
Have you tried the Local Search facility on the IP Locator Page yet?
User avatar
Adrian
Moderator
 
Posts: 970
Joined: Thu Nov 20, 2003 9:58 am

Next

Return to GeoDirection

Who is online

Users browsing this forum: Yahoo [Bot] and 0 guests