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 8005123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:08:07+00:00 2026-06-04T17:08:07+00:00

Can you please help me with this problem in [Google Maps API]? I do

  • 0

Can you please help me with this problem in [Google Maps API]?
I do not know why the map is not displaying.

Here’s the fiddle.

Javascript:

//Map Options
var roadmap = {
  infoWindow: new google.maps.InfoWindow(),
  options: {
    map: {
      center: new google.maps.LatLng(34.02238, -118.293338),
      zoom: 15,
      mapTypeId: 'roadmap'
    },
    marker: {
      position: roadmap.options.center,
      title: "Hello",
      icon: 'http://maps.google.com/mapfiles/ms/micons/blue-dot.png',
      shadow: 'http://maps.google.com/mapfiles/ms/micons/msmarker.shadow.png'
    }
  }
};

//Street view Options
var StreetView = {
  options: {
    position: roadmap.options.map.center,
    zoom: 1
  }
};



//Functions
function bindInfoWindow(marker, map, infoWindow, html) {
  google.maps.event.addListener(marker, 'click', function() {
    infoWindow.setContent(html);
    infoWindow.open(map, marker);
    infoWindow.getContent();
    marker.openInfoWindowTabsHtml(infoTabs);
  });
}


function googleMaps() {
  //Road map
  roadmap.map = new google.maps.Map(document.getElementById("map"), roadmap.options.map);


  //Road map's Marker
  roadmap.options.marker.map = roadmap.map;
  roadmap.marker = new google.maps.Marker(roadmap.options.marker);


  //Street view map
  StreetView.map = new google.maps.StreetViewPanorama(document.getElementById("map_StreetView"), StreetView.options);


  //Bind onClick to marker & infoWindow
  bindInfoWindow(roadmap.marker, roadmap.map, roadmap.infoWindow, roadmap.options.marker.title);
} //end of load()


/*Load | Call googleMaps after document is loaded*/
google.maps.event.addDomListener(window, 'load', function() {
  googleMaps();
  //... (add more code here)
});

HTML:

<!-- START: Google Maps API -->
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="this_map.js"></script>
<!-- __END: Google Maps API -->

<div id="map-container" >
  <div id="map_StreetView" style="width: 350px; height: 250px"></div><br/>
  <div id="map" style="width: 350px; height: 250px"></div>
</div>

Any help with this would be 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-04T17:08:08+00:00Added an answer on June 4, 2026 at 5:08 pm

    The error is here:

    position: roadmap.options.center
    

    You cannot reference an object that your are just creating.

    I changed it to:

    position: new google.maps.LatLng( 34.02238, -118.293338 )
    

    and it worked.

    This is your working fiddle: http://jsfiddle.net/sGHqa/.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can someone please help me out with a JavaScript/jQuery solution for this arithmetic problem:
Still having issues with this problem. Please help if you can. So I am
Can anyone help me spot the problem on this PLEASE? I'm eternally grateful for
can you please help me with this issue the String class does not have
Can anyone please help me with this...I'm not very good with regular expressions and
Can anybody please help me with this as I have no idea why public
can someone please help me. why does this return an error: Dim stuff As
Can any one please help me solve this. I am resizing some flash object/embed
Im a beginner to css, please can someone help me get this element to
Could someone please help explain why I can't get this to work? I properly

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.