POST
|
The try catch error gone after changing the version 2 and changed esriConfig to esri.config ( I wonder sample in version 2.0 is using esriConfig). Nothing is happening when I use labelPoints method. So, I used simply method first and then passed the result of simply method to labelPoints method. In simplify method OnError function returning the below error: [HTML]Error: Deferred Cancelled: [Exception..."Access to restrited URI denied" code: :1012: nsresult: "0x805303f4 (NS_ERROR_DOM_BAD_URI)" location:"http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.0 Line 16"][/HTML] looks like something wrong the way I am using proxy?
... View more
07-16-2010
08:33 AM
|
0
|
0
|
464
|
POST
|
Also, are you using a proxy page? If you're sending a geometry that is more than a few points you'll want to have a proxy page configured. http://help.arcgis.com/en/webapi/javascript/arcgis/help/jshelp/ags_proxy.htm Sorry, I tried that way ([ploy] too. here is the code that I used
function init() {
//identify proxy page to use if the toJson payload to the geometry service is greater than 2000 characters.
//If this null or not available the project and lengths operation will not work. Otherwise it will do a http post to the proxy.
esriConfig.defaults.io.proxyUrl = "/arcgisserver/apis/javascript/proxy/proxy.ashx";
esriConfig.defaults.io.alwaysUseProxy = false;
//create map
map = new esri.Map("mapDiv", { slider: false });
dojo.connect(map, "onLoad", initFunctionality);
//create and add new layer
var layer = new esri.layers.ArcGISDynamicMapServiceLayer("http://maps.lsuagcenter.com/ArcGIS/rest/services/LAFloods/LAFloodMaps/MapServer");
map.addLayer(layer);
}
function initFunctionality(){
//code to add graphics - I have not included here
showpopUp(obj);
}
function showpopUp(obj){
var obj;
var parishFIPS = obj.value;
var graphic;
var graphics = map.graphics.graphics;
for (var i = 0; i < graphics.length; i++) {
if (parishFIPS == graphics.attributes.FIPS) {
graphic = graphics;
break;
}
}
var geometryService = new esri.tasks.GeometryService("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer");
var geometry = graphic.geometry;
// geometry.setSpatialReference(new esri.SpatialReference({"wkid":4269}));
try {
geometryService.labelPoints([geometry], function(labelPoints) {
dojo.forEach(labelPoints, function(labelPoint) {
var x;
});
});
} catch (Error) {
alert(Error);
}
}
The error caught by try catch block was _b44[0].geometry is undefined. I used proxypage code same as in ESRI' labelPoints sample . Does it matter if proxyPage code is used in other function where esri.Map object defined? Thanks for your help.
... View more
07-15-2010
06:37 PM
|
0
|
0
|
464
|
POST
|
I was watching a sample video of Silverlight Behaviours. In that video the presenter had added a class using Blend behaviour template installed on visual studio, but I do not see any templates in VS on my machine even though I have installed Blend 3 SDK. Any suggestions please? Thanks
... View more
07-15-2010
02:15 PM
|
0
|
1
|
488
|
POST
|
What is parish.geometry.rings? Is that a single ring or an array of rings? I don't think addRing() can handle an array of rings... That's a single ring (may be I am wrong). parish={"geometry":{ "rings":[[
[-93.342379335, 33.0183192760001],
[-93.2386607509999, 33.0175064210001],
[-93.2377443679999, 32.715973435],
[-93.186697908, 32.716227121],
[-93.186091692, 32.6729424970001],
[-93.1777359559999, 32.6722301020001],
[-93.182898703, 32.6657050920001],
[-93.1777075959999, 32.6648898650001]
]] }};
I tried to construct the polygon in the following way but no luck. var polygonJson = { "rings": parish.geometry.rings, "spatialReference": { "wkid": 4269} };
var polygon = new esri.geometry.Polygon(polygonJson); I also tried to use simplify method which produced a different error - "TypeError:_b06[0].geometry is undefined. I guess I am doing something wrong in constructing the parameter(polygon) to gemotryService methods.
... View more
07-15-2010
01:36 PM
|
0
|
0
|
464
|
POST
|
I am trying to use the labelPoints method using ESRI's geometry service. [HTML] var geometryService = new esri.tasks.GeometryService("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"); var poly = new esri.geometry.Polygon(new esri.SpatialReference({ wkid: 4269 })); poly.addRing(parish.geometry.rings); try { geometryService.labelPoints(poly, OnLabelPointsComplete, onError); } catch (Error) { alert(Error); }[/HTML] But something is wrong. I am getting 'TypeError: _b44[0] is undefined' error in try..catch block. Any ideas? Thanks.
... View more
07-15-2010
01:00 PM
|
0
|
9
|
2131
|
POST
|
Thanks for the quick reply. Yes, I have modified GetUrl method to force the spatial reference to 4326. The layer did not appear but there was a message at the bottom left corner of the browser window -" Transferring from <so and so server name>". Sorry, I was wrong. I changed WKID at different place. WMS layer did appear on the base map. Thanks for the tip.
... View more
07-08-2010
12:21 PM
|
0
|
0
|
426
|
POST
|
I'm not sure why it works with the Javascript API, but the way that the WMS class works in Silverlight is that it uses your map control's spatial reference to generate GetMap requests to the WMS. One thing you can do is download the sample WMS layer code here and modify the GetUrl() method to force the spatial reference to EPSG: 4326, then use this class instead of the 2.0 API WMS class. Thanks for the quick reply. Yes, I have modified GetUrl method to force the spatial reference to 4326. The layer did not appear but there was a message at the bottom left corner of the browser window -" Transferring from <so and so server name>". Also there are couple of questions regarding the example code (custom WMSLayer class exmaple) that you suggested to download: Q1: Why there are two similar ProxyHandler.ashx pages, one in web application and other in WMS project? Which one does the application use? Q2: Do I need to register the handler somewhere (web.config/IIS) to use it in the application, because the WMS layer was appeared only when I used SkipGetCapabilities="True". And when I set SkipGetCapabilites="False" ProxyHandler="../ProxyHandler.ashx" WMS layer did not appear. Thanks a lot for the help.
... View more
07-08-2010
11:52 AM
|
0
|
0
|
426
|
POST
|
If you append '&request=GetCapabilities' to your WMS service URL and put it in a browser, you should get an XML response containing all the service metadata. Among the metadata, look for the <layer> tags, and inside them, the CRS tags that tell you which spatial references are supported: <CRS>EPSG:4326</CRS> for instance. If 4629 is not among them, the WMS service will reject your GetMap requests, since you specify the CRS along with the bounding box, etc. No, it does not has 4269 in CRS list. I was able to display this WMS layer on a base map using Jvascript API. Is there any explanation why Silverlight is not accepting to display the WMS layer? Thanks.
... View more
07-08-2010
09:15 AM
|
0
|
0
|
426
|
POST
|
I tried to use the WMSLayer class ion v 2.0 for adding a WMS layer. The layer showed perfectly on the ESRI' sworld street map. But when I switched ESRI's base map with a base map at my organization the WMS layer is not appearing over the base map. Does base map needs to use particular spatial reference? Base map at my organization uses 4269 spatial reference. any help please..
... View more
07-07-2010
02:19 PM
|
0
|
7
|
2514
|
POST
|
I had this problem too. In my case, the issue was due to some styles applied to DIV tags in the page. Even the rubber band (when tried to zoom in/out) displaced in y-direction. Which version of Javascript API are you using?. Also, could you post your code to find the issue?
... View more
06-24-2010
02:58 PM
|
0
|
0
|
181
|
POST
|
I have searched the forum for this information but I couldn't find the answer. I am not real clear on handling the spatial reference. I'm using ESRI's online World Street Map Service with my tiled service. The street layer shows up in the map, but not my tiled service. I'm modifying an existing sample- in this sample the spatial reference is set to wkid 102100. Do I need to set this same spatial reference (WGS_1984_Web_Mercator_Auxiliary_Sphere) in the MXD that that I use for my tiled service? Is the Spatial reference of your Tiled Map Service same as the ESRI's online world street map (or which ever you are using)? You can't add two Tiled map service layers having different spatial reference to a map object. Since the cache has generated tiles of the layers with their corresponding spatial reference, the tiles will not align when you try to add two Tiled map service layers to a map object. You can declare your Tiled map service as DynamicMapService in your code. In the below code, windspeed service is actually a Tiled service. var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer");
map.addLayer(basemap);
var windspeed = new esri.layers.ArcGISDynamicMapServiceLayer("http://maps.lsuagcenter.com/ArcGIS/rest/services/LAWinds/LABWS/MapServer");
map.addLayer(windspeed);
... View more
06-22-2010
09:33 AM
|
0
|
0
|
215
|
POST
|
Even though your service is published as tiled, you can still use it as a dynamic layer on the client. It worked. Thanks a lot.
... View more
06-21-2010
10:51 AM
|
0
|
0
|
544
|
POST
|
You cannot mix tiled layers of different spatial reference together. They basically wouldn't overlap correctly. It's the projection's equivalent of mixing Miles and Kilometers together. You can set the second layer to be an ArcGISDynamicMapserviceLayer. ArcGIS dynamic services can reproject on the fly and thereby match the baselayer's spatial reference. Of course you won't get the performance benefit of the cache layers, but that is the tradeoff you are making. I have used Javascript API previously in which I was able to add two tiled layers of different WKID (4326 and 4269) and two layers were visible. You can set the second layer to be an ArcGISDynamicMapserviceLayer . Do you mean changing the Tiled Map Service to Dynamic on the server or declaring the layer as Dynamic layer in my web app? Thanks
... View more
06-18-2010
06:19 AM
|
0
|
0
|
544
|
POST
|
I am trying to add two TiledMapservices of different spatial reference to a map object. Only the layer whichever I add first is showing. How to make both layers to appear? Any help would be appreciated. Thanks
... View more
06-17-2010
11:40 AM
|
0
|
9
|
1709
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|