Platform
Resources
Pricing
Sign in
Get started
Michael Sumner
no names have an anonymous function
Workspace
Fork
Published
By
Michael Sumner
Edited
Feb 2, 2018
Fork of
Using Google Maps
•
1 fork
1 star
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
:
147.3
,
lat
:
-
42.9
}
,
zoom
:
13
}
)
;
}
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=AIzaSyCe5LnXNbNwX5PZ6CJeNlDCdp__ixV6nzk'
)
.
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
Compare fork
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