POST
|
So I have tried to generate a token at http://<myserver>:6080/arcgis/admin/generateToken, using the HTTP Referrer parameter, passing it the REST endpoint http://<myserver>:6080/arcgis/rest/services/<myfolder>/<myservice>/MapServer and setting the Expiration field to 30. This REST endpoint is only accessible with the same credentials I used when generating the token. Immediately after getting the token, I tried to test my token by using a web browser and entering http://<myserver>:6080/arcgis/rest/services/<myfolder>/<myservice>/MapServer?f=json&token=<mytoken> The response I get back is {"error":{"code":498,"message":"Invalid Token","details":[]}} However, I was able to get this to work using the Request IP parameter when generating the token. The problem is I would like other folks to access my service with the token. Any advice? Thanks, Jay
... View more
02-08-2013
10:13 AM
|
0
|
3
|
9222
|
POST
|
One question I have about this: is there any way to configure a cluster layer for a feature service so it isn't limited by the 1000 feature return limit on Server? It seems that one of the benefits of clustering would be being able to visualize total number of events in an area, even if the total events are greater than 1000. Jay
... View more
02-01-2013
05:26 AM
|
0
|
0
|
712
|
POST
|
Kelly - unfortunately the app isn't public, but I was able to reproduce on my end using this using Chrome and Firefox. Zooming to the second location (in either order) takes a while to update the tiles. If you look at the NET calls using dev console, you can see it loading tons of tiles... Thanks! <!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=7,IE=9" />
<!--The viewport meta tag is used to improve the presentation and behavior of the samples
on iOS devices-->
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/>
<title>FeatureLayer On Demand</title>
<link rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.3/js/dojo/dijit/themes/claro/claro.css">
<link rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.3/js/esri/css/esri.css">
<style>
html, body { height: 100%; width: 100%; margin: 0; padding: 0; }
#header {
margin: 2px;
border: solid 4px #224a54;
color:black; font-size:12pt;
text-align:left; font-weight:bold; height:40px;
}
</style>
<script type="text/javascript">var djConfig = {parseOnLoad: true};</script>
<script src="http://serverapi.arcgisonline.com/jsapi/arcgis/3.3"></script>
<script type="text/javascript">
dojo.require("esri.map");
dojo.require("esri.layers.FeatureLayer");
dojo.require("dijit.form.Button");
dojo.require("dijit.Dialog");
var map;
function init() {
//Instantiate Map
map = new esri.Map("map", {
basemap: "gray",
center: [-97, 38],
zoom: 5,
navigationMode: "classic"
});
}
function zoomToCA(){
map.centerAndZoom([-118.4075, 33.9424], 18);
}
function zoomToDC(){
map.centerAndZoom([-77.038472, 38.85188],18);
}
dojo.addOnLoad(init);
</script>
</head>
<body class="claro">
<div style="position:relative;float:left; width:100%;height:100%;">
<div id="header" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'top'">
<button data-dojo-type="dijit.form.Button" data-dojo-props="onClick:function(){zoomToCA();}">Zoom to CA</button>
<button data-dojo-type="dijit.form.Button" data-dojo-props="onClick:function(){zoomToDC();}">Zoom to DC</button>
</div>
<div id="map" style="width:100%;height:100%;">
</div>
</div>
</body>
</html>
Jay is your app public? If so can you send the url so I can test? I can't reproduce the issue with my simple test app.
... View more
01-16-2013
04:43 AM
|
0
|
0
|
644
|
POST
|
It's featureLayer.refresh() not map.refresh(). Does that work for you? hmmm, refresh() doesn't seem to do anything. map.refresh(); Or am I using the incorrect syntax ?
... View more
01-15-2013
01:48 PM
|
0
|
0
|
2247
|
POST
|
If you are using a featurelayer, it supports refresh() and redraw() methods. refresh() requeries the server, while redraw() just gets redraws the data from cache. I don't see these methods documented in the API, but there were there before, and I've been using them for a while... Jay
... View more
01-15-2013
10:22 AM
|
0
|
0
|
2247
|
POST
|
I have a GP service that takes a user-drawn polygon and uses it as a clipping extent as well. The actual input the GP service is expecting is a GPFeatureRecordSetLayer, which I got from the DataType field of the parameter in the REST service endpoint. I don't know if that is your setup as well, but here is my code to take a graphic and submit it to the gp task: var features = [];
features.push(graphic);
var featureSet = new esri.tasks.FeatureSet();
featureSet.features = features;
var params = {"Selecting_Geometry": featureSet, "OutputType": format};
gp.submitJob(params, completeCallback, statusCallback, function(error){.... Hope that helps! dugtoni;263832 wrote: Hey everyone, I have a map service where someone can select a polygon and that selected polygon is sent to a gp service as a clipping extent. The polygon where the user clicks is made into a graphic, and then that graphic is then sent to the gp service. The problem is the gp service does not recognize this as a valid clipping extent and the tool fails because of that parameter. I have tried converting this graphic from web mercator to geographic, and also have tried using the esri.geometry.Polygon(name of graphic) command to try and make it a valid polygon which the gp service can use but I can't seem to get it to work. Please let me know if you have any idea how to solve this problem. Thank you for your time!![/Q
... View more
01-15-2013
10:17 AM
|
0
|
0
|
161
|
POST
|
As far as the blurring issue to which Renee Maxwell referenced when changing the map zoom level programatically, I was seeing some strange behavior there as well. I was able to resolve this issue by changing my navigationMode in my map object from 'css-transforms' to 'classic'.
... View more
01-15-2013
10:10 AM
|
0
|
0
|
150
|
POST
|
Thanks Kelly! Very helpful - I hadn't known about the autoNavigate switch. I guess the default is to true though. Does that also apply to the "World Geocoding Service" too if I'm using both, or is that handled separately? However, since I want to zoom as well as pan, I have tried multiple ways, including centerandZoom, centerAt then setZoom or setLevel, etc. etc. However, each time it fires, the map zooms in, but the tiles don't update (as if it's zooming in too fast). The tiles remain blurry, and my feature layer doesn't redraw. Plus, if I try to manually zoom (scroll wheel or map navigation), the map just zooms out to the previous country level extent from which I generally start. I've worked around this to some degree of success using setTimeout to zoom (after auto pan) and then to refresh the feature layer, but it doesn't always work. Maybe there is something more specific with my map going on since this isn't a common problem. UPDATE - I just tried changing my map navigation mode from "css-transforms" to "classic" and that seemed to fix my problem, even though I was testing in Chrome and FF. However, I have noticed some other interesting behavior: My map starts at CONUS, the country wide view. If I search for, say LAX, the map pans and zooms using my custom handler, the tiles update (and look fine), the feature layer works too (it really did seem to be a navigationMode problem). However, while zoomed into LAX, if I then use the locator service and search for DCA, the map pans to DCA (no zooming since finding LAX already set the zoom level to 18 per your code example), but takes about 10 seconds to update the tiles. Looking at the NET calls in Firebug, it seems as if it is making calls to every tile between LAX and DCA at that zoom level - necessarily way too many. Is that expected behavior? Thanks, and sorry for the long post... Jay
... View more
01-15-2013
10:01 AM
|
0
|
0
|
644
|
POST
|
I am using v3.3 and the geocoder dijit. I've added a custom address locator, and attached a handler: dojo.connect(geocoder, "onSelect", doSomething); function doSomething(results){ console.log(results); map.setExtent(results.extent); map.setZoom(12); } However, when the map zooms, the tiles are blurry and the feature layer isn't drawn. Furthermore, if I try to manually zoom (either using my mouse scroll wheel or the zoom controls on the map itself), the map returns to the previous extent instead of the next zoom level - no matter if I try to zoom in OR out. Is anyone else experiencing this problem? Also, in the geocoder dijit, does specifying the "onSelect" handler override the default behavior for using the default Esri World geocoding service, or is that completely separate? When I geocode using the Esri World Geocoder Service, the zooming and panning seems to work find when a result is selected. Thanks! Jay
... View more
01-15-2013
05:29 AM
|
0
|
5
|
2346
|
POST
|
I instantiated a geocoder in my app using the new geocoder dijit (I am very excited about this). However, it doesn't work using my custom geocoder (ArcGIS for Server 10.1 SP1). //geocoder digit var geocodersArray = [{url: "http://gis.domain.com:6080/arcgis/rest/services/EON/AirportsGeocode/GeocodeServer", name:"Landing Facility Geocoder"}]; var geocoder = new esri.dijit.Geocoder({ map: map, autoComplete: true, maxLocations:10, geocoders: geocodersArray, geocoderMenu: false, arcgisGeocoder: false },"search"); geocoder.startup(); } As far as I can tell (from Firebug) the request the geocoder dijit sends is: "http://gis.domain.com:6080/arcgis/rest/services/EON/AirportsGeocode/GeocodeServer/findAddressCandidates?singleLine=Los Angeles International Airport&f=json&outSR=%7B%22wkid%22%3A102100%7D" plus a callback. No results are returned. If I run the same query directly from the REST endpoint on my server, I get "http://gis.domain.com:6080/arcgis/rest/services/EON/AirportsGeocode/GeocodeServer/findAddressCandidates?SingleKey=Los Angeles International Airport&Single+Line+Input=&outFields=&outSR=&searchExtent=&f=pjson", and results are returned. The difference seems to be that the geocoder dijit is using "singleLine" as the search parameter name, while ArcGIS for Server is using "SingleKey" or "Single Line Input" for the search parameter name. I tried replacing "SingleKey" with "singleLine" in my server query, and, as expected, no results are returned. So is this a bug in the geocoder dijit or am I missing something? Thanks, Jay
... View more
01-11-2013
05:47 AM
|
0
|
7
|
1337
|
POST
|
Using clip, MakeFeatureLayer, LayerToKML worked perfectly for this, in case anyone was wondering....
... View more
12-28-2012
11:08 AM
|
0
|
0
|
2265
|
POST
|
This this bug does affect the JS API FeatureLayer? Is there any workaround currently, or prediction of when it might be fixed? I had just recently posted this to the forums. Thanks! Jay
... View more
12-28-2012
10:20 AM
|
0
|
0
|
265
|
POST
|
I'm running ArcGIS for Server 10.1 SP1, and have recently been made aware of the bug that makes alternate get requests fail and the workarounds documented in this post and this one. Is this bug affecting the JS API when using a feature layer pointing to a REST service? For instance, I believe the FeatureLayer class is configured to query/redraw on map zoom. So when I zoom the map, the graphics disappear. And then when I zoom again, they reappear. This also occurs if I use a setInterval on a layer to auto-refresh on an interval. I'm hoping this is related to the bug and not caused by something else (but I'm not sure how the FeatureLayer class works, which is why I'm asking here). If it is related, is there a workaround. If no workaround, any progress on a hotfix, since this seems pretty serious.... Thanks, Jay
... View more
12-28-2012
08:02 AM
|
0
|
3
|
1426
|
Title | Kudos | Posted |
---|---|---|
1 | Wednesday | |
1 | 02-28-2024 07:43 AM | |
1 | 09-14-2022 06:39 AM | |
2 | 07-21-2023 07:11 AM | |
1 | 06-23-2022 07:46 AM |
Online Status |
Offline
|
Date Last Visited |
Thursday
|