-
Notifications
You must be signed in to change notification settings - Fork 9
/
quickstart.html
41 lines (37 loc) · 2.59 KB
/
quickstart.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<html>
<head>
<meta charset="utf-8"/>
<meta http-equiv="x-ua-compatible" content="ie=edge"/>
<!-- EMP relies on the mil-sym library and its CSS and font files These should be loaded before the EMP library. We recommend using the version of the mil-sym library bundled in the EMP releases as we do testing with that version to ensure compatibility -->
<link href="vendor/mil-sym/renderer.css" rel="stylesheet" type="text/css"/>
<script src='vendor/mil-sym/savm-bc.js' type="text/javascript"></script>
<!-- The EMP API and core code loads as a single minified library, however the implementation of a specific map engine, such as Cesium or Leaflet, gets loaded at runtime when instantiating and instance of the emp3.api.Map as you will see below -->
<script src='emp3/emp3.min.js' type="text/javascript"></script>
</head>
<body>
<div style="position: absolute; top: 0px; left: 0px; right: 0px; bottom: 0px;" id="empmap"></div>
<script type="text/javascript">
window.onload = function() {
// Create an new EMP emp3.api.Map instance. EMP allows for multiple, uniquely addressable map instances to be on same web page. Overlays and features can be added to multiple maps and their state will be mirrored on both map instances as a shared reference
var map1 = new emp3.api.Map({
// Container should match the id of a DIV on the page where the EMP map instance will display. EMP allows multiple map instances to run on the same page and each instance needs to be in a separate DIV
container: "empmap",
// Here you must specify an EMP engine. Currently EMP support Cesium, Leaflet, and is adding support for NASA World Wind Web.
// The engineBasePath is relative to the HTML file using the EMP API. If you place the emp3 folder in the same folder as you html file, the paths in this example will work for you
engine: {
engineBasePath: "emp3/emp3-cesium",
mapEngineId: "cesium"
},
onSuccess: function() {
// Here you receive an event that the EMP map instance is ready to be used. This can take a while especially the first time an engine is loaded. If the engine is used in the application more than once, it is opnly loaded once and is faster for additional instance. If the resources get cached by browser, then this will also make future loading faster as well
console.log("Map creation success.");
},
onError: function(args) {
// Here you receive an event if any errors occurred while initializing the map instance
console.log("Map creation failed.");
}
});
};
</script>
</body>
</html>