Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Default center on United States?

Tags:

By default, google offers this example of how to center a map on Chicago, IL:

var chicago = new google.maps.LatLng(41.850033, -87.6500523);

Is it possible to have the default center focus on the entire United States? I can't find this anywhere.

like image 478
Norse Avatar asked Dec 09 '12 07:12

Norse


People also ask

Where is the exact middle of the US?

The Geographic Center of the Contiguous United States is located about two miles northwest of Lebanon, Kansas. A small stone pyramid marks the point measured by a survey performed in 1918.

What is the middle of the United States called?

Midwest, also called Middle West or North Central States, region, northern and central United States, lying midway between the Appalachians and Rocky Mountains and north of the Ohio River and the 37th parallel.

Where is the center of the lower 48 states?

The Geographic Center of the Lower 48 States is located north of Lebanon, Kansas. It was determined by finding the center of gravity for the contiguous United States, that is, the point at which a plane map of the 48 states would balance if it were of uniform thickness.


2 Answers

Use Chicago as the center, and then change the zoom.

There's an example here. A slightly reworked version (untested!):

gMap = new google.maps.Map(document.getElementById('map')); 
gMap.setCenter(new google.maps.LatLng(41.850033, -87.6500523));
gMap.setZoom(ANewZoomLevel);

You'll need to experiment to find the right zoom level for your needs.

like image 194
Ken White Avatar answered Oct 20 '22 18:10

Ken White


Use the Geographic Center of the Contiguous United States:
Lebanon, Kansas. Probably the most boring place on earth.

http://www.kansastravel.org/geographicalcenter.htm

I find that a zoom of 3, 4, or 5 is perfect.

gMap = new google.maps.Map(document.getElementById('map')); 
gMap.setCenter(new google.maps.LatLng(39.8097343, -98.5556199));
gMap.setZoom(3);
like image 45
Alex V Avatar answered Oct 20 '22 19:10

Alex V