Dynadot โ€” .com Registration $8.99

Google maps integration

Spaceship Spaceship
Watch

jackdomain

Established Member
Impact
34
hi i want to incorporate a google map with the starting point for example of barcelona with a search box


any one have an example of it or any easy way to do? thanks
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
0
•••
0
•••
Hi first of all thanks to answer.

Iโ€™m a noob on this world and nowadays my abilities are basic on modifying...

Deaol your "maps" is what I was exactly searching. If you can help me or..."teach me" how to incorporate it with for example starting on Barcelona or any other city i will thanks a lot
 
0
•••
deaol?ยฟ :(
 
0
•••
could it be done so that I have a small google map pic on the site(lets say 160*120 pixels) and once clicked a big map pop up in a new window. I am sure it can, but can it be done so that I dont have to make the small image myself but some kind of script will make it from the addresses that I have?
 
0
•••
jackdomain said:
deaol?ยฟ :(

Hey jackdomain sorry I didn't get back sooner wasnt keeping an eye out on this thread. I will check out the code and reply here or pm you with some help :tu: (just kind of tied up at the moment .. work :zzz: )

Ok here you go, your going to want to add your API KEY and change the lat and long coordinates to locate the map over the part of the world you want

In Head
Code:
  <script src="http://maps.google.com/maps?file=api&v=2&key=YOUR-API-KEY-HERE"
      type="text/javascript"></script>
    <script type="text/javascript">

    //<![CDATA[

    var map = null;
    var geocoder = null;

    function load() {
  if (GBrowserIsCompatible()) {
    map = new GMap2(document.getElementById("map"));
    map.addControl(new GLargeMapControl());
    map.addControl(new GMapTypeControl());
    map.addControl(new GScaleControl());
    map.setCenter(new GLatLng(50.11, -124.12), 4);
    geocoder = new GClientGeocoder();
  }
}

function showAddress(address) {
      if (geocoder) {
        geocoder.getLatLng(
          address,
          function(point) {
            if (!point) {
              alert(address + " not found");
            } else {
              map.setCenter(point, 13);
              var marker = new GMarker(point);
              map.addOverlay(marker);
              marker.openInfoWindowHtml(address);
            }
          }
        );
      }
    }
    //]]>
    </script>


In Body
Code:
<center><form action="#" onsubmit="showAddress(this.address.value); return false">
      <p>
        <input type="text" size="60" name="address" value="YOUR CITY NAME HERE" />
        <input type="submit" value="Go!" />
      </p>
      <div id="map" style="width: 600px; height: 400px"></div>
    </form></center>
 
0
•••
Appraise.net
Unstoppable Domains
Domain Recover
DomainEasy โ€” Payment Flexibility
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back