<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=7, IE=9, IE=10"> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no" /> <title>Simple Map</title> <link rel="stylesheet" href="http://js.arcgis.com/3.9/js/dojo/dijit/themes/claro/claro.css"> <link rel="stylesheet" href="http://js.arcgis.com/3.9/js/esri/css/esri.css"> <style> html, body { height: 100%; width: 100%; margin: 0; padding: 0; } #map { height: 100%; } #rightPane { width: 30%; } #legendPane { border: solid #97DCF2 1px; } #bottomPane { height: 200px; } </style> <script src="http://js.arcgis.com/3.9/"></script> <script> var map; require([ "esri/map", "esri/dijit/Scalebar", "esri/dijit/OverviewMap", "esri/dijit/Legend", "esri/InfoTemplate", "esri/dijit/InfoWindowLite", "esri/layers/FeatureLayer", "dojo/parser", "dojo/dom-construct", "dijit/layout/BorderContainer", "dijit/layout/ContentPane", "dojo/domReady!", ], function ( Map, Scalebar, OverviewMap, Legend, InfoTemplate, InfoWindowLite, FeatureLayer, parser, domConstruct ) { parser.parse(); map = new Map("map", { basemap: "topo", center: [-76.869806, 39.218776], zoom: 15 }); var scalebar = new Scalebar({ map: map, scalebarUnit: "dual" }); var overviewMapDijit = new OverviewMap({ map: map, visible: true }); overviewMapDijit.startup(); map.on("layers-add-result", function (evt) { var layerInfo = arrayUtils.map(evt.layers, function (layer, index) { return { layer: layer.layer, title: layer.layer.name }; }); if (layerInfo.length > 0) { var legendDijit = new Legend({ map: map, layerInfos: layerInfo }, "legendDiv"); legendDijit.startup(); } }); var infoWindow = new InfoWindowLite(null, domConstruct.create("div", null, null, map.root)); infoWindow.startup(); map.setInfoWindow(infoWindow); var template = new InfoTemplate(); template.setTitle("<b>${Address} - ${Street}</b>"); //add a layer to the map var featureLayer = new FeatureLayer("http://arcgisserver/arcgis/rest/services/Projectfolder/Projectname/MapServer/1", { mode: FeatureLayer.MODE_ONDEMAND, infoTemplate: template, outFields: ["Pipe_Size", "Pipe_Type"] }); map.addLayer(featureLayer); map.infoWindow.resize(200, 75); }); //add the legend </script> </head> <body class="claro"> <!--[if IE 7]> <style> html, body { margin: 0; } </style> <![endif]--> <div id="content" data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="design:'headline', gutters:true" style="width: 100%; height: 100%; margin: 0;"> <div id="rightPane" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'right'"> <div data-dojo-type="dijit/layout/AccordionContainer"> <div data-dojo-type="dijit/layout/ContentPane" id="legendPane" data-dojo-props="title:'Legend', selected:true"> <div id="legendDiv"></div> </div> <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="title:'Pane 2'"> This pane could contain tools or additional content </div> </div> </div> <div id="map" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'center'" style="overflow:hidden;"> </div> <div id="bottomPane" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'bottom'"> <div id="grid"></div> </div> </div> </body> </html>
Re: Is it possible to convert a csv layer to an animated graphic (pulsing point)?
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1.0, width=device-width, maximum-scale=1.0, user-scalable=no">
<!-- meta tags to hide url and minimize status bar to give the web app
a native app look this only happens after app is saved to the desktop-->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="translucent-black">
<title>Geolocation API</title>
<link rel="stylesheet" href="http://js.arcgis.com/3.11/esri/css/esri.css">
<!-- Details about the Webkit CSS Properties http://css-infos.net/properties/webkit.php
and http://www.pointabout.com/category/development-blog/pointabout-dev-help/-->
<style>
html, body #map {
height: 100%;
margin: 0px;
padding: 0px;
width: 100%;
}
@-webkit-keyframes
pulse
{
0%
opacity: 1.0;
45%
opacity: .20;
100%
@-moz-keyframes
#map_graphics_layer {
-webkit-animation-duration: 3s;
-webkit-animation-iteration-count: infinite;
-webkit-animation-name: pulse;
-moz-animation-duration: 3s;
-moz-animation-iteration-count: infinite;
-moz-animation-name: pulse;
</style>
<script src="http://js.arcgis.com/3.11/"></script>
<script>
var map, csv;
require([
"esri/map",
"esri/layers/CSVLayer",
"esri/Color",
"esri/symbols/SimpleMarkerSymbol",
"esri/renderers/SimpleRenderer",
"esri/InfoTemplate",
"esri/urlUtils",
"esri/geometry/Point",
"esri/graphic",
"dojo/domReady!"
], function(
Map, CSVLayer, Color, SimpleMarkerSymbol, SimpleRenderer, InfoTemplate, urlUtils, Point, Graphic
) {
urlUtils.addProxyRule({
proxyUrl: "/proxy/",
urlPrefix: "MYSITE.com"
});
map = new Map("map", {
basemap: "gray",
center: [ -60, -10 ],
zoom: 4
csv = new CSVLayer("http://MYSITE.com/2.5_weekz.csv", {
copyright: "Echologics"
var orangeRed = new Color([238, 69, 0, 0.5]); // hex is #ff4500
var marker = new SimpleMarkerSymbol("solid", 15, null, orangeRed);
var renderer = new SimpleRenderer(marker);
csv.setRenderer(renderer);
var template = new InfoTemplate("${type}", "${place}");
csv.setInfoTemplate(template);
map.addLayer(csv);
graphic = new Graphic(csv)
map.graphics.add(graphic);
</script>
</head>
<body>
<div id="map"></div>
</body>
</html>
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.