|
POST
|
I can add an ArcGISImageServiceLayer with a different spatialReference than the initially set extent and other layers in the map such as the one from ESRI (http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer). When I try to use the same Imageserver layer as a new.dijit.BasemapLayer it does not reproject correctly as when adding it by just using the usual map.addLayer function. I have tried it two different versions of this but neither works. Version #1 var NAIP2009params = new esri.layers.ImageServiceParameters(); NAIP2009params.noData = 0; var islNAIP2009 = new esri.layers.ArcGISImageServiceLayer("http://gisservice.mt.gov/ArcGIS/rest/services/MSDI_Framework/NAIP_2009/ImageServer", { imageServiceParameters: NAIP2009params }); var basemapNAIP2009 = new esri.dijit.Basemap({ layers: [islNAIP2009], id: "bmNAIP2009", title: "NAIP 2009" }); basemaps.push(basemapNAIP2009); Version #2 var basemapNAIP2009 = new esri.dijit.Basemap({ layers: [new esri.dijit.BasemapLayer({ url: "http://gisservice.mt.gov/ArcGIS/rest/services/MSDI_Framework/NAIP_2009/ImageServer" })], id: "bmNAIP2009", title: "NAIP 2009" }); basemaps.push(basemapNAIP2009); Any help or existing example is much appreciated. Look into this. http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/basemapgallery.htm. All the Basemaplayer has to share the same SR
... View more
10-19-2011
11:03 AM
|
0
|
0
|
596
|
|
POST
|
Hello Yousaf, My apologies: I had misread the thread! ET Geowizards tools does in fact operate on all items of the shape or feature class. If you want to do it point by point, you could do one of two things: - As described above, do an AddField followed by a CalculateField, but only on the active layer. - Create your fields, select the points you're interested in and do the following: Attribute Table - Right Click on X or Y Field - Calculate Geometry... - X / Y Coordinate of Point. The overhead of manually clicking on each point, then activating the tool you had in mind seems comparable in my books to using this built-in function of ArcMap. I hope this helps! Write back if anything's unclear. In Arcpy, the geometry and polygon classes have a property called centroid (geometry.centroid or polygon.centroid). It will return centroid as a point. It might help you.
... View more
10-14-2011
09:10 AM
|
0
|
0
|
429
|
|
POST
|
I have a map with a Tiled and a Dynamic layer. I have a query that queries one of the features on the dynamic layer, puts the results in a table, including a link that zooms to the extent of each feature returned. Basically, I use map.setExtent() on the extent of the feature. It works pretty good. Here's my problem. I have a polygon that's much longer North/South than East/West (Utility repair along a north/south road, for example). when I run map.setExtent() on the extent of the polygon, it centers on the polygon and mostly shows it, but because of the tiled layer service, it cuts off the northern and southern tips of the polygon. When I use the identify task and the popup tool on the same polygon, and click the zoom to link, it zooms out to the next lower LOD on the tiled map service, which shows the entire polygon just fine. Any idea how I can implement this with my query results? You could use map.setExtent(extent, true). It will guaranted the whole polygon show completely on the map.
... View more
10-14-2011
07:25 AM
|
0
|
0
|
624
|
|
POST
|
Hi all, I'm writing an app which requires two seperate maps. They need to display difference featurelayers but be responsive to changes in extent to one another. I've managed to create two basic maps and add a baselayer to both. However, I only have control over the second map i.e if i click and pan the left hand map - the right hand map moves. Can i pass control to a map depending on where I've clicked? In the overview map sample you are not able to do this to the overview map. Thanks, James I think a feasible way to achieve your goal is to activate and synchronize both map's OnExtentChange event and make sure the two map have the same extent all the time.
... View more
10-14-2011
06:03 AM
|
0
|
0
|
1037
|
|
POST
|
Hi, I'm writing a web application with the Javascript API. I'd like to add the possibility to the user to choose the scale he want to see data. In the sample, I've only see sample of scalebar, which is not what I'd like to do. Does somebody knows where I can find a sample of this functionality? Regards, Nathalie I don't think API provide this functionality directly. However it should be relatively easy to implement this functionality. Here are my thoughts. Create a dropdown and populate the scales. if your map contains ArcGISTiledMapServiceLayer, get scales and levels in the following: ArcGISTiledMapServiceLayer -> tileInfo ->lods->lod (lod.level and lod.scale). Once user pick up a scale, get the level corrspondent to that scale and use map.setLevel(level) to zoom to that scale. If you map does not contains tiledlayer, you can populate dropdown with the scales you defined, once user pick up a scale, you could use map.centerAndZoom( map.extent.getCenter(), pickedScale/esri.geometry.getScale(map)) to zoom to pickedScale. Hope it will help
... View more
10-13-2011
10:31 AM
|
0
|
0
|
535
|
|
POST
|
True, JSON is a subset of object literal notation. But functionally, using a JSON object or creating an object via the new keyword will produce the same result. JSON does have more constraints but in the specific case outlined by gis_tech, the problem was the property name, not the syntax used to create the object. Me and someone else had the same issue before. I am pretty sure the problem was not the property names and it is the syntax that i used that made the difference. Obviously there is something that did not produce the same result. If ESRI really wants to help guys that post the problems and seek help, should tackle the issue (such as var Street = { "Single Line Input": dojo.byId("address").value}; -why it doesn't work). I think 22 years of education plus 12 years of programming definitely help me understand the difference between JSON data object and Javascript Object.
... View more
10-13-2011
07:48 AM
|
0
|
0
|
1776
|
|
POST
|
Heming- those two produce the same thing, it's just two different syntactical styles. After all, JSON stands for JavaScript Object Notation. Explicitly creating an object via new Object() or with object literal notation will produce the same thing. In the case of gis_tech's code, the problem was the name of the property being specified. The locator expected "Streets" and the code was using "SingleLine". I would not say JSON and Javascript Object is the same thing. JSON is subset of the Object (it only specifies properties not the methods, you can say JSON is Object, not the way around). The reason i answer this poster is that me and someone else had the similiar issues before http://forums.arcgis.com/threads/23457-Geocoding-Service-Not-returning-Candidates-to-quot-Application-quot?p=77315#post77315 . Using new Object() is the solution i found. Since Javascript is dynamic, weakly typed script language, so specifing new object let Javascript runtime deal with it. Quite frankly it works great for me dealing with all the JSON input and do not have to warry about the formats such as single quote or double quotes and orders (like in geoprocessing parameters).
... View more
10-13-2011
05:24 AM
|
0
|
0
|
1776
|
|
POST
|
Also, for future debugging, it's a good idea to pass an errBack function when calling addressToLocations or connect to your locator's onError event to log events(this applies to all tasks in the JS API). Something like this:
dojo.connect(locator, "onError", errorHandler);
I remembered a while ago there is similiar issue with locator. The solution will be use javascript Object instead of JSON to specify your address parameter. It's more consistent. Replace your statement var Street = { "SingleLine": dojo.byId("address").value }; with these: var Street =new Object(); Street.Street =dojo.byId("address").value; I am pretty sure it will work.
... View more
10-12-2011
12:23 PM
|
0
|
0
|
1776
|
|
POST
|
Hi, _navType is not of much use if I put other buttons in the toolbar as well... I am looking into this, since I want to be able to save the current tool in a cookie for persistence. Thanks for the response! How about save the current tool into a global variable for persistence in session.
... View more
10-11-2011
01:11 PM
|
0
|
0
|
924
|
|
POST
|
That's a fantastic solution, and I'd like to try it; however I don't have access to the datagrid code. I was wondering if there was any way to hyperlink field comments to open a pop up window containing the same comments. Thanks again, Kate. Another approach would be attach "onRowClick" event on datagrid to get id of that feature and then open a pop up to show comments. However, I am not sure you could even do that if you have no access to the datagrid code.
... View more
10-11-2011
12:54 PM
|
0
|
0
|
919
|
|
POST
|
Hi Heming, Please find attached my code in a zip format. It contains three files, *.html, *.css and *.js. The application allows user to select a State in India and then one indicator. Selecting one indicator should render the map and add the graphics. Selecting another variable for the same State should add new rendered graphic and remove the previous one. Thanks for your help. Samir I could not access your map services. So what i modified may or may not work. You will have to debug yourself
... View more
10-11-2011
12:48 PM
|
0
|
0
|
492
|
|
POST
|
Hi there, We have a widget in our web app that returns results in a datagrid. We do not have access to the source code, and the "Comments" field populates the grid in a single line (which can be quite long). As a work around, I am wondering if there is a way to click the attribute info in the "Comments" field (I can make the field a hyperlink field) and run a script from the hyperlink script dialog to pop open a window displaying the "Comments" attribute info (same info that was clicked). The hyperlink script dialog accepts JScript and VBScript, however I'm unsure how to approach this. Any suggestions would be appreciated, Kate. One approach you can try is covert the Comments field into a hyperlink in datagrid using formatter property. Basically set formatter to a javascript function that will create html hyperlink string with comments. So when the datagrid is loaded, it will convert that string to html hyperlink element. The following code snippets convert a field value into a button, the implementation should be very similiar.
...
<div style="width: 650px; height: 400px">
<table id="billsGrid" dojoType="dojox.grid.DataGrid" sortInfo="2">
<thead>
<tr>
<th field="ConflictID" formatter="makeviewButton" width="20px">View feature</th>
<th field="Oid" width="150px">OID</th>
<th field="InVersion" width="150px">Version</th>
<th field="ChangeType" width="150px">Change Type</th>
</tr>
</thead>
</table>
</div>
...
<script type="text/javascript">
dojo.ready(function() {
var conflictCollection ={"items":[{"InVersion":"GDP_OWN.DataEditing_1","ChangeType":"Delete","Oid":4614,"ConflictID":"1-4614-GDP_OWN.DataEditing_1"},{"InVersion":"GDP_OWN.DataEditing_2","ChangeType":"Update","Oid":4614,"ConflictID":"2-4614-GDP_OWN.DataEditing_2"}]};
var dataStore = new dojo.data.ItemFileReadStore({ data:conflictCollection });
var grid = dijit.byId("billsGrid");
grid.setStore(dataStore);
});
function makeviewButton(id){
var strArray =id.split("-");
var oid =strArray[1];
var version =strArray[2];
var vBtn = "<div dojoType='dijit.form.Button'><img src='view.png'";
vBtn = vBtn + " width='18' height='18'";
vBtn = vBtn + " onClick=\"viewRow("+oid+", '"+version +"')\"></div>";
//alert(vBtn);
return vBtn;
}
function viewRow(oid, version)
{
alert("oid=" +oid +"; version="+version);
}
</script>
... View more
10-11-2011
10:13 AM
|
0
|
0
|
919
|
|
POST
|
Hi Heming, I tested your code to and made some minor changes based on my flow, but the graphics still do not show up. Can I email you my entire code for you to look at? Would you have time to resolve this issue for me? I have spent a lot of time trying to solve this problem. Thanks Samir Could you attach you code and post here?
... View more
10-11-2011
09:35 AM
|
0
|
0
|
1443
|
|
POST
|
Hi Heming, Thanks for your response. I am attaching the entire code for this function which'll give you a complete picture. I understand your point about the code creating new graphics layer each time. That might be the reason that each time I change my indicator, the new graphics layer shows on top of the previous one. I'll appreciate it if you can look at this code and suggest a solution. Thanks Samir I don't know the whole context of code or logic flow. so the changes i made on your code is purely my guess based on your attachment. Hope it will help
... View more
10-07-2011
10:08 AM
|
0
|
0
|
1443
|
|
POST
|
Thanks for your help Derek, It seems like a very simple issue but I am not being able to resolve it. The code below has a problem and I cannot figure it out. Can you please help me iron this out? function showQueryResults(queryTask1, query1, Indicator){ dojo.connect(queryTask1, "onComplete", function(featureSet) { distGraphicsLayer = new esri.layers.GraphicsLayer(); for (var i=0, il=featureSet.features.length; i<il; i++) { var graphic = featureSet.features; graphic.setInfoTemplate(infoTemplate); distGraphicsLayer.add(graphic); } //for map.addLayer(distGraphicsLayer); distGraphicsLayer.setRenderer(renderer); for (j=0; j<distIndicators.length; j++){ if (distIndicators ==Indicator){ distGraphicsLayer.show(); } else { distGraphicsLayer.hide(); } } Thanks Samir A couple of issues. First where is the queryTask1.execute statement ? Secondly everytime you run the queryTask, it will create new graphic layer and add to the map. It is unnecessary. You could just clear the graphics and add the graphcs everytime you run the querytask. By the way dojo.connect(queryTask1, "onComplete", function(featureSet) needs to put outside the function showQueryResults.
... View more
10-07-2011
07:48 AM
|
0
|
0
|
1443
|
| 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
|