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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:40:21+00:00 2026-06-06T23:40:21+00:00

I have a question. Now I generate my map with this function: function mapStart()

  • 0

I have a question. Now I generate my map with this function:

function mapStart() {
var center = new google.maps.LatLng(c1, c2);
var MapOption = {
zoom: 6,
center: center,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("mapka"), MapOption);

My question is – how I can generate this map without ‘center’ type, but with bounds?
For example:
New map with bounds:

NorthEast = 51;
NorthWest = 55;
SouthEast = 45;
SouthWest = 44;

[this is just a random numbers]

how I can do this?

Greetings!

EDIT#
This is my new code

        var test1 = "(" + nelat + ", " + nelng + ")";
        var test2 = "(" + swlat + ", " + swlng + ")";
        //alert(test1); => (50.355089589491605, 25.734125341796926)
        //alert(test2); => (49.467221440947704, 23.806024755859426)
        var newbounds = new google.maps.LatLngBounds(test1, test2);

        function mapaStart() {
            var center = new google.maps.LatLng(c1, c2);
            var MapOption = {
                zoom: 6,
                center: center,
                mapTypeId: google.maps.MapTypeId.ROADMAP
            };
            var map = new google.maps.Map(document.getElementById("mapka"), MapOption);
            map.fitBounds(newbounds);

But this code doesn’t work properly. When i press ctrl+shift+j, I get this error:

Error: a.lat is not a function Source:

http://maps.gstatic.com/intl/pl_ALL/mapfiles/api-3/9/8/main.js

how to solve this problem?

Greetings!

  • 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-06T23:40:22+00:00Added an answer on June 6, 2026 at 11:40 pm
    1. create a google.maps.LatLngBounds from your numbers

    2. call the Map.fitBounds method


    map.fitBounds(bounds);

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

Sidebar

Related Questions

Dear all,Now i have this question in my java program,I think it should be
Now I do have a hw question for everyone...I've been staring at this for
Question now asked on SU . I have a Windows XP laptop, and I
I am altering the question now! I have the search working using the following:
I have a question. Now in project we use git for automatically update testing
I have 1 question I have 1 UITextview, now,when i click on UITextview and
I have a question, I am searching for about an hour now. A given
I have been using Subversion for a few days now and have a question...
I am using the Vim-Latex now. But I have a question, when everytime I
i have asked a question about manytomanyfield here which i solved but now a

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.