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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T13:27:36+00:00 2026-06-14T13:27:36+00:00

My problem is realy simple. After creating a map by using the following code,

  • 0

My problem is realy simple. After creating a map by using the following code, the center of the map is not well placed.

var myOptions = {
  center: new google.maps.LatLng(47.000059, 2.06543),
  zoom: 9,
  mapTypeId: google.maps.MapTypeId.ROADMAP,
  scaleControl: false,
  streetViewControl: false,
  mapTypeControl: false,
};
var activity_map = new google.maps.Map(document.getElementById("activity-map"), myOptions);

This point is the middle of France. My div is a 200x200px block with an hidden overflow and relative position. It’s seems the expected center is placed in the top left and corner of the div. I’ve already tried to change the zoom level, set the center after initialize the map but it didn’t work.

  • 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-14T13:27:38+00:00Added an answer on June 14, 2026 at 1:27 pm

    The problem is not in the code you provided. The “top left corner” issue is when the div that contains map doesn’t have a size when the map is initialized. You haven’t provided the HTML/CSS that specifies the size of the map (or that displays it if it is initially hidden).

    Another possibility is that you are initializing the map before DOM is completely rendered, you should be initializing it after the DOM ready or body onload event fires.

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

Sidebar

Related Questions

I'm creating a simple drag-file-and-upload-automatically-to-ftp windows application and I'm using the MSDN code to
It's a really simple problem. I've got HTML code like this : <div> <img
I am creating a simple app that let's the user view movies after clicking
Really simple problem: I want to split a connection string into its keyword /
hey guys having this really simple problem but cant seem to figure out have
This is a really simple problem, but I couldn't find a solution anywhere. I'm
I realy dont know what the problem is with VS2010. I created a class,
i'm creating a simple slideshow. 4 images coming from db by php stored in
I have some C# code which is using CSharpCodeProvider.CompileAssemblyFromSource to create an assembly in
This should be a really simple problem, but I can't quite figure out what

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.