Published
Edited
Nov 30, 2021
1 star
Insert cell
Insert cell
Insert cell
viewof map = {
unfoldedMap.setMapEventHandlers({
onLoad: () => {
unfoldedMap.setViewState({
longitude: -96.4247,
latitude: 31.51073,
zoom: 1
});
}
});
yield unfoldedMap.iframe;
}
Insert cell
Insert cell
unfoldedMap = mapSDK.createMap({
embed: true,
appendToDocument: false,
width: width,
height: 600,
});
Insert cell
Insert cell
Insert cell
worldLakes = FileAttachment("world-lakes.json").json()
Insert cell
majorWorldRivers = FileAttachment("world-rivers.json").json()
Insert cell
Insert cell
unfoldedMap.addDataset({
uuid: 'world-lakes',
label: 'World Lakes',
data: JSON.stringify(worldLakes)
}, autoCreateLayers)
Insert cell
unfoldedMap.addDataset({
uuid: 'world-rivers',
label: 'World Rivers',
data: JSON.stringify(majorWorldRivers)
}, autoCreateLayers)
Insert cell
Insert cell
Insert cell
Insert cell
worldCities = FileAttachment('world-cities.csv').csv()
Insert cell
worldCitiesFileBlob = FileAttachment('world-cities.csv').blob()
Insert cell
worldCitiesCSV = worldCitiesFileBlob.text()
Insert cell
Insert cell
viewof worldCitiesTable = Inputs.table(worldCities, {sort: 'cityName'})
Insert cell
Insert cell
Insert cell
unfoldedMap.addDataset({
uuid: 'world-cities',
label: 'World Cities',
data: worldCitiesCSV
}, false) // don't autoCreateLayers
Insert cell
Insert cell
unfoldedMap.addLayer({
id: 'world-cities-point-layer',
type: 'point',
config: {
dataId: 'world-cities',
label: ' World Cities',
columns: {
'lat': 'latitude',
'lng': 'longitude'
},
isVisible: true,
}
})
Insert cell
Insert cell
Insert cell
Insert cell
mapSDK = import('https://unpkg.com/@unfolded/map-sdk@0.3.1/dist/index.js?module')
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more