|
POST
|
You wouldn't. You'd add two graphics to the map, one with the target symbol and one with the text symbol. Check out the "Find Address" example to see how it's done there. http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jssamples/locator_address.html
... View more
08-16-2012
11:58 AM
|
0
|
0
|
591
|
|
POST
|
I always thought that code had already been minified. meaning the var names are obfuscated and comments have been removed. I haven't pulled those before, but now I will, thanks. No wonder, last dl I have is 2.8 where those files were not included, at least not when I downloaded them. They're in 3.0 though. That's fun.
... View more
08-13-2012
06:00 AM
|
0
|
0
|
1158
|
|
POST
|
The ArcGIS JavaScript unbuilt source is not available, and as far as I know has never been available. There is a posting up at the ideas site for this suggestion though, so go upvote it and let's see what goes from there. http://ideas.arcgis.com/ideaView?id=087E00000004JOzIAM
... View more
08-13-2012
05:40 AM
|
0
|
0
|
1158
|
|
POST
|
Not sure I quite understand, but I usually set the offset to half the height, so that the bottom of the marker, usually a pointer or flag will be at the actual x/y of the graphic.
var pm_sym = new esri.symbol.PictureMarkerSymbol({
url: "images/stop-sign_alt.png",
height: 26,
width: 24,
yoffset: 26 / 2,
type: "esriPMS"
});
... View more
08-10-2012
03:41 PM
|
0
|
0
|
1219
|
|
POST
|
Try listening to the GraphicsLayer "onClick" event http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jsapi/graphicslayer.htm#onClick The returned event object should have the graphic that got clicked.
... View more
08-10-2012
03:29 PM
|
1
|
0
|
4263
|
|
POST
|
I'm not even sure what events the editor emits, if any, but the FeatureLayer has an "onEditsComplete" that will let you know what was deleted. http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jsapi/featurelayer.htm#onEditsComplete
... View more
08-09-2012
05:45 AM
|
0
|
0
|
1952
|
|
POST
|
This is v3.0 right? I heard someone comment that if your dojo.Config has { async: true }, that the geometry service may not work properly. I was never able to confirm it, but I just remembered right now.
... View more
08-02-2012
09:45 AM
|
0
|
0
|
1621
|
|
POST
|
I just store them as strings in a SQL table. No spatial or gdb. In this case, it wasn't needed.
... View more
08-02-2012
09:36 AM
|
0
|
0
|
1836
|
|
POST
|
Without running it the only thing that stands out as a possibility is this line. params.geometries = feature.geometry; I think it needs to be passed as an array. params.geometries = [ feature.geometry ]; That's how the ref shows it. http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jsapi/bufferparameters.htm#geometries Other than that, not too sure.
... View more
08-02-2012
09:03 AM
|
0
|
0
|
1621
|
|
POST
|
Try parseInt on your bufferDist value. This line is returning your value as a string. var bufferDist = $("#inputBuffer").val();
... View more
08-02-2012
08:37 AM
|
0
|
0
|
1621
|
|
POST
|
I don't really use dojo.xhr too often to do my CRUD, but it should look similar to this.
updateData = function(graphic) {
var _args, attr, data, geom;
attr = graphic.attributes;
// JSON methods may not be available in all browsers
// I think dojo.toJson(obj).toString() will
// do the same thing.
geom = JSON.stringify(graphic.geometry.toJson());
data = {
"Geometry": geom
};
_args = {
// my .net service will handle the writing
// to sql server
url: "api/service/" + attr.id,
postData: data,
handleAs: "json"
};
// I think you'd use xhrRawPost for json data,
// I'm not clear on this one.
return dojo.xhrRawPost(_args);
};
Then to read the updated data at a later time.
graphics = []; // array that will hold my graphics
// results would be the response from
// from a REST request via dojo xhr or jquery ajax
dojo.forEach(results, function(result) {
var g, res_geom, res_obj;
// result is JSON, but Geometry is a string field
// convert string field to JSON object
res_obj = dojo.fromJson(result.Geometry);
// convert json to geometry
res_geom = esri.geometry.fromJson(res_obj);
//create my graphic
g = new esri.Graphic(res_geom, symbolHelper.lineSymbol(), {
"Id": attribute.Id,
"WorkOrderId": attribute.WorkOrderId
});
return graphics.push(g);
});
// In this case, I update a FeatureLayer, but you can easily just add
// graphics to a GraphicsLayer
prev_graphics = lineFeatures.graphics;
lineFeatures.applyEdits(graphics, null, prev_graphics);
Hope that helps a bit, I tweaked some stuff from a project for this example to simplify it a bit, but not too much.
... View more
08-02-2012
07:44 AM
|
0
|
0
|
1836
|
|
POST
|
I actually do this a lot. Geometry has a toJson() method, notice the lowercase "son", you guys just had to be different 😉 http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jsapi/geometry.htm#toJson I then do a jsonObject.toString() and store this in a string field that gets saved in a SQL table field along with any other data that's required. Then when I get my results from the db, I take that field and convert it to JSON using dojo or jquery or JSON.parse(). I'd avoid using eval if a public facing site, too risky, but once you have the JSON object of the geometry you saved, you can now convert it to a real Geometry with esri.geometry.fromJson. http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jsapi/namespace_geometry.htm#fromJson Then you can create your graphics to show on the map. t's fast, simple and efficient for basic needs.
... View more
08-02-2012
05:38 AM
|
0
|
0
|
1836
|
|
POST
|
You can send it in the IdentifyParameters with layerDefinitions http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jsapi/identifyparameters.htm#layerDefinitions This will filter it before you get the results from the server.
... View more
08-01-2012
09:03 AM
|
0
|
0
|
530
|
|
POST
|
I just tried your site in IE8, Chrome 20, Opera 12 and they all look the same as your expected result. However, they all threw the same error Uncaught TypeError: Cannot call method 'then' of undefined serverapi.arcgisonline.com/jsapi/arcgis/2.6/js/dojo/dojo/DeferredList.xd.js:8 - This is tied to the Legend as far as I can tell. Opera has a really cool debug feature that separate inline JS into it's own screens to view. It looks like you may have to add an eventListener to the map for the "onLayersAdd" event, and use map.addLayers([lyr1, lyr2]). Right now you're doing map.addLayers([lyr1]) map.addLayers([lyr2]) The creating the legend and running legend.startup(), so it could be the case that the map layers are not fully loaded. The timing of this load can vary, which might explain the inconsistencies you are seeing. As for the tiled look, do you happen to be working behind a proxy? I've seen this happen before, but not consistently and the only thing I could think of was that it may have had to do with working behind a proxy firewall.
... View more
08-01-2012
06:34 AM
|
0
|
0
|
1644
|
|
POST
|
Well, for your first question, you can store some basic data in a cookie. Dojo has a cookie module you can use. http://dojotoolkit.org/reference-guide/1.7/dojo/cookie.html You wouldn't want to store too much stuff, I think cookies have a 4kb limit, but that's plenty to store some config information. As for your second question, not sure. Are you waiting for the "onLayersAdd" event?
... View more
08-01-2012
06:12 AM
|
0
|
0
|
917
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | a week ago | |
| 1 | 3 weeks ago | |
| 1 | 12-09-2025 08:20 AM | |
| 1 | 11-13-2025 03:13 PM | |
| 2 | 11-06-2025 11:10 AM |
| Online Status |
Offline
|
| Date Last Visited |
12 hours ago
|