|
POST
|
i try this. but i get this error. it means tha the id that you said is a temporary id so it doesnt work to create attachments, i need to make this work with only one form, i wouldnt like have to create the feature and then selected to add the file. [ATTACH=CONFIG]29721[/ATTACH] The code i showed to you is one of the project i did. It add the new feature and attachments if user choose to attach files. it woked for me. You are right on the sense that you has to create the feature in the featuresource so you can have an tempory id (actually it is a negitive number) in the map cache for you to add attachment. But you can definitely created the user experience through the code that user don't feel that way....
... View more
12-10-2013
10:43 AM
|
0
|
0
|
1053
|
|
POST
|
How can i add atachment to a new feature?? in the documentation says Attachment attachment = new Attachment(featureSource, ID, "WaterMeter1.jpg"); but how to get the id if it is a new feature ???. i need to add attchment on the same form . using the FeatureDataRow.Fid. Like this: FeatureDataRow featureDataRow =featureDataTable.NewRow(); featureDataTable.Rows.Add(featureDataRow); . . int oid =featureDataRow.Fid; . . AttachmentManager manager =featureDataTable.FeatureSource.AttachmentManager; Attachment attachment=New Attachment(featureDataTable.FeatureSource, oid, fileName); . . if (manager.HasAttachment && manager.AllowEdits) { manager.AddAttachment(attachment, fileSource, FileOperation.CopyFile); }
... View more
12-09-2013
01:01 PM
|
0
|
0
|
1053
|
|
POST
|
HI All, I have my map placed within a div
<div id="mapContainer">
<div id="mapDiv" dojotype="dijit.layout.ContentPane" region="center" style="height:100%; width:100%"></div>
</div>
The mapContainer is itself within a jQuery ui tab widget. The map re sizes itself when browser size is changed without any extra code in FF however in IE8, the map does not resize itself. I have tried various suggestions including one from the guidelines but nothing seems to work. Any ideas?
dojo.connect(dojo.byId('mapDiv'), 'resize', function(extent) {
map.resize();
});
Moving the map div under the body tag and not within any widget or any other tags fixes the issue, but i do want to use the tab widget. Thanks Have you tried to use jQuery's bind method to raise the map control's resize event?
... View more
02-26-2013
11:11 AM
|
0
|
0
|
1141
|
|
POST
|
Hello! We have implemented esri.layers.TiledMapServiceLayer basemaps in our Javascript code (external TMS tiles) and now we are having a problem including such basemap into outprint. Basemaps are added via map.addLayer interface and default printing service is declared this way: [INDENT][INDENT] var printer = new esri.dijit.Print({ map: map, url: "http://atlas:6080/arcgis/rest/services/Raivotest/ExportWebMap/GPServer/Export%20Web%20Map" }, dojo.byId("b_print")); printer.startup();[/INDENT][/INDENT] But, this output file contains only ArcGISDynamicMapServiceLayer layers . How I can include TiledMapServiceLayer? It is a major problem here as those basemaps are for us very important. Is ArcGIS a system or closed system? Thank you, Raivo Alla Estonian Land Board I would try to initialize the print widget after the tiledMapserviceLayer is loaded up and see what happen...
... View more
02-26-2013
11:05 AM
|
0
|
0
|
2460
|
|
POST
|
So I was looking into this more and found that if I debug the proxy.ashx (using visual studio) and run it on localhost (http://localhost:3274/appname/proxy.ashx) I am able to use the proxy to navigate to the applyedits rest endpoint. However, if I try to use the proxy from where the app sits on my server i get the error and cannot get to the applyEdits rest endpoint. Summing it up... This works... http://localhost:3274/appname/proxy.ashx?http://servername:6080/arcgis/rest/services/foldername/servicename/FeatureServer/2/applyEdits This does not work and I get the error. http://servername/websites/appname/proxy.ashx?http://servername:6080/arcgis/rest/services/foldername/servicename/FeatureServer/2/applyEdits The proxy.ashx and proxy.config are saved in the same folder as the html page for the app. Kind of at a loss as to what to check next. As I mentioned in my first post, this only occurred after upgrading to server 10.1 so I think it might have to do with adding the port number (servername: 6080) to the service rest endpoint url. next i would try to put a serverUrl including the port in proxy like this: <serverUrl url="http://servername:6080/arcgis(or your instance name)/rest/services" matchAll="true" /> and see what happen...
... View more
02-26-2013
11:01 AM
|
0
|
0
|
916
|
|
POST
|
I've been trying for while to select/highlight the features returned from the querytask. Based on the API samples, it would seem that it would be easy to do yet I've been having a hard time with it and am getting frustrated. Based on the code I posted, how would I go about doing this? I would like to zoom in to the extent of the features then highlight them. Any help is appreciated. Thanks, Todd McNeil Geographer U.S. Department of Housing and Urban Development Office of Policy Development and Research If you want to highlight the search result, you could query on a feature layer using featureLayer.selectFeatures(query,esri.layers.FeatureLayer.SELECTION_NEW). Once selectFeatures is fired up, in onSelectionComplete(features, selectionMethod), you could use map.extent =map.extent =esri.graphicsExtent(features).expand(1.5); if you set featureLayer.setSelectionSymbol(highlightsymbol), then selected features will use highlightsymbol to display those features... Hope it will help!
... View more
01-08-2013
09:16 AM
|
0
|
0
|
1247
|
|
POST
|
Hi there, I trying to find out what i have miss in the code. Here the code :
function searchPrecinct(prct){
presint = "";
map.graphics.clear();
dojo.byId("result").innerHTML = "";
strwhere = "PRECINT_ID='"+ prct +"'";
query.where = strwhere;
qTaskPrecinct.execute(query);
alert(strwhere);
dojo.connect(qTaskPrecinct,'onComplete',function(fSetPrct){
var resultFeatures = fSetPrct.features;
if (resultFeatures.length==0){
dojo.byId("result").innerHTML = "No record.";
return;
}
ixmin = 0; iymin = 0; ixmax = 0; iymax = 0;
for (var j=0; j<resultFeatures.length; j++){ //get xy min max
var graphic = resultFeatures ;
presint = graphic.attributes.PRECINT_ID;
if (j==0){
ixmin = graphic.geometry.getExtent().xmin;
iymin = graphic.geometry.getExtent().ymin;
ixmax = graphic.geometry.getExtent().xmax;
iymax = graphic.geometry.getExtent().ymax;
}
else{
if (graphic.geometry.getExtent().xmin < ixmin) ixmin = graphic.geometry.getExtent().xmin;
if (graphic.geometry.getExtent().ymin < iymin) iymin = graphic.geometry.getExtent().ymin;
if (graphic.geometry.getExtent().xmax > ixmax) ixmax = graphic.geometry.getExtent().xmax;
if (graphic.geometry.getExtent().ymax > iymax) iymax = graphic.geometry.getExtent().ymax;
}
}
var newExtent = new esri.geometry.Extent();
newExtent.xmin = ixmin - 6;
newExtent.ymin = iymin - 6;
newExtent.xmax = ixmax + 7;
newExtent.ymax = iymax + 7;
map.setExtent(newExtent, true);
setTimeout( function() {
newExtent.xmin += 1;
newExtent.xmax += 1;
map.setExtent(newExtent, true);
}, 1000);
});
I failed to zoom into the result... Anybody can help me? I would try this:
function searchPrecinct(prct){
presint = "";
map.graphics.clear();
dojo.byId("result").innerHTML = "";
strwhere = "PRECINT_ID='"+ prct +"'";
query.where = strwhere;
qTaskPrecinct.execute(query);
alert(strwhere);
dojo.connect(qTaskPrecinct,'onComplete',function(fSetPrct){
var resultFeatures = fSetPrct.features;
if (resultFeatures.length==0){
dojo.byId("result").innerHTML = "No record.";
return;
}
map.extent =esri.graphicsExtent(resultFeatures)
});
... View more
01-08-2013
05:10 AM
|
0
|
0
|
844
|
|
POST
|
Hello, I keep generating tokens here 'https://www.arcgis.com/sharing/generateToken?' without any problems. I then use the token to load Feature Services hosted from ArcGIS Online in my web app. The problem is that the tokens never seem to last the length I specify in the url, ie.expiration=1440. It doesn't seem to matter what I put down, 365 days, 6 months or 10 days the token works only once it seems. Am I not understanding how tokens work? I thought that by setting the expiration to 1440 the token would be good for 10 days? Thanks 1440 would be 1 day (24X60). not 10 day.
... View more
01-08-2013
04:59 AM
|
0
|
0
|
1342
|
|
POST
|
hzhu, It would be easier and not sure why I had to make the problem more difficult by using an array. 🙂 I think i wanted to see if I could do it. I also would like to zoom to the map extent of all the selected features. I read somewhere that I would have to union all features together then get the extent. I have the code below and could use some assistance.
function showQueryResults(results) {
var thisExtent, fullExtent;
for (var i = 0, il = results.features.length; i < il; i++) {
fullExtent = results.features.geometry.getExtent();
fullExtent.union(fullExtent);
}
map.setExtent(fullExtent.getExtent().expand(1.5));
}
This seems like it is close but the fullExtent is only storing the extent of the last selected feature. Thanks, Todd McNeil Geographer U.S. Department of Housing and Urban Development Office of Policy Development and Research
function showQueryResults(results) {
map.extent =esri.graphicsExtent(results.features).expand(1.5);
//or map.setExtent(esri.graphicsExtent(results.features).expand(1.5));
}
... View more
01-07-2013
08:58 AM
|
0
|
0
|
1247
|
|
POST
|
Hi hzhu, Did you mean I create geoprocessing task convert data from cad file or from SDE GeoDatabase to json and return json data?? I created geoprocessing task convert cad file to shape file, then compress shape file to zip extension and using this zip file in my JavaScript API application but i need to work directly with cad file not with zip file Thanks, Best wishes. arcpy treated a cad file as dataset, you could open a cad file reading the layers(point, ployline, polygons etc) inside a cad file....
... View more
01-07-2013
07:17 AM
|
0
|
0
|
971
|
|
POST
|
Demin, I agree about the statement about development resources, however at long term it will not be a discussion of using Silverlight / Flex or Javascript for web based application but rather choose between JavaScript and native applications for mobiles (IOS / Android Win 8?). Silverlight is at a dead end for Microsoft, still they will support it for a long time. Flex has been put in open source, clearly an exit strategy of Adobe. So the days for browser plugins are counted. Javascript will have more support from Microsoft in Visual Studio 2012, unfortunaly for us ArcGis guys Microsoft choose JQuery as their favorite library. So investments into Javascript will be very important if you need doing web applications. Johnny I think "Silverlight is Dead" is very misleading. It is a very big topic and there are lots of good articles on Google talking about it so i don't want or am not capable to explain well. I think Javascript and Sliverlight technologies complement each other. I would like to make use of both strength. As a matter of fact, I had developed a silverlight app using Google Map API. The interaction between Javascript and silverlight are so easier....
... View more
01-07-2013
05:54 AM
|
0
|
0
|
2460
|
|
POST
|
How I can read data from cad file in Server hard disk directly when i using javascript api Have you thought about create a geoprocesing service and used it in your JS API apps?
... View more
01-05-2013
10:16 AM
|
0
|
0
|
971
|
|
POST
|
I have an asp.net page with a map and two controls. One control selects a state, populates the second control with the counties within that selected state. I select multiple counties and hit a button. The button fires of a javascript function, loopSelected(), to loop through the selected counties and create an array.
function loopSelected() {
//Define an array to store selected counties
var selectedArray = new Array();
var selObj = document.getElementById('countyListBox');
var i;
var count = 0;
for (i = 0; i < selObj.options.length; i++) {
if (selObj.options.selected) {
selectedArray[count] = selObj.options.value;
count++;
}
}
//Pass array to Query and Find functions
runCountyQuery(selectedArray);
doCountyFind();
}
The selectedArray is passed to another function, runCountyQuery, that performs the QueryTask to select the multiple counties.
function runCountyQuery(selectedArray) {
//Define a new Query and QueryTask
queryTask = new esri.tasks.QueryTask("http://hwvanad1287/ArcGIS/rest/services/tdat/Acs/MapServer/0");
//Create query parameters
query = new esri.tasks.Query();
query.returnGeometry = true;
query.outFields = ["*"];
//Parse selectedArray for query.where clause
var strText;
var i;
var count = 0;
for (i = 0; i < selectedArray.length; i++) {
strText = selectedArray;
alert('strText[' + i + ']: ' + strText);
count++;
}
//This section actually runs the query. It's called by the loopSelected() function above.
//The query is run as a deferred process, and the results are returned to the showQueryResults function.
//The query's where clause is specified in the input field.
//query.where = document.getElementById("countyListBox").value;
//query.where = "GEOID = " + "'" + query.where + "'";
//query.where = "GEOID IN (" + "'13001','13003','13005'" + ")";
query.where = "GEOID IN (" + selectedArray + ")";
alert('query.where:' + query.where);
queryTask.execute(query, showQueryResults, errResults);
}
My problem is building the proper syntax for the query.where clause from the selectedArray. I would also like to find the easiest way to debug the results on execute. If there is an easier way to construct a query.where clause containing multiple values, I am all ears. Todd McNeil Geographer U.S. Department of Housing and Urban Development Office of Policy Development and Research // not return array, return a string instead like this ('13001','13002','13003'...) function loopSelected() { //Define an array to store selected counties var selectedArray ="("; var selObj = document.getElementById('countyListBox'); var i; var count = 0; for (i = 0; i < selObj.options.length; i++) { if (selObj.options.selected) { if (selectedArray =="(") { selectedArray +="'"+ selObj.options.value+"'"; } else{ selectedArray +=",'"+ selObj.options.value+"'"; } count++; } } selectedArray +=")"; //Pass this string to Query and Find functions runCountyQuery(selectedArray); doCountyFind(); }
... View more
01-04-2013
10:00 PM
|
0
|
0
|
1247
|
|
POST
|
Just return to JS API recently, and working on access secured map services. Because of the use of web adapter plus reverse proxy, the previous app on access secured map service no longer worked. It took me a while to find a workable solution to use identity manager to access secured map services. Here i shared with peers hoping it could save you some time. For pre 10.1 server, this is how i used Identity manager for login to secured map service. 1. include dojo.require("esri.IdentityManager") in your javescript 2. in your proxy.config, add one serverUrl: <serverUrl url="https://your web site/serverinstance(arcgis as default)/token" matchAll="true"></serverUrl> and you all set. if you add a secured map service to you map without token, the identity manager will pop up asking login before loading it to the map. For 10.1 server. I found i need to do more steps: Here is how i did ( it may not work or unnecessary for you case): 1. include dojo.require("esri.IdentityManager") in your javescript 2. in your proxy.config, add one serverUrl: <serverUrl url="https://your web site/serverinstance(arcgis as default)/tokens/generateToken" matchAll="true"></serverUrl> Question: how do you know what url i shoud put in? Answer: It is sample: type the security secured service to the web browser address, it will redirect you to the ArcGIS Server REST API Login page. click Get Token link on top right of the page, it will direct you to the ArcGIS Token Service Page. Click the Generage Token button without putting any credentials, it will lead you to another page. Copy the page address from the address bar. That address is the one u need to put in the serverUrl - like the above one-https://your web site/serverinstance(arcgis as default)/tokens/generateToken. The address "defines the secure service and token endpoints" so that it knows where to varify and authorize your authentication. 3. Because of redirect of the web adapter and/or web reverse proxy, the identity manager may not work properly when access secured service, In my case, the identity manager display an error message saying: "Unable to access the authentication service". It tell you that the identity manager cannot determine the locatation of the secure server and token endpoint. In this case you need to register secure servers and the token endpoints By adding the following code block to the init function:
.....
dojo.require("esri.IdentityManagerBase");
function init(){
var serverInfo = new esri.ServerInfo();
serverInfo.server = 'https://your web site';
serverInfo.tokenServiceUrl = 'serverUrl in step 2';
esri.id.registerServers([serverInfo]);
......
}
Hope it will help!
... View more
01-04-2013
09:27 PM
|
0
|
0
|
972
|
|
POST
|
Thank you for all replies! Does anyone have experience from WPF API? If we let put the obvious thing as development tools at the side, how does JavaScript work compare to WPF? Regards, Daniel Most of my recent GIS works are done using silverlight or WPF(silverlight is sub set of WPF for client-side). But since i have some intense work on JS API, I will give my personal opinions. 1. First of all: I like both of them! Then again because i have many years of both javascript and C#(C++ and Java) programming experience. So script language or OOP isn't really a big issue to me 2. Developing environment, time and performance: I prefer Silverlight/WPF. You have the best development IDE -visual studio with full blown debugger and rich test framework(unit test/UI test) for u to use (again not against Firebug at all). Personally I found lot easier and fast to write silverlight(C#). And last thing compiled code is still faster than the fastest JavaScript. 3. Cross platforms: I give Javascript a little edge not because the siliverlight plug-in but because Javascript can easily run on almost any systems and integrate into other language, let alone the hot mobile trend!! 4. Rich functionality vs Html5/Javascript: Because the Silverlight runtime is a samll version of .Net Framework. It has rich features that have no Html5/Javascript equivalent: deep networking support, file access, out-of browser apps, call windows system component, rich ways to connect back end database.. just name a few. The evolution of Javascript in recent years has added OO P features to it (dojo, jquery etc) but it hasn't reached the level the silverlight has. 5 Open resource vs industry standard. You could argue that Open resource like dojo or jquery is low cost. I personally think it is a double-edge sword. The lack of industry standard has add a lot of complexity to the development process.. Just compare the easiness of searching a dojo class library and a silerlight(.net class library). (html5 isn't quite here yet-let's wait) 6 easyness for the starter: definitely goes to the Javascript. Javascript is a good language for the beginner. The above is my personal opinions on Javascript VS Silverlight. Not specific on JS API vs Silverlight/WPF API. Like I said I like both of them. ESRI did a fairly good job on developing those APIs.
... View more
01-04-2013
08:15 PM
|
0
|
0
|
2835
|
| 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
|