Leaflet.js - following an example - zoom on US

Anyone's used Leaflet.js? I'm following this example https://asmaloney.com/2014/01/code/creating-an-interactive-map-with-leaflet-and-openstreetmap/

You see how the map shows the US and other countries....I want to zoom in on the US when the page loads.

I did this
var maxBounds = [
			[5.499550, -167.276413], //Southwest
			[83.162102, -52.233040]  //Northeast
		];

		var map = L.map( 'map', {
			center: [100.0, 5.0],
			minZoom: 3,
			zoom: 2
		});

		map.setMaxBounds(maxBounds);
		map.fitBounds(maxBounds);

Open in new window


but when the page loads, map still looks small. Looks like this. How can I zoom in on the US when the page loads?
map.png
LVL 8
CamilliaAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

lenamtlCommented:
Hi,

the minimum zoom is bigger than the default zoom so this is not making sense
The default zoom must be a valid zoom and in the zoom bracket.

Here is an example
zoom: 15, // starting zoom
minZoom: 10,
maxZoom: 18,

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
CamilliaAuthor Commented:
that didn't work but I'll play around with it. It made the map very large. I don't see the markers anymore.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.