POST
|
It might be your spatial Reference object. Recreate the spatialReference object before creating your extent object to see if that changes anything.
require([
"esri/geometry/Extent", "esri/SpatialReference", ...
], function(Extent, SpatialReference, ... ) {
var sr = new SpatialReference({"wkid": 4326});
var extent = new Extent(-122.68,45.53,-122.45,45.60, sr);
...
}); If that doesn't fix the issue, can you generate a really quick sample using http://jsfiddle.net ? Thanks! That fix it. Thank you very much! I just dont understand why the spatialReference was broken somewhere during the features creation. In my point of view the wkt (see first post) of the extent objects was corresponding to wkid 4326
... View more
01-17-2014
10:12 AM
|
0
|
0
|
342
|
POST
|
Hi, I am trying to do a map.setExtent(extent, true) but I got this error in the console: "Map: Geometry (wkid: GEOGCS["Longitude / Latitude (WGS 84)",DATUM["WGS 84",SPHEROID["WGS 84",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Decimal_Degree",0.0174532925199433]]) cannot be converted to spatial reference of the map (wkid: 4326)" the extent object seems to be good and in the same spatial reference of the map extent object: spatialReference: Object wkt: "GEOGCS["Longitude / Latitude (WGS 84)",DATUM["WGS 84",SPHEROID["WGS 84",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Decimal_Degree",0.0174532925199433]]" type: extent xmax: -72.54337729099996 xmin: -74.16215098199996 ymax: 46.45532899700004 ymin: 45.35837900300004 var extent = esri.graphicsExtent(result.featureSet.features); console.log(extent) map.setExtent(extent.expand(1.5, true);
... View more
01-17-2014
08:54 AM
|
0
|
3
|
548
|
POST
|
You're own your way to go, but you should specify to the query task which layer must have be filtered, by using the layer index on the map service. So, instead of: var bufferPoly = new esri.tasks.QueryTask("http://localhost:6080/arcgis/rest/services/buffer/MapServer"); You should have: var bufferPoly = new esri.tasks.QueryTask("http://localhost:6080/arcgis/rest/services/buffer/MapServer/0"); or 1, or 2, or whatever is the index of the layer being filtered. Regards. Roberto Pepato Thank you, thats do it! I can filter the result by a field and map it. My last question is, is it possible to set the input features, for instance, apply the geoprocessing to a subset of selected features. Or is it possible to change geoprocessing parameters (like the buffer distance) the same way, ie using QueryTask.
... View more
01-17-2014
04:57 AM
|
0
|
0
|
311
|
POST
|
Thank you for your help pepatops! I am not sure to understand well how it works. I tried like this without success: var bufferPoly = new esri.tasks.QueryTask("http://localhost:6080/arcgis/rest/services/buffer/MapServer");
var query = new esri.tasks.Query();
query.where = "1=1";
query.returnGeometry = true;
bufferPoly.execute(query);
bufferPoly.on("complete", function(result){
console.log(result)
map.addLayer(result);
}); I am using the query "1=1" just to test. It should returns all features. There is no error message in the server or console log but the buffers are not rendered on the map. Do I have to define the result layer styles?
... View more
01-17-2014
03:44 AM
|
0
|
0
|
311
|
POST
|
Hi, I have published a geoprocess in ArcGIS Server and checked the option to see the result in a map service. I have now a new map service that output the results correctly on the map like this: var outputBuffer = new esri.layers.ArcGISDynamicMapServiceLayer("http://localhost:6080/arcgis/rest/services/buffer/MapServer",{ opacity: 0.75 }); map.addLayer(outputBuffer); Now, I would like to know how (if its possible) to define parameters like Query or to give data selection or distance parameters as input. Is it possible to do it simply by adding properties in the layer definition or do I have to use the geoprocessing service instead (not the map service of the geoprocess)? Thank you,
... View more
01-16-2014
10:58 AM
|
0
|
5
|
2163
|
POST
|
var query = new Query();
query.where = "1=1";
school.selectFeatures(query, FeatureLayer.SELECTION_NEW, function(result){
console.log(result);//This is an array of graphics
}) Still cant get the graphics from the selection I do like this: function setupParameters(){
var inputFeatures = new esri.tasks.FeatureSet();
var query = new esri.tasks.Query();
query.where = "1=1";
var school = new esri.layers.FeatureLayer("http://localhost:6080/arcgis/rest/services/carte1/MapServer/0",{
mode: esri.layers.FeatureLayer.MODE_SNAPSHOT,
});
map.addLayer(school);
school.on("update-end", function(){
school.selectFeatures(query, esri.layers.FeatureLayer.SELECTION_NEW, function(result){
inputFeatures.features = result.graphics;
console.log(inputFeatures.features)
});
}); console.log returns "undefined"
... View more
01-16-2014
05:43 AM
|
0
|
0
|
615
|
POST
|
As that message states, Esri only supports 64-bit databases. Given the extreme memory limitations of 32-bit applications, and the amount of RAM found in modern computers, using a 32-bit database application is like trying to tow a horse trailer with a bicycle -- even if you get it to work, you won't be getting anywhere fast. - V Hi Vangelo, Thank you for your reply. I agree with you, 32bit wont be enough. I was trying anyway just to perform some tests. I am not sure, but I think I saw that PostgreSQL 32bit was supported. Can you confirm that? Thank you again.
... View more
01-16-2014
04:51 AM
|
1
|
0
|
269
|
POST
|
Documentation says: If you want to get features from current extent, you need to initialize the layer in MODE_ONDEMAND mode. If you want to get all features, you need to set the mode to MODE_SNAPSHOT (but it will return no more than the default total of 1000 features). Read more at: https://developers.arcgis.com/en/javascript/jsapi/featurelayer.html Hi, Thank you for your reply. What can I do if I dont want to add this layer to the map? How can I retrieve its graphics anyway? Ok in MODE_SNAPSHOT I think I could retrieve more than 1000 features if I change the default property in ArcGIS Server Manager.
... View more
01-16-2014
04:25 AM
|
0
|
0
|
615
|
POST
|
Hi, I am new to the javascript API and I dont know what is going wrong in my simple map application. I have a map servcie published by arcgis Server and I would like to select a layer of this service to use in a geoprocessing tool. However, I cant retrieve the graphics of this layer. I am doing like this: require(["esri/map", "dojo/domReady!", "esri/layers/ArcGISDynamicMapServiceLayer", "esri/layers/FeatureLayer", "esri/tasks/Geoprocessor", "esri/SpatialReference",], function(Map) { /*initializing map, etc... */ var school = new esri.layers.FeatureLayer("http://localhost:6080/arcgis/rest/services/carte1/MapServer/0"); //trying to retieve the graphics with load event because the map service is asynchronous school.on("load", function(){ inputFeatures.features = school.graphics; inputFeatures.fields = school.dataAttributes; alert(inputFeatures.features) //the alert box is empty }); }); Why can't I get the graphics like this? Thank you,
... View more
01-16-2014
04:07 AM
|
0
|
5
|
1044
|
POST
|
Hi, We are trying to create a new geodatabase enterprise on Oracle 10g 32bit through the AcrGIS Desktop Create geodatabase enterprise toolbox. We receive this error message: Lâ??utilisateur ne dispose pas des privilèges requis pour créer des objets de base de données. [ERROR: Must be connected to a 64-bit database to create geodatabase. ] Does it means that geodatabase enterprise could not be installed on a 32 bit Oracle DB? Is 64bit a requirement? Thank you,
... View more
01-16-2014
04:01 AM
|
0
|
3
|
2249
|
POST
|
Hi, I have published a map as a service with ArcGIS Server. I have built my simple map like this: require(["esri/map", "dojo/domReady!", "esri/layers/ArcGISDynamicMapServiceLayer", "esri/SpatialReference",], function(Map) { layer1 = new esri.layers.ArcGISDynamicMapServiceLayer("http://localhost:6080/arcgis/rest/services/carte1/MapServer", { 'opacity': 0.75 }); map = new Map("maptest1", { basemap: "topo" }); map.addLayers([layer1]); map.on("layers-add-result", function(){ var extent = layer1.fullExtent; map.setExtent(extent); }); }); I would like to use a published geoprocess in the map and select a particular feature class from the ArcGISDynamicMapServiceLayer as input. Is it possible? If I do map.getLayer("layer1") will I retrieve all features class that was published in the map? What is the method to do what I am trying to do? Thank you a lot!
... View more
01-15-2014
05:15 AM
|
0
|
1
|
808
|
POST
|
Try this instead
require(["esri/map", "dojo/domReady!", "esri/layers/ArcGISDynamicMapServiceLayer", "esri/SpatialReference",], function(Map) {
var layer1 = new esri.layers.ArcGISDynamicMapServiceLayer("http://localhost:6080/arcgis/rest/services/carte1/MapServer");
map = new Map("maptest1");
map.addLayers([layer1]);
map.on("layers-add-result", function(){
var extent = layer1.fullExtent;
map.setExtent(extent);
alert(extent.xmax);
});
});
Thank you for your help kenbuja, this is working correctly. I will have to study events carefully as it seems its the base of this API.
... View more
01-13-2014
10:15 AM
|
0
|
0
|
1323
|
POST
|
Hi kenbuja, I dont know what is wrong here... fullExtent is always empty require(["esri/map", "dojo/domReady!", "esri/layers/ArcGISDynamicMapServiceLayer", "esri/SpatialReference",], function(Map) { [INDENT] var layer1 = new esri.layers.ArcGISDynamicMapServiceLayer("http://localhost:6080/arcgis/rest/services/carte1/MapServer"); extent = layer1.fullExtent alert(extent) // empty box is popped map = new Map("maptest1"); map.addLayers([layer1]); map.setExtent(extent);[/INDENT] });
... View more
01-13-2014
09:56 AM
|
0
|
0
|
1323
|
POST
|
Thank you for your help jgravois, The problem I encounter is that the layer I am trying to zoom to, an esri.layers.ArcGISDynamicMapServiceLayer instance, do not have a getExtent() method and the fullExtent property is empty. By default the map extent is set in order that we only see a part of the layer, but not its entire extent.
... View more
01-13-2014
09:39 AM
|
0
|
0
|
1323
|
POST
|
welcome to the forums burton! if you have a reference to an extent object, you could find its center using the method extent.getCenter() afterward, you could pass the point which is returned to map.centerAt() Allright, I understand that, the map center is moved to the center of the layer, but the map is not zoomed to the layer extent.
... View more
01-13-2014
08:43 AM
|
0
|
0
|
1323
|
Title | Kudos | Posted |
---|---|---|
1 | 06-17-2016 06:29 AM | |
2 | 07-13-2016 06:44 AM | |
1 | 01-16-2014 04:51 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|