|
POST
|
Are you sure response is a string? What does the rest of your esri.request() code look like? In practice, especially when talking to ArcGIS Server endpoints, I don't think there are many (any?) times you'd want text over json. Why mess around with wrapping a response in parens and calling eval() when the server can return jsonp?
... View more
04-25-2011
11:40 AM
|
0
|
0
|
1799
|
|
POST
|
True, we're not likely to find a solution to OP's question/problem in this thread. But I'd like to continue this discussion as I think we still need to clarify for anyone else who comes across this thread. A featureSet, in the context of the JavaScript API and as delivered to the client, is a JSON object. Let's look at this from another angle. How about we talk about this in terms of the REST API? If you want features from a layer in a map service, how do you get them? You use the query endpoint. If you use the endpoint via the JavaScript API's QueryTask (recommended) or through esri.request, you are getting back JSON (as long as you specify f=json when using esri.request).
... View more
04-25-2011
10:41 AM
|
0
|
0
|
1799
|
|
POST
|
Posted an answer over on gis.stackexchange: http://gis.stackexchange.com/questions/8896/feature-layer-with-ondemand-mode/8912#8912
... View more
04-25-2011
08:38 AM
|
0
|
0
|
710
|
|
POST
|
@hzhu As you request more features (using either esri.request or a queryTask), the response size will grow. If the server only returned the extent of the features that satisfy a request, then the response size will be consistent if you ask for 10 or 1000 features. To my knowledge, there's not an out of the box way to get just a bounding box for features that satisfy a request w/o sending all of the geometries to the client. How is the return value of esri.request different than a queryTask? The JavaScript syntax for working with them differs but both fetch plain text from the server (you can verify this via firebug or chrome's dev tools) that is then turned into JavaScript objects on the client.
... View more
04-25-2011
07:54 AM
|
0
|
0
|
3986
|
|
POST
|
@hzhu that still brings all the geometries across the wire, which is what OP is trying to avoid.
... View more
04-22-2011
03:44 PM
|
0
|
0
|
3986
|
|
POST
|
Maybe "easier" was the wrong word... I think seeing the point move as you drag it provides a better user experience.
... View more
04-22-2011
10:33 AM
|
0
|
0
|
3704
|
|
POST
|
There's an easier way to do this. I think the code below was originally posted in the old forums but I've hung on to it for a while: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<title>Moving a marker</title>
<link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.2/js/dojo/dijit/themes/tundra/tundra.css">
<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.2"></script>
<script type="text/javascript">
dojo.require("esri.map");
dojo.require("dojox.gfx.move");
dojo.addOnLoad(init);
var map;
function init() {
map = new esri.Map("map");
dojo.connect(map, "onLoad", onMapLoad);
var tiledMapServiceLayer = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer");
map.addLayer(tiledMapServiceLayer);
}
function onMapLoad() {
var geometry = map.extent.getCenter().offset(0, 15);
var symbol = new esri.symbol.SimpleMarkerSymbol().setColor("red");
var graphic = new esri.Graphic(geometry, symbol);
// Add a graphic
map.graphics.add(graphic);
// Make the shape moveable
var dojoShape = graphic.getDojoShape();
var moveable = new dojox.gfx.Moveable(dojoShape);
// Update the geometry at the end of move
var moveStopToken = dojo.connect(moveable, "onMoveStop", function(mover) {
// Get the transformation that was applied to
// the shape since the last move
var tx = dojoShape.getTransform();
var startPoint = graphic.geometry;
var endPoint = map.toMap(map.toScreen(startPoint).offset(tx.dx, tx.dy));
// clear out the transformation
dojoShape.setTransform(null);
// update the graphic geometry
graphic.setGeometry(endPoint);
// You can find quite a bit of information about
// applying transformations to Dojo gfx shapes in this
// document:
// http://docs.dojocampus.org/dojox/gfx#coordinates-and-transformations
});
}
</script>
</head>
<body class="tundra">
<p>
</p>
<div id="map" style="width:700px; height:500px; border:1px solid #000;"></div>
</body>
</html>
... View more
04-21-2011
05:22 PM
|
0
|
0
|
3704
|
|
POST
|
Unless you want to write a server object extension to do this, I think you're stuck sending geometries to the client and computing an extent from them.
... View more
04-19-2011
07:56 AM
|
0
|
0
|
3986
|
|
POST
|
That's possible, but did you try maxAllowableOffset? It's not talked about much but it will do exactly what you want: generalize geometries returned from your service for an appropriate scale.
... View more
04-15-2011
08:55 PM
|
0
|
0
|
1521
|
|
POST
|
A quick search for "zip codes" at http://gis.stackexchange.com turns up some solid resources: Where can I obtain an up-to-date list of US ZIP Codes with Latitude and Longitude Geocodes? Most Up-To-Date Source for US Zip Code Boundaries That being said, "zip3" and "zip_poly" datasets still ship on the Esri Data & Map DVDs.
... View more
04-15-2011
01:39 PM
|
0
|
0
|
3212
|
|
POST
|
With HTML 5 coming, I think the JavaScript API is a totally sound development platform. Good Luck! I'm going to nit pick a little... What does this really mean? HTML5 is coming?
... View more
04-15-2011
01:33 PM
|
0
|
0
|
1803
|
|
POST
|
Are you talking about accessibility like a11y or are you talking about not needing a browser plug-in to view a site/app? For editors, I'm a fan of more advanced text editors as opposed to a full blown IDE. On Windows, I like gVIM or Notepad++. On OSX, MacVIM is my preferred choice. Regarding the WYSIWYG aspect, I would say you don't need this. There's no compilation step in JS development so just save and reload your app in your browser. You'll immediately see your changes.
... View more
04-15-2011
01:30 PM
|
0
|
0
|
1803
|
|
POST
|
Whichever one you end up going with (querytask or a feature layer), look into using maxAllowableOffset to generalize your geometries before they're sent to the client.
... View more
04-15-2011
09:17 AM
|
0
|
0
|
1521
|
|
POST
|
Hi Anaish, You may use esri.geometry.Polygon.getExtent() method to get the extent of a polygon. Here is its documentation: http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi_start.htm#jsapi/polygon.htm#getExtent While correct, I don't think this addresses OP's original question. There's not a way that I know of to only get an extent back from a REST endpoint. You're either getting geometries, or you're not. But it seems like a lot of extra effort to send actual geometries over the wire when you're only interested in their extents. Are you open to using pre-computed extents and loading those from a .json file? I used this strategy in a dijit I did a while back: https://github.com/swingley/zoomto_dijit
... View more
04-15-2011
08:48 AM
|
0
|
0
|
3986
|
|
POST
|
GeoRSS is XML so a good place to start would be the Data Access - XML Data sample. You'll need to use a proxy page if you're app is not running on the ansur.no domain.
... View more
04-12-2011
07:55 AM
|
0
|
0
|
520
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 01-23-2012 07:54 AM | |
| 1 | 05-28-2010 08:31 AM | |
| 1 | 11-12-2012 08:12 AM | |
| 3 | 02-23-2012 10:57 AM | |
| 1 | 06-27-2011 08:51 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|