2 Replies - 402 Views - Last Post: 22 August 2013 - 10:00 PM

#1 Black_Lion  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 31-March 13

Geocoding: embedded Google Maps in webpage

Posted 22 August 2013 - 01:31 PM

Hi all. I have run into a problem. I have embedded google maps into my web page using following source code:


<iframe
 
class="style77" frameborder="0" marginheight="0" marginwidth="0" scrolling="no"
 src="https://www.google.co.za/maps?     t=m&amp;dg=opt&amp;ie=UTF8&amp;ll=-33.916013,18.654785&amp;spn=0.809147,0.826721&amp;z=9&amp;output=embed"
  width="300">

</iframe>





Here is the picture of the embedded Google Maps, displayed in a frame:

Google Maps embedded in webpage
Posted Image
There are 3 textboxs: street, suburb and town.

After the user has entered these 3 fields, a "View" button is clicked to display the map, which should display the new location in the frame containing embedded google maps

Thats where Im stuck. How can I pass the textboxes input into google maps so that it displays the specific location in this frame? I know that you need to manipulate string into string format: street + "," + suburb + "," + town;

Thanks

This post has been edited by modi123_1: 22 August 2013 - 01:48 PM
Reason for edit:: added img tag


Is This A Good Question/Topic? 0
  • +

Replies To: Geocoding: embedded Google Maps in webpage

#2 andrewsw  Icon User is online

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3369
  • View blog
  • Posts: 11,411
  • Joined: 12-December 12

Re: Geocoding: embedded Google Maps in webpage

Posted 22 August 2013 - 02:13 PM

Have you read the relevant parts of the Google API, and gone through their code examples?

To get the value from an input element you might use:
var street = getElementById("inputid").value;

You could do the same for suburb and town and construct a variable to use as your search criteria:
var searchCriteria = street + "," + suburb + "," + town;

If you are passing this information as part of a url-querystring then you should also pass them through encodeURIComponent and, of course, check the docs to ensure that you are passing them in the required format.

This post has been edited by andrewsw: 22 August 2013 - 02:34 PM

Was This Post Helpful? 1
  • +
  • -

#3 graverivas  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 3
  • Joined: 16-August 13

Re: Geocoding: embedded Google Maps in webpage

Posted 22 August 2013 - 10:00 PM

i think this might help, https://developers.g...laces-searchbox
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1