mirror of
https://github.com/Esri/offline-editor-js.git
synced 2025-12-15 15:20:05 +00:00
150 lines
4.8 KiB
HTML
150 lines
4.8 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
|
"http://www.w3.org/TR/html4/loose.dtd">
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<title>Jasmine Spec Runner - Graphics Store</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: { edit: location.pathname.replace(/\/[^/]+$/, "") + "../../lib/edit" }
|
|
}
|
|
</script>
|
|
|
|
<link rel="stylesheet" href="http://js.arcgis.com/3.12/dijit/themes/claro/claro.css">
|
|
<link rel="stylesheet" href="http://js.arcgis.com/3.12/esri/css/esri.css">
|
|
<script src="http://js.arcgis.com/3.12/"></script>
|
|
<script src="//github.hubspot.com/offline/offline.min.js"></script>
|
|
|
|
<!-- include spec files here... -->
|
|
<script type="text/javascript" src="spec/editsStoreSpec2.js"></script>
|
|
<script type="text/javascript">
|
|
"use strict"
|
|
|
|
var g_map;
|
|
var g_test = {};
|
|
var g_editsStore;
|
|
var esriGraphic;
|
|
|
|
require(["esri/map",
|
|
"esri/layers/GraphicsLayer", "esri/graphic", "esri/symbols/SimpleFillSymbol", "esri/symbols/SimpleMarkerSymbol", "esri/symbols/SimpleLineSymbol",
|
|
"esri/SpatialReference","esri/geometry",
|
|
"dojo/dom", "dojo/on", "dojo/query",
|
|
"dojo/dom-construct",
|
|
"../dist/offline-edit-advanced-src.js",
|
|
"dojo/domReady!"],
|
|
function(Map,
|
|
GraphicsLayer, Graphic, SimpleFillSymbol, SimpleMarkerSymbol, SimpleLineSymbol,
|
|
SpatialReference, geometry,
|
|
dom, on, query,
|
|
domConstruct)
|
|
{
|
|
/*
|
|
g_map = new Map("map", {
|
|
basemap: "gray",
|
|
center: [-3.695, 40.412], // Madrid center
|
|
zoom: 14,
|
|
sliderStyle: "small"
|
|
});
|
|
|
|
g_map.on('load', test);
|
|
*/
|
|
esriGraphic = Graphic;
|
|
|
|
g_editsStore = new O.esri.Edit.EditStore();
|
|
test();
|
|
|
|
function initTestData()
|
|
{
|
|
// some geometry
|
|
g_test.point = new esri.geometry.Point(11,-11, new SpatialReference({"wkid":4326 }));
|
|
g_test.line = new esri.geometry.Polyline({
|
|
"paths":[[[-122.68,45.53], [-122.58,45.55],[-122.57,45.58],[-122.53,45.6]]],
|
|
"spatialReference":{"wkid":4326}});
|
|
g_test.polygon = new esri.geometry.Polygon({
|
|
"rings":[[[-122.63,45.52],[-122.57,45.53],[-122.52,45.50],[-122.49,45.48],[-122.64,45.49],[-122.63,45.52],[-122.63,45.52]]],
|
|
"spatialReference":{"wkid":4326 }
|
|
});
|
|
|
|
// some symbols
|
|
g_test.pointSymbol = new SimpleMarkerSymbol({"color": [255,255,255,64],
|
|
"size": 12, "angle": -30,
|
|
"xoffset": 0, "yoffset": 0,
|
|
"type": "esriSMS", "style": "esriSMSCircle",
|
|
"outline": { "color": [0,0,0,255], "width": 1, "type": "esriSLS", "style": "esriSLSSolid"}
|
|
});
|
|
|
|
g_test.lineSymbol = new SimpleLineSymbol({
|
|
"type": "esriSLS", "style": "esriSLSDot",
|
|
"color": [115,76,0,255],"width": 1
|
|
});
|
|
|
|
g_test.polygonSymbol = new SimpleFillSymbol({
|
|
"type": "esriSFS",
|
|
"style": "esriSFSSolid",
|
|
"color": [115,76,0,255],
|
|
"outline": { "type": "esriSLS", "style": "esriSLSSolid", "color": [110,110,110,255], "width": 1 }
|
|
});
|
|
|
|
g_test.pointFeature = new Graphic( g_test.point, g_test.pointSymbol, {"name": "the name of the feature", "objectid":2});
|
|
g_test.lineFeature = new Graphic( g_test.line, g_test.lineSymbol, {"nombre": "España","objectid":5});
|
|
g_test.polygonFeature = new Graphic( g_test.polygon, g_test.polygonSymbol, {"nombre": "España","timestamp": new Date().getTime(), "objectid":8});
|
|
|
|
g_test.newPointFeature = new Graphic( g_test.point, g_test.pointSymbol, {"name": "the name of the feature", "objectid":-1});
|
|
g_test.newPointFeatureUpdated = new Graphic( g_test.point, g_test.pointSymbol, {"name": "the name of the feature modified", "objectid":-1});
|
|
|
|
console.log(g_test);
|
|
}
|
|
|
|
function test()
|
|
{
|
|
try
|
|
{
|
|
initTestData();
|
|
console.log("everything ok!");
|
|
|
|
var jasmineEnv = jasmine.getEnv();
|
|
jasmineEnv.updateInterval = 1000;
|
|
jasmineEnv.defaultTimeoutInterval = 10000; // 10 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();
|
|
};
|
|
}
|
|
catch(err)
|
|
{
|
|
alert(err);
|
|
}
|
|
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>
|