themyth92
themyth92

Reputation: 1738

JavaScript initialize Google Map without longitude and latitude

I am working with the Google Map API. I need to initialize the map, but I don't want to put in the longitude and latitude when this happens. However, the longitude and latitude can be displayed as an option to the user, and the Google Map can be the whole Earth as well. Is there any way to do that?

Upvotes: 2

Views: 2373

Answers (1)

geocodezip
geocodezip

Reputation: 161384

No. A set of latitude/longitude coordinates (a google.maps.LatLng) is required to initialize the map. You can pick a set of coordinates and a zoom level that shows the entire world if you like.

https://developers.google.com/maps/documentation/javascript/reference#MapOptions

center | LatLng | The initial Map center. Required.

Upvotes: 4

Related Questions