Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8080905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:33:24+00:00 2026-06-05T16:33:24+00:00

I have embedded a Google Map in my website. I want to change its

  • 0

I have embedded a Google Map in my website. I want to change its location according to user input. How can I do this?

I tried to copy the link of the location and assign it to the iframe src:

    $("iframe").attr("src", "https://maps.google.co.in/maps?q=USA&hl=en&ll=37.09024,-95.712891&spn=131.016476,346.289063&sll=23.259933,77.412615&sspn=0.178842,0.338173&oq=usa&doflg=ptm&hnear=United+States&t=m&z=2");

but the iframe is not loading the map.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T16:33:27+00:00Added an answer on June 5, 2026 at 4:33 pm

    Take a look at this 🙂

    <!DOCTYPE html>  
    <html>  
    <head>  
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> 
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>  
    <link href="http://code.google.com/apis/maps/documentation/javascript/examples/default.css" rel="stylesheet" type="text/css" />  
    <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>  
    <script type="text/javascript"> 
    // Initiate map 
    function initialize(data) { 
      // Make position for center map 
      var myLatLng = new google.maps.LatLng(data.lng, data.lat); 
    
      // Map options  
      var myOptions = { 
        zoom: 10, 
        center: myLatLng, 
        mapTypeId: google.maps.MapTypeId.HYBRID 
      }; 
    
      // Initiate map 
      map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); 
    
      // Info window element 
      infowindow = new google.maps.InfoWindow(); 
    
      // Set pin 
      setPin(data); 
    } 
    // Show position 
    function setPin(data) { 
      var pinLatLng = new google.maps.LatLng(data.lng, data.lat); 
      var pinMarker = new google.maps.Marker({ 
        position: pinLatLng, 
        map: map, 
        data: data 
      }); 
    
      // Listen for click event  
      google.maps.event.addListener(pinMarker, 'click', function() { 
        map.setCenter(new google.maps.LatLng(pinMarker.position.lat(), pinMarker.position.lng())); 
        map.setZoom(18); 
        onItemClick(event, pinMarker); 
      }); 
    } 
    // Info window trigger function 
    function onItemClick(event, pin) { 
      // Create content  
      var contentString = pin.data.text + "<br /><br /><hr />Coordinate: " + pin.data.lng +"," + pin.data.lat; 
    
      // Replace our Info Window's content and position 
      infowindow.setContent(contentString); 
      infowindow.setPosition(pin.position); 
      infowindow.open(map) 
    } 
    </script>  
    </head>  
    <body onload="initialize({lat:-3.19332,lng:55.952366,text:'<h2>Edinburgh</h2><i>Nice city!</i>'})"> 
      <div id="map_canvas">  
    </div>  
    </body>  
    </html> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have google maps embedded in my website. Its has markers and when clicked,
I have the following problem. I have embedded a map using Google Maps' API.
I have a google map embedded in my page whose visiblity is set to
I'm trying to use the embedded Google fonts on my website and I have
I have embedded an online-call on a website. You can see it here right
I have a set of points I want to plot on an embedded Google
I have embedded an IronPython engine in a C# application. I want to expose
If I use an embeded google map in my website, will the data contained
I have a Google Apps Script gadget that is embedded in a Google Sites
I have a form field where someone can post a google maps (html) url

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.