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

  • Home
  • SEARCH
  • 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 8636651
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:16:58+00:00 2026-06-12T10:16:58+00:00

Hi iam trying to load googlemaps when the new page is loaded ..but itz

  • 0

Hi iam trying to load googlemaps when the new page is loaded ..but itz not working below is my code

  <script type="text/javascript">

    var query = location.href.substring((location.href.indexOf('?')+1), location.href.length);
    if(location.href.indexOf('?') < 0) query = '';
    querysplit = query.split('&');
    query = new Array();

    for(var i = 0; i < querysplit.length; i++){
    var namevalue = querysplit[i].split('=');
    namevalue[1] = namevalue[1].replace(/\+/g, ' ');
    query[namevalue[0]] = unescape(namevalue[1]);
    }
    window.onload = function(lat,lng){
    // Do stuff with query string data here.
alert(query['latitute']);
    var map;
    //code write to load map on right side
        var myLatlng = new google.maps.LatLng(lat,lng);
        map = new google.maps.Map(document.getElementById('map'), {
                        mapTypeId: google.maps.MapTypeId.ROADMAP,
                        center: myLatlng,
                        zoom: 10});
    }
    </script>

my goal is when i click link on firstpage the second page should load with the map taking the latlng from firstpage which are hardcoded..the alert statement is wrking but not the map load..trying to implement it in jquery or js..Any help is appreciated

  • 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-12T10:16:59+00:00Added an answer on June 12, 2026 at 10:16 am

    How did you receive lat and lng values? Have you tried show alert with this variables?

    Also, if your first alert works, try this:

    window.onload = function() {
        var lat = parseFloat(query['latitute']);
        var lng = parseFloat(query['longitute']);
        var map;
        var myLatlng = new google.maps.LatLng(lat, lng);
    
        map = new google.maps.Map(document.getElementById('map'),
            {
                mapTypeId: google.maps.MapTypeId.ROADMAP,
                center: myLatlng,
                zoom: 10
            }
        );
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to use GoogleMaps.InfoBox on my project, but before load this script,
I am trying to load this javascript externally, but it seems to not be
I am trying to load some images in a scrollable pane. But for some
I am trying to load an image but it is showing the error message
I am trying to load my project using a self-made .asd file, but somehow
I am trying to load data asyncronously but on the first time, no progressbar
I am trying to load Google Maps in my Javascript, but I keep getting
I am trying to load jQuery from google's api library, but they are all
I am trying to open a hyperlink with target=blank. <html> <head> <script type=text/javascript src=http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js></script>
I'm trying to create a page that, when refreshed, will randomly load a 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.