Platform
Resources
Pricing
Sign in
Get started
Tom MacWright
hi!
Workspace
Fork
Published
Maps
By
Tom MacWright
Edited
Jan 25, 2018
5 forks
12 stars
Insert cell
Insert cell
{
let
div
=
html
`<div style='height:400px;'></div>`
;
// Like Leaflet and Mapbox GL JS, Google Maps is very picky about
// needing to be initialized on a div that's already included
// in the page. So I yield the div first, to establish it in
// the page.
yield
div
;
let
map
=
new
google
.
maps
.
Map
(
div
,
{
center
:
{
lng
:
-
73.61457
,
lat
:
45.524149
}
,
zoom
:
10
}
)
;
}
Insert cell
Insert cell
// This embeds my key. Get your own key - this one will be cycled out very soon!
google
=
require
(
'https://maps.googleapis.com/maps/api/js?key=AIzaSyA9-OuEIxQw2IXwfkcMRXG6PA1vcnQaAVs'
)
.
catch
(
(
)
=>
window
.
google
)
Insert cell
Insert cell
Purpose-built for displays of data
Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Try it for free
Learn more
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
google
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML