Last active
June 20, 2017 17:40
-
-
Save patrickarlt/f4b2c31eefa768c0de15 to your computer and use it in GitHub Desktop.
Babel with the ArcGIS JS API!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require(['./map.js'], function (map) { | |
// application bootstrap. dojo freaks out if you load a file via a script tag that uses define | |
// so you can load your appliation here via require. | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
babel map-es6.js --modules amd -o map.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>JS API and Babel</title> | |
<link rel="stylesheet" href="http://js.arcgis.com/3.12/esri/css/esri.css"> | |
<style> | |
html, body,#map { | |
width: 100%; | |
height: 100%; | |
margin: 0; | |
} | |
</style> | |
</head> | |
<body> | |
<div id="map"></div> | |
<script src="http://js.arcgis.com/3.12/"></script> | |
<script src="boostrap.js"></script> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Map from 'esri/map'; | |
var map = new Map("map", { | |
center: [-118, 34.5], | |
zoom: 8, | |
basemap: "topo" | |
}); | |
export default map; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
define(["exports", "module", "esri/map"], function (exports, module, _esriMap) { | |
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; }; | |
var Map = _interopRequire(_esriMap); | |
var map = new Map("map", { | |
center: [-118, 34.5], | |
zoom: 8, | |
basemap: "topo" | |
}); | |
module.exports = map; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment