|
POST
|
Jens, do you have an organizational account or a free account? If you have a free account, then you can only add zipped shapefiles directly to a map, you can't add files to your content and then add them to a map. If you have an organizational account, then you can upload feature services, through ArcGIS Desktop to your content and then you are able to add them from there to your map. Please let me know what kind of account you have. Tim
... View more
11-19-2014
05:25 AM
|
0
|
3
|
1065
|
|
POST
|
You can always use a change symbol tab in arcgis online and use the Add Image option. This will enable you to use custom symbols.
... View more
11-13-2014
09:16 AM
|
0
|
0
|
774
|
|
POST
|
Check out the attached code. You will need an identify task.
... View more
11-12-2014
12:32 PM
|
0
|
0
|
1740
|
|
POST
|
Like this? Javascript API - Aerial Information Widget
... View more
11-12-2014
12:11 PM
|
0
|
3
|
1739
|
|
POST
|
You had attribute inspector in there twice (once misspelled) and it is "dijit/form/Button" not "esri/form/Button" I also changed it from Legacy style new esri.map to AMD style new map
... View more
11-12-2014
09:48 AM
|
0
|
1
|
1626
|
|
POST
|
This should do it!
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!--The viewport meta tag is used to improve the presentation and behavior of the samples
on iOS devices-->
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
<title></title>
<link rel="stylesheet" href="http://js.arcgis.com/3.11/dijit/themes/nihilo/nihilo.css">
<link rel="stylesheet" href="http://js.arcgis.com/3.11/esri/css/esri.css">
<link rel="stylesheet" href="css/layout.css">
//<script>var dojoConfig = { parseOnLoad: true };</script>
<script src="http://js.arcgis.com/3.11/"></script>
<script>
require([
"esri/map",
"dijit/layout/BorderContainer",
"dijit/layout/ContentPane",
"dijit/layout/AccordionContainer",
"esri/layers/FeatureLayer",
"esri/dijit/AttributeInspector",
"esri/graphic",
"esri/config",
"dojo/dom",
"dojo/on",
"dojo/_base/array",
"esri/toolbars/draw",
"dojo/dom-construct",
"dojo/parser",
"esri/toolbars/draw",
"esri/dijit/editing/TemplatePicker",
"dijit/form/Button",
"dojo/domReady!"
], function(
Map,
BorderContainer,
ContentPane,
AccordionContainer,
FeatureLayer,
AttributeInspector,
Graphic,
esriConfig,
dom,
on,
array,
Draw,
domConstruct,
parser,
draw,
TemplatePicker,
Button
) {
parser.parse();
esriConfig.defaults.io.proxyUrl = "/proxy";
var map, updateFeature;
map = new Map("map", {
basemap: "streets",
center: [-114.2, 51.06],
zoom: 12
});
on(map, "layers-add-result", initEditing);
var home = new HomeButton({
map: map
}, "HomeButton");
home.startup();
var geoLocate = new LocateButton({
map: map
}, "LocateButton");
geoLocate.startup();
on(map, "layers-add-result", initEditing);
var pointLayer = new FeatureLayer("http://gismap2.calgary.ca/arcgis/rest/services/LUPP_Testing/CitizenComments/FeatureServer/0", {
mode: FeatureLayer.MODE_SNAPSHOT,
outFields: ["*"]
});
map.addLayers([pointLayer]);
function initEditing(results) {
var layers = [results.layers[0].layer];
var templatePicker = new TemplatePicker({
featureLayers: layers,
rows: 'auto',
columns: 'auto',
grouping: true
}, "templatePickerDiv");
templatePicker.startup();
var drawToolbar = new Draw(map);
var selectedTemplate;
on(templatePicker, "selection-change", function() {
selectedTemplate = templatePicker.getSelected();
if (selectedTemplate) {
switch (selectedTemplate.featureLayer.geometryType) {
case "esriGeometryPoint":
drawToolbar.activate(esri.toolbars.Draw.POINT);
break;
}
}
});
on(drawToolbar, "draw-end", function(geometry) {
updateFeature = geometry;
console.log(updateFeature);
if (map.infoWindow.isShowing) {
map.infoWindow.hide();
}
drawToolbar.deactivate();
var fieldAttributes = layerFieldToAttributes(selectedTemplate.featureLayer.fields);
var newAttributes = dojo.mixin(fieldAttributes, selectedTemplate.template.prototype.attributes);
var newGraphic = new Graphic(geometry, null, newAttributes);
var layerInfos = [{
'featureLayer': selectedTemplate.featureLayer,
'isEditable': true,
'showAttachments': true,
fieldInfos: [
{ fieldName: "NAME", label: "NAME:", isEditable: true },
{ fieldName: "EMAIL", label: "EMAIL:", isEditable: true },
{ fieldName: "PHONE", label: "PHONE:", isEditable: true },
{ fieldName: "CITIZEN_COMMENT", label: "COMMENT:", isEditable: true, 'stringFieldOption': 'textarea' }
]
}];
var attInspector = new AttributeInspector({
layerInfos: layerInfos
}, domConstruct.create("div"));
var saveButton = new Button({ label: "Save", "class": "saveButton"});
domConstruct.place(saveButton.domNode, attInspector.deleteBtn.domNode, "after");
saveButton.on("click", function(){
map.infoWindow.hide();
});
selectedTemplate.featureLayer.applyEdits([newGraphic], null, null, function() {
var screenPoint = map.toScreen(getInfoWindowPositionPoint(newGraphic));
map.infoWindow.setContent(attInspector.domNode);
map.infoWindow.resize(400,400); //(325, 185);
map.infoWindow.show(screenPoint, map.getInfoWindowAnchor(screenPoint));
templatePicker.clearSelection();
});
on(attInspector, "attribute-change", function(evt) {
evt.feature.attributes[evt.fieldName] = evt.fieldValue;
evt.feature.getLayer().applyEdits(null, [evt.feature], null);
});
//delete a point
on(attInspector, "delete", function(evt) {
evt.feature.getLayer().applyEdits(null, null, [evt.feature]);
map.infoWindow.hide();
});
});
}
//removing this code makes it so that the info window does not open
function getInfoWindowPositionPoint(feature) {
var point;
switch (feature.getLayer().geometryType) {
case "esriGeometryPoint":
point = feature.geometry;
break;
}
return point;
}
//required for info window
function layerFieldToAttributes(fields) {
var attributes = {};
dojo.forEach(fields, function(field) {
attributes[field.name] = null;
});
return attributes;
}
});
//dojo.require("dijit.layout.BorderContainer");
//dojo.require("dijit.layout.ContentPane");
//dojo.require("dijit.layout.AccordionContainer");
//dojo.require("esri.map");
//dojo.require("esri.dijit.HomeButton");
//dojo.require("esri.dijit.LocateButton");
//var map;
//function init() {
// map = new esri.Map("map", {
// basemap: "topo",
// center: [-118.404, 34.054],
// zoom: 11
// });
//}
//var home = new HomeButton({
// map: map
//}, "HomeButton");
//home.startup();
//var geoLocate = new LocateButton({
// map: map
//}, "LocateButton");
//geoLocate.startup();
//dojo.ready(init);
</script>
</head>
<body class="nihilo">
<div id="mainWindow" data-dojo-type="dijit.layout.BorderContainer"
data-dojo-props="design:'headline', gutters:false" style="width:100%; height:100%;">
<div id="header" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'top'">
This is the HEADER section
<div id="subheader">with a subheader</div>
</div>
<div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'left'" id="leftPane">
<div data-dojo-type="dijit.layout.AccordionContainer">
<div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="title:'Legend'">
Content for pane 1
</div>
<div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="title:'Add Comment'">
<p>Content for pane 2</p>
<div id="templatePickerDiv"></div>
</div>
<!--<div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="title:'pane 3'">
<p>Content for pane 3</p>
</div>-->
</div>
</div>
<div id="map" class="shadow" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'center'">
<div id="HomeButton"></div>
<div id="LocateButton"></div>
</div>
<!--<div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'right'" id="rightPane">
This is the right section
</div>-->
<div id="footer" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'bottom'">
this is the footer section
</div>
</div>
</body>
</html>
... View more
11-12-2014
09:47 AM
|
0
|
2
|
1626
|
|
POST
|
I just thought of another way that might work. You could change the tooltip depending on which button you press? For example: on(registry.byId("AreaButton"), "click", function () { esri.bundle.toolbars.draw.start = "Click to start drawing a search area"; }); on(registry.byId("LineButton"), "click", function () { esri.bundle.toolbars.draw.start = "Click to start drawing a search line"; });
... View more
11-10-2014
06:44 AM
|
0
|
0
|
2503
|
|
POST
|
Olivia, Maybe you could create a custom window, if there is no way to do it with the native ESRI tooltips? I have an example here: http://jsfiddle.net/timw1984/5398h/ I know this is not an answer to your question but I hope it helps Tim
... View more
11-10-2014
06:40 AM
|
0
|
0
|
2503
|
|
POST
|
Karen, instead of AND use OR. When you use AND it looks for a row that has all of the LANDCODE you specify in it. With OR it selects each number. Tim
... View more
11-10-2014
06:34 AM
|
1
|
0
|
1981
|
|
POST
|
This should do it:
<!DOCTYPE html>
<html>
<head>
<title>Create a Map</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1,maximum-scale=1, user-scalable=no">
<link rel="stylesheet" href="http://js.arcgis.com/3.11/dijit/themes/claro/claro.css">
<link rel="stylesheet" href="http://js.arcgis.com/3.11/esri/css/esri.css">
<style>
html, body, #mapDiv
{
padding:0;
margin:0;
height:100%;
}
</style>
<script src="http://js.arcgis.com/3.11/"></script>
<script>
var map;
require(["esri/map", "esri/layers/ArcGISTiledMapServiceLayer", "esri/layers/ArcGISDynamicMapServiceLayer",
"dojo/dom", "dojo/on", "dojo/parser", "esri/geometry/Extent", "dojo/domReady!"], function (Map, Tiled, ArcGISDynamicMapServiceLayer, dom, on, parser, Extent
) {
var initialExtent = new Extent({"xmin":777229.03,"ymin":1133467.92,"xmax":848340.14,"ymax":1185634.58,"spatialReference":{"wkid":3435}});
map = new Map("mapDiv", {
showAttribution: false,
sliderStyle: "large",
extent: initialExtent
});
// add imagery
var tiled = new Tiled("http://maps.decaturil.gov/arcgis/rest/services/Aerial_2014_Tiled/MapServer");
map.addLayer(tiled);
// set operational layers
var baseLayer = new ArcGISDynamicMapServiceLayer("http://maps.decaturil.gov/arcgis/rest/services/Base/MapServer");
var operationalLayer = new ArcGISDynamicMapServiceLayer("http://maps.decaturil.gov/arcgis/rest/services/Public/InternetVector/MapServer", { "opacity": 0.5 });
// add operational layers
map.addLayer(baseLayer);
map.addLayer(operationalLayer);
}
);
</script>
</head>
<body class="soria">
<div id="mapDiv">
</div>
</body>
</html>
... View more
11-07-2014
12:24 PM
|
2
|
2
|
1307
|
|
POST
|
I think instead of pause you need to remove it and then add it again after else.
... View more
11-07-2014
11:15 AM
|
0
|
2
|
2770
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 07-06-2015 06:58 AM | |
| 1 | 05-04-2016 07:27 AM | |
| 1 | 07-06-2017 08:12 AM | |
| 1 | 10-26-2015 11:51 AM | |
| 1 | 12-12-2014 12:05 PM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|