|
POST
|
I would like to turn off the default zoom icon (+/-) on the map using js api 2.3. I did not see this as one of the options in the map attributes. <style type="text/css"> .esriSimpleSlider { display:none;} </style>
... View more
06-13-2011
05:45 AM
|
0
|
0
|
694
|
|
POST
|
I am doing a update testing my app (2.2 to 2.3) on the same issue. It is interesting. In version 2.2, drawing a extent by clicking on the map actually did return a extent with xmin ==xmax and ymin==ymax. In version 2.3 it is not working any more!!!. I am thinking about modifying my code to deal with it. So anyone's input on this is appreciated. after playing around a little bit. i came up with a workaround. Here is the sample page, you can try yourself if interested. <!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" /> <!--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>Identify by clicked point or a drawed extent</title> <link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.3/js/dojo/dijit/themes/claro/claro.css" /> <script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.3"></script> <script type="text/javascript"> dojo.require("esri.map"); dojo.require("esri.toolbars.draw"); //global variables var map; var tb; var startPt; var endPt; var doIdentify = false; var theExtent; function init() { //create map, set initial extent and disable default info window behavior map = new esri.Map("map", { extent: esri.geometry.geographicToWebMercator(new esri.geometry.Extent(-125.90, 44.60, -114.65, 50.22, new esri.SpatialReference({ wkid: 4326 }))), showInfoWindowOnClick: false }); dojo.connect(map, "onLoad", function(map) { dojo.connect(dijit.byId('map'), 'resize', resizeMap); tb = new esri.toolbars.Draw(map); dojo.connect(tb, "onDrawEnd", addGraphic); }); map.addLayer(new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer")); dojo.connect(map, "onMouseDown", startDraw); dojo.connect(map, "onMouseUp", endDraw); } function addGraphic(geometry) { var symbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_NULL, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,0]), 2)); theExtent = new esri.Graphic(geometry, symbol); map.graphics.add(theExtent); } function resizeMap() { var resizeTimer; clearTimeout(resizeTimer); resizeTimer = setTimeout(function() { map.resize(); map.reposition(); }, 500); } function startDraw(evt) { if (doIdentify) { startPt = evt.mapPoint; } else return; } function endDraw(evt) { if (doIdentify) { endPt = evt.mapPoint; //alert("Start Point x=" + startPt.x + " y=" + startPt.y); //alert("End Point x=" + endPt.x + " y=" + endPt.y); if (startPt.x == endPt.x && startPt.y == endPt.y) alert("You identify feature by clicking on the map!"); else alert("You identify feature by drawing an extent on the map!"); /* you can add your identify logic here * for example use startPt or theExtent to do query */ //reset startPt = null; endPt = null; doIdentify = false; theExtent = null; map.enablePan(); tb.deactivate(); } else return; } function startIdentify() { map.graphics.clear(); tb.activate(esri.toolbars.Draw.EXTENT); map.disablePan(); doIdentify = true; } dojo.addOnLoad(init); </script> </head> <body class="claro"> <button onclick="startIdentify();">identify</button> <!-- map div --> Click the identify button to start identification<div id="map" style="width:800px; height:400px; border:1px solid #000;"></div> </body> </html>
... View more
06-10-2011
12:56 PM
|
0
|
0
|
1640
|
|
POST
|
Hi all, I'm trying to figure out how to use the Draw toolbar to allow a user to draw either a point or an extent. I'm trying to use this for the identify tool. I don't want the user to have to select either point or extent, I want the application to be intelligent enough to determine if the user has clicked a single point, or clicked and dragged the mouse to enclose an extent. The problem I'm running into is if the Draw toolbar is in EXTENT mode, a single click starts drawing, and another single click finishes the drawing. I want a single click to represent a point. Is this possible? Also, am I doing this the wrong way? Is there a better way for the user to be able to identify from either a point or an extent? This code seems like it would work, but since the Draw toolbar doesn't fire the "onDrawEnd" event on a single click if drawing an EXTENT, it doesn't.
var drawToolbar = new esri.toolbars.Draw(map);
drawToolbar.activate(esri.toolbars.Draw.EXTENT);
dojo.connect(drawToolbar, "onDrawEnd", function (geom) {
if(geom.xmin == geom.xmax && geom.ymin == geom.ymax) {
geom = new esri.geometry.Point(geom.xmin, geom.ymin, geom.spatialReference);
}
// execute an identifyTask using geom
});
Thanks for your help. I am doing a update testing my app (2.2 to 2.3) on the same issue. It is interesting. In version 2.2, drawing a extent by clicking on the map actually did return a extent with xmin ==xmax and ymin==ymax. In version 2.3 it is not working any more!!!. I am thinking about modifying my code to deal with it. So anyone's input on this is appreciated.
... View more
06-10-2011
09:45 AM
|
0
|
0
|
1640
|
|
POST
|
The attribute inspector date calendar displays the date stored in the feature's date field. New fields don't have a value so the default date of January 1, 1970 is displayed. You can modify this by setting the date's value to the current date (or whatever value you'd like) when a new feature is created. To do this listen for the feature layer's 'onBeforeApplyEdits' event and update the date for the newly added feature(s). In the sample below 'pointsOfInterest' is the feature layer whose date field you want to update.
dojo.connect(pointsOfInterest,"onBeforeApplyEdits",function(adds,updates,deletes){
//update the date field for new features to be today's date.
dojo.forEach(adds,function(add){
add.attributes.notedate = new Date().getTime();
});
});
What a smart solution i miss! thanks Kelly!!
... View more
06-10-2011
07:13 AM
|
0
|
0
|
2695
|
|
POST
|
Hey all, I have a quick question regarding the ArcGIS Rest end points.... What is the "Maximum Allowable Offset" parameter? I know it generalizes on the fly (fantastic) but what are the units? Is it in meters? radians? rubber chickens? Thanks! To my understanding, Maximum Allowable Offset means the map distance ( usually per pixel) within which two points are considered identical. It is used to generalize thus reduce the number of points (vetices) displayed on the map. It should be in map unit(for 102100, is meters).
... View more
06-10-2011
06:10 AM
|
0
|
0
|
3333
|
|
POST
|
jmaxwell1562;98218 wrote: I am having exactly the same problem. I've copied your structure and the buffer part is working but the identify part is not. Could you offer some suggestions? Jill, The logic flow is right though it is kind hard to read. I rearranged your code so it might be easier for you to debug. Here is the code (i might have typos or syn errors, you have to look into when debugging). var map, InfoqueryTask; var featureSet; var navToolbar; var actionMode ="identify"; //default var gsvc; var queryTask; function init() { esriConfig.defaults.io.proxyUrl = "http://dingo.gapanalysisprogram.com/proxy/proxy.ashx"; //esri.config.defaults.io.proxyUrl = "http://www.gap.uidaho.edu/proxy.php"; esriConfig.defaults.io.alwaysUseProxy = false; var startExtent = new esri.geometry.Extent({"xmin":-11207421,"ymin":4469708,"xmax":-10718224,"ymax":4836606,"spatialReference":{"wkid":102100}} ); //create map map = new esri.Map("mapDiv", {extent: startExtent}); dojo.connect(map, "onClick", doActionAccordingly); dojo.connect(map, "onLoad", function() { map.disableDoubleClickZoom(); }); var tiledLayer = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"); map.addLayer(tiledLayer); //create and add new layer var dynamicLayer = new esri.layers.ArcGISTiledMapServiceLayer("http://dingo.gapanalysisprogram.com/ArcGIS/rest/services/PADUS/PADUS_status/MapServer"); map.addLayer(dynamicLayer); //Listent for infoWindow onHide event dojo.connect(map.infoWindow, "onHide", function() {map.graphics.clear();}); //build query task InfoqueryTask = new esri.tasks.QueryTask("http://dingo.gapanalysisprogram.com/ArcGIS/rest/services/PADUS/PADUS_status/MapServer/0"); dojo.connect(InfoqueryTask, "onComplete", onInfoqueryComplete); navToolbar = new esri.toolbars.Navigation(map); dojo.connect(navToolbar, "onExtentHistoryChange", extentHistoryChangeHandler); //Geometry Service Endpoint gsvc = new esri.tasks.GeometryService("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"); // +++++Listen for GeometryService onBufferComplete event+++++ dojo.connect(gsvc, "onBufferComplete", onBufferComplete); queryTask = new esri.tasks.QueryTask("http://dingo.gapanalysisprogram.com/ArcGIS/rest/services/PADUS/PADUS_owner/MapServer/0"); // +++++Listen for QueryTask executecomplete event+++++ dojo.connect(queryTask, "onComplete", onQueryComplete); } function extentHistoryChangeHandler() { dijit.byId("zoomprev").disabled = navToolbar.isFirstExtent(); dijit.byId("zoomnext").disabled = navToolbar.isLastExtent(); } function executeInfoQueryTask(evt) { dojo.disconnect(globals); map.infoWindow.hide(); map.graphics.clear(); featureSet = null; //build query filter var Infoquery = new esri.tasks.Query(); Infoquery.outSpatialReference = { "wkid": 102100 }; Infoquery.returnGeometry = true; Infoquery.outFields = ["P_Des_Nm", "OBJECTID", "GIS_Acres", "GAP_Sts", "Own_Name", "Mang_Name"]; Infoquery.geometry = evt.mapPoint; //Execute task and call showResults on completion InfoqueryTask.execute(Infoquery); } function onInfoqueryComplete(fset) { if (fset.features.length === 1) { showFeature(fset.features[0],evt); } else if (fset.features.length !== 0) { showFeatureSet(fset,evt); } } function showFeature(feature,evt) { map.graphics.clear(); //set symbol var symbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,0]), 2), new dojo.Color([255,255,0,0.5])); feature.setSymbol(symbol); //construct infowindow title and content var attr = feature.attributes; var title = attr.P_Des_Nm; var content = "Park Name : " + attr.P_Des_Nm + "<br />GAP Status : " + attr.GAP_Sts + "<br />Mang_Name : " + attr.Own_Name + "<br />GIS_Acres : " + attr.GIS_Acres; map.graphics.add(feature); map.infoWindow.setTitle(title); map.infoWindow.setContent(content); $((evt) ? map.infoWindow.show(evt.screenPoint,map.getInfoWindowAnchor(evt.screenPoint)) : null); } function showFeatureSet(fset,evt) { //remove all graphics on the maps graphics layer map.graphics.clear(); var screenPoint = evt.screenPoint; featureSet = fset; var numFeatures = featureSet.features.length; //QueryTask returns a featureSet. Loop through features in the featureSet and add them to the infowindow. var title = "You have selected " + numFeatures + " protected areas."; var content = "Please select desired field from the list below.<br />"; for (var i=0; i<numFeatures; i++) { var graphic = featureSet.features; content = content + graphic.attributes.P_Des_Nm + " Field (<A href='#' onclick='showFeature(featureSet.features[" + i + "]);'>show</A>)<br/>"; } map.infoWindow.setTitle(title); map.infoWindow.setContent(content); map.infoWindow.show(screenPoint,map.getInfoWindowAnchor(evt.screenPoint)); } function executeBuffer(evt) { // Query var bufferquery = new esri.tasks.Query(); map.graphics.clear(); var bufferparams = new esri.tasks.BufferParameters(); bufferparams.geometries = [evt.mapPoint]; // Buffer in linear units such as meters, km, miles etc. bufferparams.distances = [dojo.byId('bufferDistance').value]; bufferparams.unit = esri.tasks.GeometryService.UNIT_STATUTE_MILE; bufferparams.bufferSpatialReference = new esri.SpatialReference({ "wkid": 3089 }); bufferparams.outSpatialReference = new esri.SpatialReference({ "wkid": 3089 }); gsvc.buffer(bufferparams); dojo.byId('messages').innerHTML = "<b>Creating Buffer Using Geometry Service...</b>"; } function onBufferComplete(geometries) { var symbol = new esri.symbol.SimpleFillSymbol("none", new esri.symbol.SimpleLineSymbol("dashdot", new dojo.Color([255,0,0]), 2), new dojo.Color([255,255,0,0.25])); var graphic = new esri.Graphic(geometries[0],symbol); map.graphics.add(graphic); bufferquery.returnGeometry = true; bufferquery.outFields = ["P_Des_Nm","P_Loc_Nm","Own_Name","Mang_Name"]; bufferquery.outSpatialReference = map.spatialReference; bufferquery.geometry = geometries[0]; //query.where = "quadrangle_name='Adairville'" queryTask.execute(bufferquery); dojo.byId('messages').innerHTML = "<b>Executing Query with Result Buffer Geometry...</b>"; } function onQueryComplete(fset) { //create symbol for selected features var symbol = new esri.symbol.SimpleMarkerSymbol(); symbol.style = esri.symbol.SimpleMarkerSymbol.STYLE_SQUARE; symbol.setSize(8); symbol.setColor(new dojo.Color([255,255,0,0.5])); //var infoTemplate = new esri.InfoTemplate("Block: ${BLOCK}", "${*}"); var resultFeatures = fset.features; for (var i=0, il=resultFeatures.length; i<il; i++) { console.log(resultFeatures); var graphic = resultFeatures; graphic.setSymbol(symbol); map.graphics.add(graphic); } var pareas = returnRecordNums(fset); var r = ""; r = "<b>The protected areas within the buffer are <i>" + pareas + "</i>.</b>"; dojo.byId('messages').innerHTML = r; } function returnRecordNums(fset) { var features = fset.features; var pas = ""; for (var x = 0; x < features.length; x++) { pas = pas + ", " + features .attributes['P_Des_Nm']; } return pas; } function doActionAccordingly(evt) { switch (actionMode) { case "identify": executeInfoQueryTask(evt); break; case "bufferQuery": executeBuffer(evt); // remember reset actionMode ="identify" after finish buffer query actionMode = "identify"; //alert('buffer'); break; } } function bufferBtn_onclick() { //set action mode to buffer actionMode ="bufferQuery"; } dojo.addOnLoad(init);
... View more
06-10-2011
05:27 AM
|
0
|
0
|
1320
|
|
POST
|
I have the same question. The link posted above is not helpful at all. How is it possible to override this default behavior with the attribute inspector? I don't think it's reasonable to expect users to click 41 times from 1970 to 2011 just to set a date. I was also perplexed by why it is changed from 2.2 for no good reasons. I have tried to overwrit this by the following code without success. Can ESRI or anyone enlight me on this? code added on http://help.arcgis.com/en/webapi/javascript/arcgis/demos/ed/ed_attributeInspectorValidate.html .... var myDateDijit = new dijit.form.DateTextBox({ //regExp: "/^(1[0-2]|0?[1-9])\/(3[01]|[12]\d|0?[1-9])\/(\d{2,4})$/", required: false, promptMessage: "Enter a date", invalidMessage: "Enter valid date", //constraints: { min: dojo.date.locale.format(new Date(), { datePattern: 'MM/dd/yyyy', selector: 'date' }) }, value: "" //defalut value }); ..... var layerInfos = [{ 'featureLayer': featureLayer, 'showAttachments': false, 'showDeleteButton': false, 'fieldInfos': [ { 'fieldName': 'name', 'label': 'Name' }, { 'fieldName': 'email', 'label': 'Email' }, { 'fieldName': 'phone', 'label': 'Phone', 'customField': myDijit }, { 'fieldName': 'note', 'label': 'Details', 'stringFieldOption': esri.dijit.AttributeInspector.STRING_FIELD_OPTION_TEXTAREA }, { 'fieldName': 'notedate', 'label': 'Date', 'customField': myDateDijit } ] }]; ....
... View more
06-09-2011
12:10 PM
|
0
|
0
|
2695
|
|
POST
|
I am still struggling with this issues. I've created a html page with "Full Map" sample under "Layout". This sample works fine in all the browsers. However, if I add <form> tag and wrap it around the map <div> I get nothing using the firefox or chrome. <form dojoType="dijit.form.Form" id="form1"> <--- this is the form that I am talking about ---> <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> </form> Anyone encountered my problem and wish to share thoughts? One interesting pattern that I've noticed is that none of the ESRI samples has <form> tag included. This is driving me crazy here. Do I just tell my users not to use Firefox or Chrome?? thanks Don Kang if you use dijit.form.Form as your root, you just need style it. something like this: <form dojoType="dijit.form.Form" id="form1" style="width:100%; height:100%; margin:0px; padding: 0px; border: 0px">
... View more
06-08-2011
06:08 AM
|
0
|
0
|
872
|
|
POST
|
For the World Topographical Map: http://www.arcgis.com/home/webmap/vi...7a0e8c27ccc007 In the API, are we able to query the polygonal boundaries of nearby buildings/roads/green spaces? That is, for any building/green space, can the API tell us a list of 2d points representing boundary vertices of the polygon defining the structure in question? If not, what is the lowest level geometric data you have had access to? Thanks look into the api: http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/polygon.htm
... View more
06-07-2011
11:18 AM
|
0
|
0
|
719
|
|
POST
|
That is using the standard basemaps. I'm trying to retrieve a thumbnail when using the layer by type constructor. There is a workaround for this I think, but that requires diving into the private members of the class I think. Does this code snippet anwser your question? dojo.connect(basemapGallery, "onSelectionChange", function() { var basemap = basemapGallery.getSelected(); var basemapLayer = basemap.getLayers(); alert("basemap thumbnail url: " + basemap.thumbnailUrl); alert("basemap url: " + basemapLayer[0].url); });
... View more
06-07-2011
11:14 AM
|
0
|
0
|
1580
|
|
POST
|
I have a map service that I am messing around with here (Secure service): https://teramaps.teraenv.com/ArcGIS/rest/services/AppliedMethod/APP_Carto_Parks_Protected_Areas/MapServer?token=ItX80paTB9xhPfhupRMGCMJ27tNS8ocuOpI22h_G09yZioox-jopFTlw3QLuojqNOYbwolt-T6Mi0ek-YMYzyg.. ^^ Right click and copy link, as clicking on that won't work ^^ If I paste that entire link into my browser I can get to it no problem, if I use that link in a Flex application it displays no problem. If I try to access that link in Javascript it will not display. Has anyone ever experienced this? Am I missing something obvious here? Any input is appreciated. Thanks, Jacob <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<title>ArcGIS JavaScript API: AppliedMethod/APP_Carto_Grids</title>
<link href='https://community.esri.com/ArcGIS/rest/ESRI.ArcGIS.Rest.css' rel='stylesheet' type='text/css'>
<style type="text/css">
@import "https://serverapi.arcgisonline.com/jsapi/arcgis/2.0/js/dojo/dijit/themes/tundra/tundra.css";
html, body { height: 100%; width: 100%; margin: 0; padding: 0; }
.tundra .dijitSplitContainer-dijitContentPane, .tundra .dijitBorderContainer-dijitContentPane#navtable {
PADDING-BOTTOM: 5px; MARGIN: 0px 0px 3px; PADDING-TOP: 0px; BORDER-BOTTOM: #000 1px solid; BORDER-TOP: #000 1px solid; BACKGROUND-COLOR: #E5EFF7;
}
.tundra .dijitSplitContainer-dijitContentPane, .tundra .dijitBorderContainer-dijitContentPane#map {
overflow:hidden; border:solid 1px black; padding: 0;
}
#breadcrumbs {
PADDING-RIGHT: 0px; PADDING-LEFT: 11px; FONT-SIZE: 0.8em; FONT-WEIGHT: bold; PADDING-BOTTOM: 5px; MARGIN: 0px 0px 3px; PADDING-TOP: 0px;
}
#help {
PADDING-RIGHT: 11px; PADDING-LEFT: 0px; FONT-SIZE: 0.70em; PADDING-BOTTOM: 5px; MARGIN: 0px 0px 3px; PADDING-TOP: 3px;
</style>
<script type="text/javascript" src="https://serverapi.arcgisonline.com/jsapi/arcgis?v=2.0"></script>
<script type="text/javascript">
dojo.require("esri.map");
dojo.require("dijit.layout.ContentPane");
dojo.require("dijit.layout.BorderContainer");
var map;
function Init() {
dojo.style(dojo.byId("map"), { width: dojo.contentBox("map").w + "px", height: (esri.documentBox.h - dojo.contentBox("navTable").h - 40) + "px" });
map = new esri.Map("map");
var layer = new esri.layers.ArcGISDynamicMapServiceLayer("https://teramaps.teraenv.com/ArcGIS/rest/services/AppliedMethod/APP_Carto_Parks_Protected_Areas/MapServer?token=ItX80paTB9xhPfhupRMGCMJ27tNS8ocuOpI22h_G09yZioox-jopFTlw3QLuojqNOYbwolt-T6Mi0ek-YMYzyg..");
map.addLayer(layer);
var resizeTimer;
dojo.connect(map, 'onLoad', function(theMap) {
dojo.connect(dijit.byId('map'), 'resize', function() {
clearTimeout(resizeTimer);
resizeTimer = setTimeout(function() {
map.resize();
map.reposition();
}, 500);
});
});
}
dojo.addOnLoad(Init);
</script>
</head>
<body class="tundra">
<table style="width:100%">
<tr>
<td>
<table id="navTable" width="100%">
<tbody>
<tr valign="top">
<td id="breadcrumbs">
ArcGIS JavaScript API: AppliedMethod/APP_Carto_Grids
</td>
<td align="right" id="help">
Built using the <a href="https://resources.esri.com/arcgisserver/apis/javascript/arcgis">ArcGIS JavaScript API</a>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</table>
<div id="map" style="margin:auto;width:97%;border:1px solid #000;"></div>
</body>
</html>
Does the token associate with your credential (jraymond)? When i clicked the Supported Interfaces: REST. I got this error: { "error" : { "code" : 499, "message" : "Unauthorized access", "details" : [] } } If you use the IIS, you can put an impersonate to test the page using your credential: <identity impersonate="true" userName="yourdomain\jraymond " password=password/>
... View more
06-06-2011
10:26 AM
|
0
|
0
|
680
|
|
POST
|
I ran FL.isEditable(), and it is returning that it is editable. However, I still get the: {"error":{"code":400,"message":"Unable to complete operation.","details":["Unable to apply edits"]}} when I attempt the save. Pointing the FL to a feature class outside of a geometric network allows me to save the edits. 😞 Not sure why. I expect FL.isEditable() returns false. Anyway editing a feature classs outside of a geometric network need specify an editing session environment which is not used by feature layer. That is why it works once you pull it out of the geometric network.
... View more
06-06-2011
06:57 AM
|
0
|
0
|
2186
|
|
POST
|
Tried both..it does not working. Seems like does not know/understand OBJECTID because the field is called PAD.LP_PAD.OBJECTID. if no substring used (spatial does not join with other table), then I can use OBJECTID only You can look at your service directory to see how the field names are listed. if the field listed as PAD.LP_PAD.OBJECTID, then the statement should be clickedTaxLotId = grid.getItem(evt.rowIndex).PAD.LP_PAD.OBJECTID[0]. the best way to find out is to debug the statement.
... View more
06-06-2011
05:03 AM
|
0
|
0
|
1005
|
|
POST
|
Is it possible to edit a specific feature class that is contained in a geometric network via the AGS JSAPI? I am attempting to edit a point feature class (Lift Stations) that are part of our Sewer Network. I have all of the layers loaded into the .mxd, and can edit this layer inside of ArcMap; however, when I publish this layer to ArcGIS Server and attempt to edit this layer I get an error (via Firebug): {"error":{"code":400,"message":"Unable to complete operation.","details":["Unable to apply edits"]}} I did a test, and exported this layer to a stand alone feature class outside of the geometric network, and the same code works. I can edit just fine... I have it set up so that the users can only edit the attributes, and can not move the points. Any help is greatly appreciated! In ArcObjects, if you edit a feature class inside of the geometric network, you have to explicitly define a edit session. Editing a featurelayer in JSAPI bypass the edit session. So i think that has something to do with your not being able to edit your feature class. By the way you can use FeatureLayer.isEditable() method to find out whether it is editable or not.
... View more
06-03-2011
11:45 AM
|
0
|
0
|
2186
|
|
POST
|
Hi, I'm building an application that has the ability to perform measurement through the Measurement Tool along with identify functionality in 2.3 of the API. Both tools work with the map.click event. I understand the mechanics of how to stop an event so that for instance when the user clicks the map to perform an identify that it doesn't also perform a measurement. However, with the measure tools I don't see any exposed events that would allow me to stop an event. For example, when the user clicks the Measure Distance tool and then clicks the map to define the first point it also attempt to perform an identify and vice versa. Anyone know how to handle this? Thanks, Eric Pimpler GeoSpatial Training Services, Inc. http://www.geospatialtraining.com http://geochalkboard.wordpress.com Thanks for the clue on Jian's post on http://forums.arcgis.com/threads/31664-How-to-modify-measurement-widget, it is feasible by code like this; var clickMode =true; //globle variable. default as enable click event .... dojo.connect(map, "onClick", doIdentify); .... var measurement = new esri.dijit.Measurement({ map: map }, dojo.byId('measurementDiv')); measurement.startup(); var distanceBtn = dojo.query('[widgetid=\"distance\"]')[0]; dojo.connect(distanceBtn, "onclick", function() { //note: onclick not onClick clickMode =false; //deactivate the click identify event }); ... function doIdentify(evt) { if (!clickMode) return; else { .... identify action go here; clickMode =true; //reset back } }
... View more
06-03-2011
09:15 AM
|
0
|
0
|
665
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 04-11-2011 12:16 PM | |
| 1 | 05-25-2017 08:26 AM | |
| 1 | 06-02-2017 07:37 AM | |
| 1 | 06-28-2011 07:02 AM | |
| 1 | 06-12-2017 10:10 AM |
| Online Status |
Offline
|
| Date Last Visited |
10-01-2024
09:57 PM
|