POST
|
im facing similar issues where The services are running as seen in ARC Catalog, but the rest directory is empty. Please let me know if some one has got a solution to it. Thanks
... View more
05-31-2012
02:37 AM
|
0
|
0
|
602
|
POST
|
I am trying to achieve a convex hull over a feature Set returned by a query. But have been facing the error below which i am not able to figure out In order to debug to see how the convex hull works i had mocked up features and ran the convex hull for the created poly line features as seen in the below code. This works fine, But the above approach of plotting a convexhull for the feature set fails with the below error. Error: 1) OPTIONS file:///C:/wip/maps/code/test/proxy.ashx?http://karthikpc:8399/arcgis/rest/services/Geometry/GeometryServer/convexHull Resource failed to load 2) Another is a type error TypeError arguments: Array[2] get message: function () { [native code] } get stack: function () { [native code] } set message: function () { [native code] } set stack: function () { [native code] } type: "non_object_property_load" __proto__: Error Have given my function below. function bounding_polygon(featureSet){
var geometries = [];
var geometries_1 = [];
var geoms=[];
var symbol = new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,0,0.85]), 2);
//getting geometry from feature set
var geoms = dojo.map(featureSet.features, function(graphic) {
return graphic.geometry;
});
map.graphics.clear();
//function that fails
gsvc.convexHull(geoms,function store_value(result){
var symbol;
switch(result.type){
case "point":
symbol = new esri.symbol.SimpleMarkerSymbol();
break;
case "polyline":
symbol = new esri.symbol.SimpleLineSymbol();
break;
case "polygon":
symbol = new esri.symbol.SimpleFillSymbol();
break;
}
map.graphics.add(new esri.Graphic(result,symbol));
},function error_log(error){});
//trying to run the same for manually created geometries
var new_polyline= new esri.geometry.Polyline(map.spatialReference);
var other_polyline= new esri.geometry.Polyline(map.spatialReference);
new_polyline.addPath([[103.76794615402221, 1.4416487206261546], [103.76790721700029, 1.4427548269642734], [103.76789991705209, 1.4429139656905441]]);
other_polyline.addPath([[103.77897404312868, 1.3687951231704805], [103.7789286010334, 1.36900185852713], [103.7788202535522, 1.3694226417416273]]);
geometries_1[0]=new_polyline;
geometries_1[1]=other_polyline;
gsvc.convexHull(geometries_1,function store_value(result){
var symbol;
switch(result.type){
case "point":
symbol = new esri.symbol.SimpleMarkerSymbol();
break;
case "polyline":
symbol = new esri.symbol.SimpleLineSymbol();
break;
case "polygon":
symbol = new esri.symbol.SimpleFillSymbol();
break;
}
map.graphics.add(new esri.Graphic(result,symbol));
},function error_log(error){});
} Let me know if i would need to clarify more on this.
... View more
05-20-2012
01:58 AM
|
0
|
0
|
558
|
POST
|
I am using ARCGIS Server on Java. I could see my services running through the ARCGIS catalog, but for some reason I am not able to access it through the rest API. Should i have to change some settings of the Tomcat server internally? Sometimes restarting the service helps. Please let me know the root cause of this issue. Hoping to understand it.
... View more
05-04-2012
01:03 AM
|
0
|
1
|
791
|
POST
|
I would want to develop an application where we could query the layer based on a result set of certain attributes of the features and highlight features. Approach Currently I tried using the feature services of ARCGIS server to do so. The feature service has around 50k features. Issue: While trying retrieve and highlight the feature using a query task it takes quite a long time for the process to complete and the browser literally hangs. Question: 1) Is there a faster way to retrieve and highlight the features? 2) Could I use a better approach rather than using a feature service to achieve my end goal? Please do suggest.
esri.config.defaults.io.proxyUrl = "proxy.ashx";
dojo.require("dijit.layout.BorderContainer");
dojo.require("dijit.layout.ContentPane");
dojo.require("esri.map");
dojo.require("esri.layers.FeatureLayer");
dojo.require("esri.tasks.query");
var map;
var featureset=[];
var infoTemplate = new esri.InfoTemplate();
infoTemplate.setTitle("${ROADNAME}");
infoTemplate.setContent( "<b>ROAD NAME: </b>${ROADNAME}<br/>"
+ "<b>CAT</b>${CAT}</b>"
+ "<b>LINK_ID</b>${LINK_ID}</b>");
function init() {
try {
var initExtent = new esri.geometry.Extent({"xmin":103.55,"ymin":1.13,"xmax":104.16,"ymax":1.56,"spatialReference":{"wkid":4326}});
map = new esri.Map("map",{extent:esri.geometry.geographicToWebMercator(initExtent)});
var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer");
var basemap_sing = new esri.layers.ArcGISTiledMapServiceLayer("http://karthikpc:8399/arcgis/rest/services/Carriage_Mercantor/MapServer",{ displayLevels:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]});
var featureLayer = new esri.layers.FeatureLayer("http://karthikpc:8399/arcgis/rest/services/Carriage_Mercantor/FeatureServer/0", {
mode: esri.layers.FeatureLayer.MODE_SNAPSHOT,
infoTemplate: infoTemplate,
outFields: ["*"]
});
var highlightSymbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_CROSS, new dojo.Color([255,0,0]), 3), new dojo.Color([125,125,125,0.35]));
featureLayer.setRenderer(new esri.renderer.SimpleRenderer(highlightSymbol));
//adding the two layers to the map
map.addLayer(basemap);
map.addLayer(basemap_sing);
dojo.connect(map, "onLoad", new_function);
}
catch(e){
alert('An error has occurred: '+e.message);
}
}
function new_function(){
//building query
var queryTask = new esri.tasks.QueryTask("http://karthikpc:8399/arcgis/rest/services/Carriage_Mercantor/FeatureServer/0");
var query = new esri.tasks.Query();
query.returnGeometry = true;
query.outFields = ["LINK_ID","ROADNAME","CAT"];
query.where = "CAT='CATA'";
//collecting features
dojo.connect(queryTask, "onComplete", function(featureSet) {
map.graphics.clear();
var symbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_CROSS, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,255,255,0.35]), 1),new dojo.Color([125,125,125,0.35]));
dojo.forEach(featureSet.features,function(feature){
var graphic = feature;
graphic.setSymbol(symbol);
graphic.setInfoTemplate(infoTemplate);
map.graphics.add(graphic);
});
});
queryTask.execute(query);
}
dojo.addOnLoad(init);
... View more
05-03-2012
11:52 PM
|
0
|
2
|
613
|
POST
|
Hi, Thank you very much for your reply. I had corrected the code by adding the layer id and i was able to verify the featurelayer has been loaded using an onLoad event. Would the feature layer be visible,like the normal layer? var featureLayer = new esri.layers.FeatureLayer("http://karthikpc:8399/arcgis/rest/services/Carriage_Mercantor/FeatureServer/0", {
mode: esri.layers.FeatureLayer.MODE_ONDEMAND,
infoTemplate: infoTemplate,
outFields: ["*"]
}); When i added an onclick event with the feature Layer it didnt seem to work. My final goal would be given a set of roads on the network , I should be able to highlight them, I thought using the feature Layer would prove useful, correct me if i was wrong.
... View more
05-02-2012
02:03 AM
|
0
|
0
|
247
|
POST
|
Hi I am currently exploring ARCGIS Javascript API. I have my own map services and feature services up on my local server. I would want to use the FeatuerLayer to select and highlight feature on the map. But when i add my feature service i get the following error. TypeError: Unable to draw graphic (geometry:null, symbol:null): _14 is undefined** I am not able to figure out what this could be. And I am not sure if the feature layer has been added to the map or not. How could I check if it has been added? I tried using a dojo.connect method with the FeatureLayer with an onClick event. But this doesn't seem to work. Have placed the code below dojo.require("dijit.layout.ContentPane"); dojo.require("esri.map"); dojo.require("esri.layers.FeatureLayer"); dojo.require("esri.tasks.query"); var map; var selectionToolbar; var infoTemplate = new esri.InfoTemplate(); infoTemplate.setTitle("${ROADNAME}"); infoTemplate.setContent( "ROAD NAME: ${LINK_ID} " + "CAT${CAT}"); function init() { try { var initExtent = new esri.geometry.Extent({"xmin":103.55,"ymin":1.13,"xmax":104.16,"ymax":1.56,"spatialReference":{"wkid":4326}}); map = new esri.Map("map",{extent:esri.geometry.geographicToWebMercator(initExtent)}); var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"); //my map service layer var basemap_sing = new esri.layers.ArcGISTiledMapServiceLayer("http://karthikpc:8399/arcgis/rest/services/Carriage_Mercantor/MapServer",{ displayLevels:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]}); // my feature layer which i am not able to use var featureLayer = new esri.layers.FeatureLayer("http://karthikpc:8399/arcgis/rest/services/Carriage_Mercantor/FeatureServer", { mode: esri.layers.FeatureLayer.MODE_ONDEMAND, infoTemplate: infoTemplate, outFields: ["*"] }); map.addLayer(basemap); map.addLayer(base_sing); map.addLayer(featureLayer); dojo.connect(map, "onLoad", initSelectToolbar); dojo.connect(featureLayer."onClick",helloworld); } catch(e){ alert('An error has occurred: '+e.message); } } function helloworld(){ alert("hello world"); } dojo.addOnLoad(init);
... View more
05-01-2012
08:14 PM
|
0
|
2
|
756
|
POST
|
Hi I am currently exploring ARCGIS Javascript API. I have my own map services and feature services up on my local server. I would want to use the FeatuerLayer to select and highlight feature on the map. But when i add my feature service i get the following error. TypeError: Unable to draw graphic (geometry:null, symbol:null): _14 is undefined** I am not able to figure out what this could be. And I am not sure if the feature layer has been added to the map or not. How could I check if it has been added? I tried using a dojo.connect method with the FeatureLayer with an onClick event. But this doesn't seem to work. Have placed the code below dojo.require("dijit.layout.ContentPane"); dojo.require("esri.map"); dojo.require("esri.layers.FeatureLayer"); dojo.require("esri.tasks.query"); var map; var selectionToolbar; var infoTemplate = new esri.InfoTemplate(); infoTemplate.setTitle("${ROADNAME}"); infoTemplate.setContent( "ROAD NAME: ${LINK_ID} " + "CAT${CAT}"); function init() { try { var initExtent = new esri.geometry.Extent({"xmin":103.55,"ymin":1.13,"xmax":104.16,"ymax":1.56,"spatialReference":{"wkid":4326}}); map = new esri.Map("map",{extent:esri.geometry.geographicToWebMercator(initExtent)}); var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"); //my map service layer var basemap_sing = new esri.layers.ArcGISTiledMapServiceLayer("http://karthikpc:8399/arcgis/rest/services/Carriage_Mercantor/MapServer",{ displayLevels:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]}); // my feature layer which i am not able to use var featureLayer = new esri.layers.FeatureLayer("http://karthikpc:8399/arcgis/rest/services/Carriage_Mercantor/FeatureServer", { mode: esri.layers.FeatureLayer.MODE_ONDEMAND, infoTemplate: infoTemplate, outFields: ["*"] }); map.addLayer(basemap); map.addLayer(base_sing); map.addLayer(featureLayer); dojo.connect(map, "onLoad", initSelectToolbar); dojo.connect(featureLayer."onClick",helloworld); } catch(e){ alert('An error has occurred: '+e.message); } } function helloworld(){ alert("hello world"); } dojo.addOnLoad(init);
... View more
05-01-2012
06:58 PM
|
0
|
1
|
467
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|