POST
|
I have been playing with the API in VB.net and can not get a geometry from the GetGeometry() function. According to the C# examples: PointShapeBuffer pointGeometry = row.GetGeometry(); point = pointGeometry.point; In Vb.net the GetGeometry function explicity states it returns a ShapeBuffer. It will not accept a CType converstion to PointShapeBuffer, and will not accept a PointShapeBuffer as an output. The Help states the Geometry function returns a ShapeBuffer so I do not understand how to get a point from (Get)Geometry function. Any advice would be appreciated. David Hi David, I am running into a very similar issue on casting ShapeBuffer to MultipartBuffer. I find the cast works with .NET Wrapper-C#, but not with VB.net. I don't know why exactly the cast fails with VB.net, and I am trying to find out too. I guess it has something to do with generated C++\CLI .NET code. But, anyway, give C# a try, hope it also fix the issue at your end too. Thanks.
... View more
08-16-2012
05:31 AM
|
0
|
0
|
537
|
POST
|
You can modify the toolbarOptions to include/exclude merge, cut, and reshape tools on the toolbar. But I believe all the others tools have been embedded in the toolbar by design. I don't think you can remove them. toolbarOptions: {
reshapeVisible: false,
cutVisible: false,
mergeVisible: false
}
... View more
07-20-2012
02:20 PM
|
0
|
0
|
555
|
POST
|
Hi Bill, Thank you for pointing this out. Just a quick tip I want to share with you, if you haven't used it. To find out the correct path, an easy way is to use a web development tool (e.g. Firebug, Fiddler, and etc.) to track the requests. I used firebug for this case, and firebug shows which path it looks into for the image. That is how I found out the popup.png needs to be put in the wwwroot/images folder. Hope this tip is helpful. Thanks. [ATTACH=CONFIG]16287[/ATTACH]
... View more
07-20-2012
09:05 AM
|
0
|
0
|
589
|
POST
|
The online sample gets a "popup.png" from http://help.arcgis.com/en/webapi/javascript/arcgis/demos/images/popup.png. The "popup.png" contains the close, minimize, next arrow, and etc icons. When you put the sample onto your IIS, it tries to get the "popup.png" from http://<your server name>/images/popup.png. But because the image doesn't exist on your IIS, it returns NetworkError: 403 Not Found error. So, please go ahead to download the "popup.png" and put it into your wwwroot/images folder. It shall fix the issue.
... View more
07-20-2012
08:07 AM
|
0
|
0
|
589
|
POST
|
I think you are experiencing [NIM042441 The layerOption LAYER_OPTION_VISIBLE not working as expected while using Identify Task.]. The LAYER_OPTION_VISIBLE seems only response to the default visible layers in the map service. To workaround this, as amarsden did, please assign the list of visible layer to the IdentifyParameters.layerIds property, which can force the identify task to only perform the find operation on the specified layers.
... View more
07-17-2012
10:14 AM
|
0
|
0
|
933
|
POST
|
The ArcGISDynamicMapServiceLayer.setVisibleLayers(ids, doNotRefresh?) method only takes an array of layer IDs. But, you can use a 2D array to hold the layer name and id information, which can be used later to get the layer's id from this 2D array based on the layer's name. For example: var items = [["One", 0],["Two", 1],["Three", 2]]; //format: [name,id] Note: check service REST endpoint to get the information about layer name and id
var visible =[];
var lyrName = "Three"; //layer wants to be turned on
for (var i = 0; i < items.length; i++){
if (items[0] == lyrName) {
visible.push(items[1]);
break;
}
}
agsDynamicMapServiceLayer.setVisibleLayers(visible);
... View more
07-17-2012
08:52 AM
|
0
|
0
|
261
|
POST
|
I don't understand it. If I copy and paste your code into a fresh document and hit it in a browser, I get a webmap with the ESRI layers and both Legend and TOC work just fine. Then the only thing I change is to paste the URL for my map service in place of the quakes layer, and refresh. The map loads, the data displays, and the legend populates, but the checkboxes for the TOC are gone. It won't even show the checkboxes for the other ESRI sublayers. What is it about my map service that breaks the TOC? http://map.entrix.com/ArcGIS/rest/services/07856001/titan_working_20111220_acw/MapServer Try this one:
... View more
07-17-2012
05:37 AM
|
0
|
0
|
790
|
POST
|
Thanks, that did fix the triple legend issue for me. But, when I have pulled in my own map service it does not show up in the table of contents with checkboxes. It does however appear in the legend. I"m not sure what's keeping it from working in the TOC. I add the checkboxes to the "dojo.byId("layer_list").innerHTML". So, it depends on where the "layer_list" element is defined in the HTML, in the TOC or Legend ContentPane. <div dojoType="dijit.layout.ContentPane" title="TOC" >
<span style="padding:10px 0;" id="layer_list"></span>
<div id="toggle" style="padding: 2px 2px;"></div>
</div>
... View more
07-16-2012
07:02 AM
|
0
|
0
|
790
|
POST
|
Hi Shuping, The code works fine with the esri sample server, but when i replace it with my map service neither the TOC nor the legend gets created. I am interested only in TOC though. Am i missing anything here? Are you working with ArcGIS 10.0 or newer map service? If it is a 10.0 SP1 or newer map service, you can check its legend resource directly at the REST endpoint via URL: http://<mapservice-url>/legend e.g. http://sampleserver4.arcgisonline.com/ArcGIS/rest/services/Elevation/ESRI_Elevation_World/MapServer/legend Does yours legend show up at the REST endpoint?
... View more
07-16-2012
06:43 AM
|
0
|
0
|
790
|
POST
|
To change the visibility of each individual layer in the map, you need to work with the ArcGISDynamicMapServiceLayer.setVisibleLayers() method. To change the visibility of each individual layer in the legend control, you need to work with the Legend.hideLayers property. Then follow by calling Legend.fefresh() method. Update: I tested again and found there seems no need to use the Legend.hideLayers property. The legend control knows which layer has changed its visibility. Attached is the updated sample. Correct: In the #6 post, code lines #92 and #113 have spell errors. They should be "legend.hideLayers=hide;". I missed the "e". Sorry. 🙂
... View more
07-13-2012
04:32 PM
|
0
|
0
|
790
|
POST
|
That's really weird. I just tried your code again to make sure. I pasted your code into a fresh document and hit it with IE and FF. In FF the legend appears normal, but in IE9 I get the tripled legend. Umm....My IE9 works fine with it. Try to clear the browser cache to see if it helps. Hey Curt, Update: I found tripled legend issue is reproducible in 32-bit IE. The issue is caused by the unnecessary call of "legend.refresh();" in the "buildLayerList()" function. Go ahead and remove it. The app shall runs correctly this time. [ATTACH=CONFIG]16065[/ATTACH]
... View more
07-13-2012
06:49 AM
|
0
|
0
|
790
|
POST
|
Here is the example with 10.1 sample WorldTimeZones service. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=7,IE=9" /> <!--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> Add WMTS Layer </title> <link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.0/js/dojo/dijit/themes/claro/claro.css"> <style> html, body { height: 100%; width: 100%; margin: 0; padding: 0; } .esriScalebar{ padding: 20px 20px; } #map{ padding:0; } #citationInfo{ position:absolute; color:black; font-weight:bold; font-size:12pt; left:10px; bottom:10px; z-Index:999; } </style> <script type="text/javascript">var djConfig = {parseOnLoad: true};</script> <script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=3.0"></script> <script type="text/javascript"> dojo.require("esri.map"); dojo.require("esri.layers.wmts"); dojo.require("esri.dijit.Scalebar"); dojo.require("dijit.layout.BorderContainer"); dojo.require("dijit.layout.ContentPane"); function init() { esri.config.defaults.io.proxyUrl = "http://<server name>/proxy.ashx"; var initExtent = new esri.geometry.Extent({"xmin":-20037508.343,"ymin":-8861125.013,"xmax":20037508.343,"ymax":8861125.013,"spatialReference":{"wkid":3587}}); var map = new esri.Map("map", { wrapAround180: true, extent: initExtent }); var layerInfo = new esri.layers.WMTSLayerInfo({ identifier: "WorldTimeZones", tileMatrixSet: "nativeTileMatrixSet", format: "png" }); var options = { serviceMode: "RESTful", layerInfo: layerInfo }; var wmtsLayer = new esri.layers.WMTSLayer("http://servicesbeta4.esri.com/arcgis/rest/services/WorldTimeZones/MapServer/WMTS",options); map.addLayer(wmtsLayer); } dojo.addOnLoad(init); </script> </head> <body class="claro"> <div dojotype="dijit.layout.BorderContainer" design="headline" gutters="false" style="width: 100%; height: 100%; margin: 0;"> <div id="map" dojotype="dijit.layout.ContentPane" region="center" > </div> </div> </body> </html> FYI: Please remember to change the proxy url to yours.
... View more
07-13-2012
06:40 AM
|
0
|
0
|
445
|
POST
|
You need to define an array of LODs (Levels of Detail) to specify the zoom levels. Each LOD corresponds to a map at a given scale or resolution. Then, apply the array of LODs in the map constructor as an option. For example: function init() {
var lods = [
{"level" : 13, "resolution" : 19.1092570712683, "scale" : 72223.819286},
{"level" : 14, "resolution" : 9.55462853563415, "scale" : 36111.909643},
{"level" : 15, "resolution" : 4.77731426794937, "scale" : 18055.954822},
{"level" : 16, "resolution" : 2.38865713397468, "scale" : 9027.977411},
{"level" : 17, "resolution" : 1.19432856685505, "scale" : 4513.988705},
{"level" : 18, "resolution" : 0.597164283559817, "scale" : 2256.994353},
{"level" : 19, "resolution" : 0.298582141647617, "scale" : 1128.497176}
];
var initExtent = new esri.geometry.Extent({"xmin":-1.3074977201954123E7,"ymin":4015620.159117397,"xmax":-1.3073987658308368E7,"ymax":4016419.790346289,"spatialReference":{"wkid":102100}});
map = new esri.Map("map",{extent:initExtent, lods:lods});
var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer");
map.addLayer(basemap);
var dynamicLyr = new esri.layers.ArcGISDynamicMapServiceLayer("http://sampleserver6.arcgisonline.com/arcgis/rest/services/PoolPermits/MapServer");
map.addLayer(dynamicLyr);
dojo.connect(map, 'onLoad', function(theMap) {
dojo.connect(dijit.byId('map'), 'resize', map,map.resize);
});
} FYI: You can look into the REST endpoint of the World_Street_Map service and pick the LODs you need. If you decide to use another tiled map service, make sure you look into that service's REST endpoint and pick up the correct LODs.
... View more
07-12-2012
06:04 PM
|
0
|
0
|
523
|
POST
|
Have you checked this post? InfoWindow shows up in wrong place after zoom You should try to only show the InfoWindow AFTER the map has finished changing extent. Listening to the 'onExtentChange' event would be one way to handle this situation.
... View more
07-12-2012
04:43 PM
|
0
|
0
|
197
|
POST
|
I assume your 'LegendWrapper' is an esri.dijit.Legend object. I am able to wipe the legend dijit in and out. My Legend object's id is "basicWipeNode" which applies a the dom node. Further sample of dojo.fx.wipeOut can be found at dojotoolkit.org. Hope this helps. Thanks. Here is my codes: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=7,IE=9" />
<!--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" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.0/js/dojo/dijit/themes/claro/claro.css">
<style>
html, body { height: 98%; width: 98%; margin: 0; padding: 5px; }
#rightPane{
width:20%;
}
#legendPane{
border: solid #97DCF2 1px;
}
</style>
<script type="text/javascript">var djConfig = {parseOnLoad: true};</script>
<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=3.0"></script>
<script type="text/javascript">
dojo.require("dijit.layout.BorderContainer");
dojo.require("dijit.layout.ContentPane");
dojo.require("dijit.layout.AccordionContainer");
dojo.require("esri.map");
dojo.require("esri.dijit.Legend");
dojo.require("esri.layers.FeatureLayer");
dojo.require("dojo.fx");
dojo.require("dijit.form.Button");
var map;
function init() {
var initialExtent = new esri.geometry.Extent({"xmin":-10753431,"ymin":4624151,"xmax":-10737799,"ymax":4635884,"spatialReference":{"wkid":102100}});
map = new esri.Map("map", { extent: initialExtent});
map.addLayer(new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"));
var rivers = new esri.layers.FeatureLayer("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Hydrography/Watershed173811/MapServer/1", {
mode: esri.layers.FeatureLayer.MODE_ONDEMAND,
outFields: ["*"]
});
//add the legend
dojo.connect(map,'onLayersAddResult',function(results){
var layerInfo = dojo.map(results, function(layer,index){
return {layer:layer.layer,title:layer.layer.name};
});
if(layerInfo.length > 0){
var legendDijit = new esri.dijit.Legend({
map:map,
id: "basicWipeNode",
layerInfos:layerInfo
},"legendDiv");
legendDijit.startup();
}
wipeIt(); //wipe in
});
map.addLayers([rivers]);
dojo.connect(map, 'onLoad', function(theMap) {
dojo.connect(dijit.byId('map'), 'resize', map,map.resize);
});
}
function wipeIt(){
dojo.style("basicWipeNode", "display", "none");
var wipeArgs = {
node: "basicWipeNode",
duration: 1000
};
dojo.fx.wipeIn(wipeArgs).play();
}
function wipeOut(){
dojo.style("basicWipeNode", "height", "");
dojo.style("basicWipeNode", "display", "block");
var wipeArgs = {
node: "basicWipeNode",
duration: 1000
};
dojo.fx.wipeOut(wipeArgs).play();
}
dojo.addOnLoad(init);
</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="rightPane" dojotype="dijit.layout.ContentPane" region="right">
<div dojoType="dijit.layout.AccordionContainer">
<div dojoType="dijit.layout.ContentPane" id="legendPane" title="Legend" selected="true" >
<div id="legendDiv"></div>
</div>
</div>
</div>
<div id="map" dojotype="dijit.layout.ContentPane" region="center" style="overflow:hidden;">
<button data-dojo-type="dijit.form.Button" id="basicWipeButton" onclick="wipeOut">Wipe It Out!</button>
</div>
</div>
</body>
</html>
... View more
07-12-2012
01:15 PM
|
0
|
0
|
153
|
Title | Kudos | Posted |
---|---|---|
4 | 10-25-2023 06:36 AM | |
2 | 09-27-2023 07:16 AM | |
1 | 09-20-2023 09:17 AM | |
2 | 09-07-2023 07:48 AM | |
2 | 08-27-2020 11:32 AM |
Online Status |
Offline
|
Date Last Visited |
03-05-2024
08:58 PM
|