levi
levi

Reputation: 3511

Get Google Maps HTML to Embed in My Website

I have a website where some users enter some data. Address is one of those data. I want to get html like this.

<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.com/?ie=UTF8&amp;ll=37.0625,-95.677068&amp;spn=51.708931,101.425781&amp;t=m&amp;z=4&amp;output=embed"></iframe><br /><small><a href="https://maps.google.com/?ie=UTF8&amp;ll=37.0625,-95.677068&amp;spn=51.708931,101.425781&amp;t=m&amp;z=4&amp;source=embed" style="color:#0000FF;text-align:left">View Larger Map</a></small>

I want to make some webrequest by entered address and then parse html and get html for embedding. Any better idea?

Upvotes: 0

Views: 743

Answers (1)

sajanyamaha
sajanyamaha

Reputation: 3198

There is a JQuery solution o this,ie the user enters address in a text box and address loads up dynamically in a map.

Try DEMO here and CODE here

$(document).ready(function(){
    var map = $('#map').acts_as_map_container();
    // params:
    // container is required
    // suggestion is the element which will contain the suggested address, default to #suggested
    // delay is the delay time for requesting google map api, default to 500ms
    var address = $('#address').acts_as_address({
        container: map,
        suggestion: '#suggestion',
        delay : 500
    });

})

Upvotes: 1

Related Questions