|
POST
|
What is the value that you're setting m_application to? If you're creating an Add-in, then you can use Private m_application As ESRI.ArcGIS.Framework.IApplication = My.ArcMap.Application
... View more
07-24-2013
05:01 AM
|
0
|
0
|
1010
|
|
POST
|
What you'll have to do is set the the layerIds property of the IdentifyParameters to the visibleLayers of your layer. identifyParams.layerIds = layerDynamic.visibleLayers;
... View more
07-24-2013
04:16 AM
|
0
|
0
|
1169
|
|
POST
|
If you look at that data in Google Earth, you also get the banding effect. There's a portion of the data that extends past 180° that looks like is what is causing the problem.
... View more
07-24-2013
04:09 AM
|
0
|
0
|
870
|
|
POST
|
Use TypeOf to determine if the layer is an IFeatureLayer (or IRasterLayer) dim pLayer as ILayer For i = 0 To LayerCount - 1 pLayer = pMap.Layer(i) If TypeOf pLayer Is IFeatureLayer Then 'Vector ElseIf TypeOf pLayer Is IRasterLayer Then 'Raster End If next i
... View more
07-23-2013
09:27 AM
|
0
|
0
|
1321
|
|
POST
|
If you're looking to turn off a single layer within the map service, take a look at nliu's Table of Contents(TOC)/Legend Widget.
... View more
07-23-2013
04:41 AM
|
0
|
0
|
2305
|
|
POST
|
Can you post your code or create a Fiddle to show what the problem is?
... View more
07-22-2013
04:59 AM
|
0
|
0
|
660
|
|
POST
|
You're adding the service to the map several time, so even when you turn off a layer in operationalLayer5, you still have the censusMapLayer, operationalLayer, and operationalLayer4 layers showing. You could make them invisible, or set up a listener on the operationalLayer5 to change the visibleLayers property on all the others. Something like
operationalLayer5.on("update-end", function (event) {
if (event.error !== undefined) {
console.log("Update complete with error: " + event.error);
}
censusMapLayer.visibleLayers = operationalLayer5.visibleLayers;
});
Now that your application is getting to the state that it's working, please use the "The post was helpful" up arrow on the helpful posts and when appropriate, the "Click to mark this post as answered" check.
... View more
07-19-2013
06:21 AM
|
0
|
0
|
4249
|
|
POST
|
I've come across this issue also, but it's an intermittent problem. Here's a Fiddle that uses the dGrid that stores the results of the IndentifyTask on different visible layers of a service and put them into different tabs on a TabContainer. I had set this up for a post asking if anyone knew how to dynamically set the width of different grids in a TabContainer. The grids have variable heights, depending on how many rows are returned from each IndentifyTask. This was set in css using .dgrid-grid { height: auto; width: 700px; } I agree that the documentation of dGrid is not very good
... View more
07-19-2013
05:55 AM
|
0
|
0
|
1957
|
|
POST
|
Taking a look at the website shows the initOperationalLayer error, as well as an error in the locate2.html file. map = new esri.Map("map", { basemap: "topo", showAttribution: false, logo: false, center: [-68.95921478269354, 12.201009750494986], zoom: 11 console.log("ASDAS"); <--this has to be moved outside the map initializer });
... View more
07-18-2013
02:11 PM
|
0
|
0
|
7475
|
|
POST
|
The firewall in my organization doesn't like sbshows.com, so I can't see that page. However, in the Fiddle, you haven't defined the createBasemapGallery function, so it's stopping when you call that function. **Edit After commenting that line out, the next error is on the line map.on("load", initOperationalLayer); where you don't have initOperationalLayer defined. Have you used Firebug (or its equivalents) to debug the code? [ATTACH=CONFIG]26047[/ATTACH]
... View more
07-18-2013
12:00 PM
|
0
|
0
|
4249
|
|
POST
|
What would be more helpful if you could get the Fiddle into a state (or create a new project) where it replicates the problem with the code that you're using. As much as I'm trying to help, trying to figure out what's causing the problem by piecing together parts of your code is tough.
... View more
07-18-2013
10:58 AM
|
0
|
0
|
4249
|
|
POST
|
Using this code
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=7,IE=9" />
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no" />
<title>TOC</title>
<link rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.4/js/dojo/dijit/themes/claro/claro.css">
<link rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.4/js/esri/css/esri.css">
<style>
html, body
{
height: 100%;
width: 100%;
margin: 0;
padding: 0px;
font-family: helvetica, arial, sans-serif;
font-size: 90%;
}
#leftPane
{
width: 280px;
overflow: auto;
}
/* this line hide layers when out of scale for the inline TOC */
#scaleDiv .agsTOCOutOfScale
{
display: none;
}
</style>
<script type="text/javascript">
var djConfig = {
parseOnLoad: true,
packages: [{
"name": "agsjs",
"location": location.pathname.replace(/\/[^/]+$/, "") + '/agsjs'
//"location": 'http://gmaps-utility-gis.googlecode.com/svn/tags/agsjs/2.04/xbuild/agsjs' // for xdomain load
}]
};
</script>
<script src="http://serverapi.arcgisonline.com/jsapi/arcgis/3.5/"></script>
<script type="text/javascript">
var map;
require([
"dojo/_base/connect",
"dojo/parser",
"dojo/ready",
"esri/map",
"agsjs/dijit/TOC",
"esri/arcgis/utils",
"dijit/layout/BorderContainer",
"dijit/layout/ContentPane",
"dojox/layout/ExpandoPane",
"dijit/layout/AccordionContainer",
"dojo/domReady!"
], function (
connect, parser, ready,
Map) {
ready(function () {
//parser.parse();
});
map = new esri.Map("map", {
basemap: "topo",
showAttribution: false,
logo: false,
center: [-68.95921478269354, 12.201009750494986],
zoom: 11
});
map.resize();
var censusMapLayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://curacaogis.com/ArcGIS/rest/services/Ryan/Ryan_Service/MapServer");
map.addLayers([censusMapLayer]);
var operationalLayer = new esri.layers.FeatureLayer("http://curacaogis.com/ArcGIS/rest/services/Ryan/Ryan_Service/FeatureServer", {
mode: esri.layers.FeatureLayer.MODE_ONDEMAND,
outFields: ["Adres", "Buurten", "B_STATUS", "FUNCTIE", "LENGTH", "WEGKLASSE", "STRAATNAAM", "Oneway"]
});
operationalLayer.setSelectionSymbol(new esri.symbol.SimpleFillSymbol());
map.addLayer(operationalLayer);
var operationalLayer4 = new esri.layers.FeatureLayer("http://curacaogis.com/ArcGIS/rest/services/Ryan/Ryan_Service/FeatureServer", {
id: 'operationalLayer4'
});
map.addLayer(operationalLayer4);
var operationalLayer5 = new esri.layers.ArcGISDynamicMapServiceLayer("http://curacaogis.com/ArcGIS/rest/services/Ryan/Ryan_Service/MapServer", {
id: 'operationalLayer5'
});
map.addLayer(operationalLayer5);
var imageParameters = new esri.layers.ImageParameters();
imageParameters.layerIds = [0];
imageParameters.layerOption = esri.layers.ImageParameters.LAYER_OPTION_SHOW;
//can also be: LAYER_OPTION_EXCLUDE, LAYER_OPTION_HIDE, LAYER_OPTION_INCLUDE
layer = new esri.layers.ArcGISDynamicMapServiceLayer("http://curacaogis.com/ArcGIS/rest/services/Ryan/Ryan_Service/MapServer", { "imageParameters": imageParameters });
map.addLayer(layer);
connect.connect(map, 'onLayersAddResult', function (results) {
var toc = new agsjs.dijit.TOC({
map: map,
layerInfos: [{
layer: operationalLayer5,
title: "Legend",
slider: true
}]
}, 'tocDiv');
toc.startup();
console.log("Set TOC");
});
var resizeTimer;
connect.connect(map, 'onLoad', function (theMap) {
connect.connect(dijit.byId('map'), 'resize', function () { //resize the map if the div is resized
clearTimeout(resizeTimer);
resizeTimer = setTimeout(function () {
map.resize();
map.reposition();
}, 500);
});
});
}
);
</script>
</head>
<body class="claro">
<div id="content" dojotype="dijit.layout.BorderContainer" design="headline" gutters="true" style="width: 100%; height: 100%; margin: 0;">
<div id="leftPanel" data-dojo-type="dojox.layout.ExpandoPane" data-dojo-props=" splitter:true, region:'leading'" style="width: 250px; height: 200px; display: hidden;">
<div dojoattachevent="ondijitclick:toggle" aria-controls="leftPanel" tabindex="0" class="dojoxExpandoIcon dojoxExpandoIconLeft1" dojoattachpoint="iconNode"></div>
<div data-dojo-type="dijit.layout.AccordionContainer" style="height: 80%;">
<div dojotype="dijit.layout.ContentPane" title="Standard Style">
<div id="tocDiv">
</div>
<p>--------------------</p>
<div id="measurementDiv"></div>
<p>--------------------</p>
<div data-dojo-props="title:'Editing Tools'">
Editing Tool Pane
<div id="templateDiv"></div>
<div id="editorDiv">
</div>
</div>
</div>
</div>
</div>
<div id="map" dojotype="dijit.layout.ContentPane" region="center">
</div>
</div>
</body>
</html>
I get this page [ATTACH=CONFIG]26042[/ATTACH] Can you make a Fiddle using your code that shows the problem you're having?
... View more
07-18-2013
08:10 AM
|
0
|
0
|
4249
|
|
POST
|
Changing the lines in red makes it work in Fiddle.
<script type="text/javascript">
var djConfig = {
parseOnLoad: true,
packages: [{
"name": "agsjs",
//"location": location.pathname.replace(/\/[^/]+$/, "") + '/agsjs'
"location": 'http://gmaps-utility-gis.googlecode.com/svn/tags/agsjs/2.04/xbuild/agsjs' // for xdomain load
}]
};
</script> Can you instead post the code that you're having problems with?
... View more
07-18-2013
05:49 AM
|
0
|
0
|
3226
|
|
POST
|
Can you use Fiddle or Plunker to create an example that shows this problem?
... View more
07-18-2013
05:34 AM
|
0
|
0
|
3226
|
|
POST
|
OK...I think I figured out the problem. If you don't set the layerInfo, all the layers in the map will be added to the TOC. However, it looks like you cannot add a FeatureLayer to the TOC. According to the docs, layerInfo will only take a ArcGISTiledMapServiceLayer or ArcGISDynamicMapServiceLayer. Here's a sample I created that works
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=7,IE=9" />
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no" />
<title>TOC</title>
<link rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.4/js/dojo/dijit/themes/claro/claro.css">
<link rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.4/js/esri/css/esri.css">
<style>
html, body
{
height: 100%;
width: 100%;
margin: 0;
padding: 0px;
font-family: helvetica, arial, sans-serif;
font-size: 90%;
}
#leftPane
{
width: 280px;
overflow: auto;
}
/* this line hide layers when out of scale for the inline TOC */
#scaleDiv .agsTOCOutOfScale
{
display: none;
}
</style>
<script type="text/javascript">
var djConfig = {
parseOnLoad: true,
packages: [{
"name": "agsjs",
"location": location.pathname.replace(/\/[^/]+$/, "") + '/agsjs'
//"location": 'http://gmaps-utility-gis.googlecode.com/svn/tags/agsjs/2.04/xbuild/agsjs' // for xdomain load
}]
};
</script>
<script src="http://serverapi.arcgisonline.com/jsapi/arcgis/3.5/"></script>
<script type="text/javascript">
var map;
require([
"dojo/_base/connect",
"dojo/parser",
"dojo/ready",
"esri/map",
"agsjs/dijit/TOC",
"esri/arcgis/utils",
"dijit/layout/BorderContainer",
"dijit/layout/ContentPane",
"dojo/domReady!"
], function (
connect, parser, ready,
Map) {
ready(function () {
//parser.parse();
});
map = new esri.Map("map", {
basemap: "topo",
showAttribution: false,
logo: false,
center: [-68.95921478269354, 12.201009750494986],
zoom: 11
});
map.resize();
var censusMapLayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://curacaogis.com/ArcGIS/rest/services/Ryan/Ryan_Service/MapServer");
map.addLayers([censusMapLayer]);
var operationalLayer = new esri.layers.FeatureLayer("http://curacaogis.com/ArcGIS/rest/services/Ryan/Ryan_Service/FeatureServer", {
mode: esri.layers.FeatureLayer.MODE_ONDEMAND,
outFields: ["Adres", "Buurten", "B_STATUS", "FUNCTIE", "LENGTH", "WEGKLASSE", "STRAATNAAM", "Oneway"]
});
operationalLayer.setSelectionSymbol(new esri.symbol.SimpleFillSymbol());
map.addLayer(operationalLayer);
var operationalLayer4 = new esri.layers.FeatureLayer("http://curacaogis.com/ArcGIS/rest/services/Ryan/Ryan_Service/FeatureServer", {
id: 'operationalLayer4'
});
map.addLayer(operationalLayer4);
var operationalLayer5 = new esri.layers.ArcGISDynamicMapServiceLayer("http://curacaogis.com/ArcGIS/rest/services/Ryan/Ryan_Service/MapServer", {
id: 'operationalLayer5'
});
map.addLayer(operationalLayer5);
var imageParameters = new esri.layers.ImageParameters();
imageParameters.layerIds = [0];
imageParameters.layerOption = esri.layers.ImageParameters.LAYER_OPTION_SHOW;
//can also be: LAYER_OPTION_EXCLUDE, LAYER_OPTION_HIDE, LAYER_OPTION_INCLUDE
layer = new esri.layers.ArcGISDynamicMapServiceLayer("http://curacaogis.com/ArcGIS/rest/services/Ryan/Ryan_Service/MapServer", { "imageParameters": imageParameters });
map.addLayer(layer);
connect.connect(map, 'onLayersAddResult', function (results) {
var toc = new agsjs.dijit.TOC({
map: map,
layerInfos: [{
layer: operationalLayer5,
title: "Legend",
slider: true
}]
}, 'tocDiv');
toc.startup();
console.log("Set TOC");
});
var resizeTimer;
connect.connect(map, 'onLoad', function (theMap) {
connect.connect(dijit.byId('map'), 'resize', function () { //resize the map if the div is resized
clearTimeout(resizeTimer);
resizeTimer = setTimeout(function () {
map.resize();
map.reposition();
}, 500);
});
});
}
);
</script>
</head>
<body class="claro">
<div id="content" dojotype="dijit.layout.BorderContainer" design="headline" gutters="true" style="width: 100%; height: 100%; margin: 0;">
<div dojotype="dijit.layout.ContentPane" id="leftPane" region="left" splitter="true">
<div id="tocDiv">
</div>
</div>
<div id="map" dojotype="dijit.layout.ContentPane" region="center">
</div>
</div>
</body>
</html>
... View more
07-17-2013
12:37 PM
|
0
|
0
|
3226
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-04-2025 06:39 AM | |
| 1 | 05-01-2026 08:26 AM | |
| 1 | 04-10-2026 12:01 PM | |
| 1 | 04-13-2026 09:11 AM | |
| 1 | 10-11-2023 06:18 AM |
| Online Status |
Offline
|
| Date Last Visited |
Wednesday
|