POST
|
Thought I should expand on this. I think it would be best to save these graphics serverside and if possible with a unique name so that the users can have multiple sets of edits. I want to be able to give them a drop down box so that they can bring in different versions of the grapic's for the same map. I hope that makes some sense.
... View more
05-26-2015
05:35 AM
|
0
|
0
|
494
|
POST
|
I'm importing our stores which are in CAD (DWG) files into our ArcGIS system. They are stores and I want them to be in the right location on the map and the right size so that I can use measure and draw tools and get accurate measurement information when I upload them into Server? What is the best way to do this?
... View more
03-24-2015
11:11 AM
|
0
|
0
|
3656
|
POST
|
I was so excited to try this but it did not seem to work. I wish I was smart enough to understand why it is not working or how to add it to a save button but I am not. Any thoughts Advance Draw Tool Guy? BTW - Maybe I was using it wrong. It is my understanding that since we were invoking the editor on the click event that I didn't need to do anything else. However, when I added the code and then drew some stuff and came back in my drawings were gone. I looked at the right click events and don't see where I would do anything else.
... View more
05-19-2015
06:54 PM
|
0
|
0
|
195
|
POST
|
I think part of my problem was that at one point we were using the layer title and then in the second part using the Layer.id. I named them different in my real code vs my fiddle example code. Sometimes it is just the simple stuff that is easy to over look. //---Start of remove layer if it exists. for (var i = toc.layerInfos.length - 1; i >= 0; i--) { if (toc.layerInfos[i].title === "StoresResultsLayer") { toc.layerInfos.splice(i, 1); break; } } for (var i = map.layerIds.length - 1; i >= 0; i--) { var currentLayer = map.getLayer(map.layerIds); if (currentLayer.id == 'Stores Results') { map.removeLayer(map.getLayer(map.layerIds)); break; }; } toc.refresh(); //---- End of remove layer if it exists.
... View more
10-09-2014
06:44 AM
|
0
|
0
|
1025
|
POST
|
Michael, Here is the code for doing that: I am not sure if you are noticing but I have moved the Get Results button click handler and function inside the scope of the projects function again (AMD coding style).
<!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>Map with legend</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">
<link rel="stylesheet" type="text/css" href="http://gmaps-utility-gis.googlecode.com/svn/tags/agsjs/latest/build/agsjs/css/agsjs.css" />
<style>
html,
body {
height: 97%;
width: 98%;
margin: 1%;
}
#rightPane {
width: 20%;
}
#legendPane {
border: solid #97DCF2 1px;
}
</style>
<script>
var dojoConfig = {
packages: [{
name: "agsjs",
"location": 'http://gmaps-utility-gis.googlecode.com/svn/tags/agsjs/latest/build/agsjs' // for xdomain load
}]
};
</script>
<script src="http://js.arcgis.com/3.9/"></script>
<script>
var map, layerState, layerCounty, layerCity, toc;
require([
"esri/map", "esri/layers/FeatureLayer",
"dojo/_base/array", "dojo/parser", "agsjs/dijit/TOC", "dijit/registry",
"dijit/layout/BorderContainer", "dijit/layout/ContentPane",
"dijit/layout/AccordionContainer", "dojo/domReady!", "esri/layers/ArcGISDynamicMapServiceLayer", "dojo/_base/array",
], function (
Map, FeatureLayer,
arrayUtils, parser, TOC, registry, BorderContainer, ContentPane, AccordionContainer, domReady, ArcGISDynamicMapServiceLayer, array
) {
parser.parse();
map = new Map("map", {
basemap: "oceans",
center: [-86, 30],
zoom: 6
});
layerState = new FeatureLayer("http://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer/2", {
mode: FeatureLayer.MODE_ONDEMAND,
id: 'State'
});
layerCounty = new FeatureLayer("http://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer/3", {
mode: FeatureLayer.MODE_ONDEMAND,
id: 'County'
});
map.on("layers-add-result", function (evt) {
toc = new TOC({
map: map,
layerInfos: [{
layer: layerState,
title: "States",
collapsed: true
},
{
layer: layerCounty,
title: "Counties"
}]
}, 'legendDiv');
toc.startup();
toc.on('toc-node-checked', function (evt) {
if (evt.rootLayer) {
if (evt.rootLayer.id === "County") {
layerCity.setVisibility(evt.checked);
}
}
});
});
map.addLayers([layerCounty, layerState]);
var test = registry.byId("btnCities").on("click", function () {
test.remove(); //this can only be clicked once.
layerCity = new FeatureLayer("http://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer/0", {
mode: FeatureLayer.MODE_ONDEMAND,
id: 'City'
});
var h = layerCity.on("load", function () {
toc.layerInfos.splice(2, 0, {
layer: layerCity,
title: "Cities"
});
toc.refresh();
h.remove();
});
map.addLayer(layerCity);
});
registry.byId("btnStores").on("click", function () {
//---Start of remove layer if it exists.
for (var i = toc.layerInfos.length - 1; i >= 0; i--) {
if (toc.layerInfos.title === "StoresResultsLayer") {
toc.layerInfos.splice(i, 1);
break;
}
}
for (var i = map.layerIds.length - 1; i >= 0; i--) {
var currentLayer = map.getLayer(map.layerIds);
if (currentLayer.id == 'StoresResultsLayer') {
map.removeLayer(map.getLayer(map.layerIds));
break;
};
}
//---- End of remove layer if it exists.
var StoresResultsLayerURL = "http://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer";
var StoresResultsLayerOptions = {
"id": "StoresResultsLayer",
"opacity": .99,
"showAttribution": false
};
var StoresResultsLayer = new esri.layers.ArcGISDynamicMapServiceLayer(StoresResultsLayerURL, StoresResultsLayerOptions);
StoresResultsLayer.setVisibleLayers([0, 1]);
var h = StoresResultsLayer.on("load", function () {
toc.layerInfos.splice(0, 0, {
layer: StoresResultsLayer,
title: "StoresResultsLayer"
});
toc.refresh();
var rOnce = toc.on('load', function (evt) {
rOnce.remove();
toc.findTOCNode(StoresResultsLayer, 2).hide(); //hide cities in legend
toc.findTOCNode(StoresResultsLayer, 3).hide(); // hide counties in legend
});
h.remove();
});
//--- End Add Layer to TOC ---//
map.addLayer(StoresResultsLayer);
});
});
</script>
</head>
<body class="claro">
<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>
<button id="btnCities" data-dojo-type="dijit/form/Button" type="button">Add cities</button>
<button id="btnStores" dojoType="dijit.form.Button" data-dojo-props="iconClass:'dijitIconFilter'">Get Results</button>
</div>
<div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="title:'Pane 2'">
</div>
</div>
</div>
<div id="map" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'center'" style="overflow: hidden;">
</div>
</div>
</body>
</html>
... View more
10-03-2014
01:02 PM
|
1
|
0
|
411
|
POST
|
Thanks Robert: AWESOME! Is their a simple way to copy the code you put in above into notepad++ with out the line numbers? For those of you following at home Robert changed my example a little and I didn't want to change the way the event of my button was initiated so I just tweaked his code a little with the bolded part and it worked!!! var h = StoresResultsLayer.on("load", function () { toc.layerInfos.splice(3, 0, { layer: StoresResultsLayer, title: "StoresResultsLayer" }); toc.refresh(); toc.on('load', function (evt) { toc.findTOCNode(StoresResultsLayer, 0).hide(); toc.findTOCNode(StoresResultsLayer, 1).hide(); toc.findTOCNode(StoresResultsLayer, 2).hide(); }); h.remove(); });
... View more
10-03-2014
07:04 AM
|
0
|
0
|
335
|
POST
|
Ken I am still having issues with this but you already answered my original question so I opened a new one out of respect for you and the point system I think you get for answering questions. Here is a link to the new question and thanks for all of your help. https://community.esri.com/message/426872#426872
... View more
10-03-2014
05:22 AM
|
0
|
0
|
621
|
POST
|
You know, in looking at the documentation it does seem to require a feature layer! I hadn't noticed that before, and I didn't test it, but I think you made the right call there.
... View more
09-30-2014
09:07 AM
|
0
|
0
|
807
|
POST
|
Richard, you should start a new thread and attach your code for review.
... View more
09-19-2019
06:13 AM
|
0
|
0
|
300
|
POST
|
I couldn't find where I could edit my own question so I replied to it 🙂 When I say localized events I mean events such as concerts, ball games, groups coming to town for a convention, festivals etc.
... View more
08-01-2014
04:58 AM
|
0
|
0
|
208
|
POST
|
Michael, Strange, Lucas's example worked for me in both FirsFox 31 and Chrome 36
... View more
08-01-2014
06:01 AM
|
1
|
0
|
241
|
POST
|
You need to set your proxy server in code a la: esri.config.defaults.io.proxyUrl = 'http://..../proxy.ashx'; If you don't have a proxy set up on your webserver, you need to add one. There are instructions here: https://developers.arcgis.com/javascript/jshelp/ags_proxy.html - this may take some trial and error on your part if you haven't set one up before. Google for help testing. This is pre-AMD code, but hopefully it helps - it won't tell you how to solve your proxy issues (which are essentially network related), but it is an example of dynamically pulling the options. There are two selections: export options (png, jpg, pdf, etc.) and layouts. Hopefully it helps. printRequest = esri.request({
url: "http://.../rest/services/Geoprocessing/WebMapPDF/GPServer/Export%20Web%20Map",
content: { f: "json" },
callbackParamName: "callback",
handleAs: "json"//,
});
printTypes = new Array();
layoutTypes = new Array();
printRequest.then(
function (response, input) {
// load printType list
//printTypes, layoutTypes
for (var i = 0; i < response.parameters[2].choiceList.length; i++) {
printTypes.push(
{
label: response.parameters[2].choiceList,
value: response.parameters[2].choiceList
});
}
// load printLayout list
for (var i = 0; i < response.parameters[3].choiceList.length - 1; i++) { // use length -1 to omit "MAP_ONLY" option
// Build normal name of print option
layoutName = response.parameters[3].choiceList;
layoutTypes.push({ label: layoutName, value: response.parameters[3].choiceList });
}
select = dojo.byId("printExportType");
if (dojo.byId("printButton") == undefined || dojo.byId("printButton") == null) {
select = new dijit.form.Select(
{
id: "printExportType",
//name: "printExportType",
options: printTypes,
value: printTypes[0].value,
onChange: function () {
printTemplate.format = dijit.byId("printExportType").get("value");
dojo.byId("printButton").textContent = "Generate " + dijit.byId("printExportType").get("value");
}
});
dojo.place(select.domNode, dojo.byId("toolInput"), "last");
// Create combo button to select template
select = new dijit.form.Select(
{
id: "printLayoutTemplate",
name: "printLayoutTemplate",
options: layoutTypes,
value: layoutTypes[1].value,
onChange: function () {
printTemplate.layout = dijit.byId("printLayoutTemplate").get("value");
}
});
... View more
07-02-2014
03:27 PM
|
0
|
0
|
353
|
POST
|
Thanks Ken. I took a look at that but that code looks pretty old and with the example not working I've decided to go in another direction. You would think the enhancedgrid export piece would be simple with already having the data loaded in the grid. hmmm. Any suggestions anyone???
... View more
06-18-2014
10:42 AM
|
0
|
0
|
469
|
POST
|
Thanks Daniel. That was problem. I've been working on this issue for hours. Augh. I knew it was something simple as I thought I was doing everything correctly. Just was not sure what the heck was the problem. Thank-you so much for your help.
... View more
06-17-2014
08:18 AM
|
0
|
0
|
601
|
POST
|
Ken I updated everything you said but still am having the issue. Did I update everything to be the same versions of the stylesheets and the JSAPI? I have everything at 3.9!!
<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/dojo/dijit/themes/nihilo/nihilo.css">
<link rel="stylesheet" href="http://js.arcgis.com/3.9/js/esri/css/esri.css">
<link rel="stylesheet" href="css\MyMobileMacysMaps.css">
<link rel="stylesheet" type="text/css" href="https://community.esri.com//js.arcgis.com/3.9/js/dojo/dojox/layout/resources/FloatingPane.css">
<link rel="stylesheet" type="text/css" href="https://serverapi.arcgisonline.com/jsapi/arcgis/3.9/js/dojo/dojox/layout/resources/ResizeHandle.css">
<link rel="stylesheet" href="http://js.arcgis.com/3.9/js/dojo/dojox/grid/resources/Grid.css">
<link rel="stylesheet" href="http://js.arcgis.com/3.9/js/esri/css/esri.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" type="text/javascript"></script>
<script>
var dojoConfig = {
parseOnLoad: true,
packages: [{
"name": "agsjs",
"location": 'http://gmaps-utility-gis.googlecode.com/svn/tags/agsjs/latest/build/agsjs' // for xdomain load
}]
};
</script>
<script src="http://js.arcgis.com/3.9/"></script>
<script type="text/javascript" src="bookmarks/District_bookmarks.js"></script>
<script type="text/javascript" src="bookmarks/Store_bookmarks.js"></script>
<script src="jsfiles\Real_Estate_Filters.js"></script>
require([
"esri/map",
"esri/graphic",
"esri/tasks/FindTask",
"esri/tasks/FindParameters",
"esri/symbols/SimpleMarkerSymbol",
"esri/symbols/SimpleLineSymbol",
"esri/symbols/SimpleFillSymbol",
"esri/symbols/Font",
"esri/symbols/TextSymbol",
"esri/Color",
"dojo/on",
"dojo/dom",
"dijit/registry",
"dojo/_base/array",
"dojo/_base/connect",
"dojox/grid/DataGrid",
"dojo/data/ItemFileReadStore",
"dijit/form/Button",
"dojo/parser",
"dijit/layout/BorderContainer",
"dijit/layout/ContentPane",
"dojox/widget/TitleGroup",
"dijit/layout/AccordionContainer",
"dijit/layout/TabContainer",
"esri/dijit/Bookmarks",
"esri/dijit/LocateButton",
"esri/dijit/HomeButton",
"esri/dijit/BasemapGallery",
"esri/layers/ArcGISDynamicMapServiceLayer",
"esri/layers/FeatureLayer",
"esri/dijit/Measurement",
"esri/dijit/InfoWindowLite",
"esri/InfoTemplate",
"agsjs/dijit/TOC",
//Floating Panel
"dojox/layout/FloatingPane",
"dojox/layout/Dock",
"dojox/layout/ResizeHandle",
"dojo/dnd/move",
"esri/tasks/query",
//"esri.symbols.SimpleMarkerSymbol",
//Datagrid
"dojo/data/ItemFileWriteStore",
"esri/tasks/QueryTask",
"dojo/_base/Color",
"esri/Color",
"dojo/_base/connect",
"dijit/dijit",
"dojo/fx",
"esri/arcgis/utils",
"dijit/form/ToggleButton",
"dijit/TitlePane",
"dojox/form/CheckedMultiSelect",
"dojo/domReady!"
], function(
Map, Graphic, FindTask, FindParameters, SimpleMarkerSymbol, SimpleLineSymbol, SimpleFillSymbol, Font, TextSymbol,Color, on, dom, registry, arrayUtils, connect, DataGrid, ItemFileReadStore, Button, parser, BorderContainer, ContentPane, TitleGroup, AccordionContainer, TabContainer, Bookmarks, LocateButton, HomeButton, BasemapGallery, ArcGISDynamicMapServiceLayer, FeatureLayer, Measurement, InfoWindowLite, InfoTemplate, TOC, FloatingPane, Dock, ResizeHandle, move, query, ItemFileWriteStore, QueryTask, Color, ESRIColor, connect, dijit,fx, utils, ToggleButton, TitlePane
) {
... View more
06-04-2014
08:42 AM
|
0
|
0
|
294
|
Title | Kudos | Posted |
---|---|---|
1 | 04-18-2014 06:58 AM | |
6 | 08-11-2014 06:27 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|