rainviewer / rainviewer-api-example

How to use RainViewer API: simple HTML + JS code which render an animated weather radar overlay on the map
88 stars 29 forks source link

Latitude longitude mapbox #1

Closed Kevin-com closed 3 years ago

Kevin-com commented 3 years ago

Hello,

first of all, thank you for this! Great tool.

I have a question sir,... Is there a way to enter the latitude longitude of a map to start in the code? Maybe i'm blind i can't find it.

Thank you very much for your answer. Greetings from Belgium.

luckyalvy commented 3 years ago

Hi Kevin! Thanks for your question. The second line of Javascript code is that line with coordinates for the map center. const map = new mapboxgl.Map({ container: "map", style: "mapbox://styles/mapbox/dark-v10", zoom: 6, center: [-100, 47] });

center: [-100, 47] - here -100 - longitude, 47 - latitude. 6 - zoom level.

I hope that helps