-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExtension_CapaDinamica.html
46 lines (45 loc) · 1.49 KB
/
Extension_CapaDinamica.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
42
43
44
45
46
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
<title>Fijar una extensión y cargar una capa dinámica</title>
<link rel="stylesheet" href="https://js.arcgis.com/3.27/esri/css/esri.css"/>
<style>
html, body, #mapDiv{
padding: 0;
margin: 0;
height: 100%;
}
</style>
<script src="https://js.arcgis.com/3.27/"></script>
<script>
var map;
require([
"esri/map",
"esri/layers/ArcGISDynamicMapServiceLayer",
"esri/layers/FeatureLayer",
"esri/geometry/Extent",
"esri/SpatialReference"
], function (
Map,
ArcGISDynamicMapServiceLayer,
FeatureLayer,
Extent,
SpatialReference) {
var xmin = -7047846.594920191,
ymin = 5268180.6785623655,
xmax = 5328837.0250122575,
ymax = 9181756.52676235,
sr = new SpatialReference({ wkid:102100 }),
e = new Extent(xmin, ymin, xmax, ymax, sr);
map = new Map("mapDiv", {extent: e});
var dynamicMapServiceLayer = new ArcGISDynamicMapServiceLayer("https://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Population_World/MapServer");
map.addLayer(dynamicMapServiceLayer);
});
</script>
</head>
<body>
<div id="mapDiv"></div>
</body>
</html>