mirror of
https://github.com/Esri/offline-editor-js.git
synced 2025-12-15 15:20:05 +00:00
100 lines
3.0 KiB
HTML
Executable File
100 lines
3.0 KiB
HTML
Executable File
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
|
"http://www.w3.org/TR/html4/loose.dtd">
|
|
<html>
|
|
<head>
|
|
<title>Jasmine Spec Runner - Tiles</title>
|
|
|
|
<link rel="shortcut icon" type="image/png" href="../vendor/jasmine-1.3.1/jasmine_favicon.png">
|
|
<link rel="stylesheet" type="text/css" href="../vendor/jasmine-1.3.1/jasmine.css">
|
|
<script type="text/javascript" src="../vendor/jasmine-1.3.1/jasmine.js"></script>
|
|
<script type="text/javascript" src="../vendor/jasmine-1.3.1/jasmine-html.js"></script>
|
|
<script type="text/javascript" src="../vendor/jasmine.async/lib/jasmine.async.js"></script>
|
|
|
|
<script>
|
|
var dojoConfig = {
|
|
paths: { tiles: location.pathname.replace(/\/[^/]+$/, "") + "../../lib/tiles" }
|
|
}
|
|
</script>
|
|
|
|
<link rel="stylesheet" href="http://js.arcgis.com/3.10/js/dojo/dijit/themes/claro/claro.css">
|
|
<link rel="stylesheet" href="http://js.arcgis.com/3.10/js/esri/css/esri.css">
|
|
<script src="http://js.arcgis.com/3.10/"></script>
|
|
|
|
<!-- include spec files here... -->
|
|
<script type="text/javascript" src="spec/offlineTilesBasicSpec.js"></script>
|
|
|
|
<script type="text/javascript">
|
|
|
|
var g_map;
|
|
var g_basemapLayer;
|
|
var g_offlineTilesBasic;
|
|
var g_tilesCore;
|
|
|
|
require(["esri/map",
|
|
"esri/layers/GraphicsLayer", "esri/graphic", "esri/symbols/SimpleFillSymbol",
|
|
"esri/dijit/Scalebar", "esri/arcgis/utils", "esri/geometry",
|
|
"dojo/dom", "dojo/on", "dojo/query",
|
|
"esri/urlUtils", "esri/geometry/webMercatorUtils",
|
|
"tiles/OfflineTilesBasic",
|
|
"dojo/dom-construct",
|
|
"../dist/offline-tiles-basic-min.js",
|
|
"dojo/domReady!"],
|
|
function(Map,
|
|
GraphicsLayer, Graphic, SimpleFillSymbol,
|
|
Scalebar, esriUtils, geometry,
|
|
dom, on, query,
|
|
urlUtils, webMercatorUtils,
|
|
OfflineTilesEnabler,
|
|
domConstruct)
|
|
{
|
|
g_map = new Map("map", {
|
|
basemap: "gray",
|
|
center: [-3.695, 40.412], // Madrid center
|
|
zoom: 14,
|
|
sliderStyle: "small"
|
|
});
|
|
|
|
g_map.on('load', test);
|
|
|
|
function test()
|
|
{
|
|
g_basemapLayer = g_map.getLayer( g_map.layerIds[0] );
|
|
|
|
g_offlineTilesBasic = new O.esri.Tiles.OfflineTilesBasic();
|
|
|
|
var jasmineEnv = jasmine.getEnv();
|
|
jasmineEnv.updateInterval = 1000;
|
|
jasmineEnv.defaultTimeoutInterval = 5000; // 15 sec
|
|
var htmlReporter = new jasmine.HtmlReporter();
|
|
|
|
jasmineEnv.addReporter(htmlReporter);
|
|
|
|
jasmineEnv.specFilter = function(spec) {
|
|
return htmlReporter.specFilter(spec);
|
|
};
|
|
|
|
var currentWindowOnload = window.onload;
|
|
|
|
window.onload = function() {
|
|
if (currentWindowOnload) {
|
|
currentWindowOnload();
|
|
}
|
|
execJasmine();
|
|
};
|
|
|
|
function execJasmine() {
|
|
jasmineEnv.execute();
|
|
}
|
|
|
|
}; // test()
|
|
|
|
}); // require()
|
|
</script>
|
|
</head>
|
|
|
|
<body>
|
|
<div id="map" style="position: absolute; bottom: 0; right: 0; height:200px; width: 200px;"></div>
|
|
<img src="" alt="" id="fakeTile" style="display:none;">
|
|
</body>
|
|
</html>
|