|
POST
|
The 'onEditsComplete' event returns 3 arrays as it's arguments addResults, updateResults, deleteResults http://developers.arcgis.com/en/javascript/jsapi/featurelayer.html#onEditsComplete dojo.connect(editorWidget, 'onEditsComplete', function(addResults, updateResults, deleteResults){ console.log('addResults: ', addResults); console.log('updateResults: ', updateResults); console.log('deleteResults: ', deleteResults); }); Similarly, you can capture the results before they are sent to the server, by listening for 'onBeforeApplyEdits' http://developers.arcgis.com/en/javascript/jsapi/featurelayer.html#onBeforeApplyEdits I think you can modify the edits, but cannot cancel them if something doesn't meet your criteria.
... View more
04-23-2013
06:20 AM
|
0
|
0
|
1210
|
|
POST
|
JavaScript and Actionscript are quite similar in regards of syntax, especially if you ever did some AS2 development. You can have an element dispatch an event similar to AS3 https://developer.mozilla.org/en-US/docs/DOM/EventTarget.dispatchEvent Doing the same on regular JS objects (non-dom elements) takes some elbow grease, but Dojo in the JS API provides some very nice utilities to accomplish this. http://livedocs.dojotoolkit.org/dojo/Evented If you extend a new class based on dojo/Evented, you get access to some nice event delegation. The Dojo docs seem to be acting up, but an example would be something like var MySumClass = declare(['dojo/Evented'], {
constructor: function(x, y) {
this.x = x;
this.y = y;
}
dispatch: function() {
this.emit('myEvent', {
message: 'This is a test message.',
result: this.x + this.y
});
}
});
var myInstance = new MySumClass(5,10);
myInstance.on('myEvent', function(results) {
console.log('message', results.message);
console.log('results', results.result);
});
myInstance.dispatch(); // console logs print at this point
This also gives you the ability to to use dojo/on with dojo/Evented http://livedocs.dojotoolkit.org/dojo/on This opens up some cool uses where you can listen for events only once, pause them, remove them and so on.
... View more
04-23-2013
05:51 AM
|
0
|
0
|
1418
|
|
POST
|
Try putting the map initialization inside the ready() function after parsing to ensure everything is set first. I'm not sure you even need ready and parser if you were to set your config parseOnLoad: true.
... View more
04-06-2013
06:13 AM
|
0
|
0
|
2138
|
|
POST
|
Install web essentials to make your life easier. http://visualstudiogallery.msdn.microsoft.com/6ed4c78f-a23e-49ad-b5fd-369af0c2107f I'm not a big fan of VS, but if you have to tie an app in with some ASP/MVC there are a handful of nuget (install everything via nuget when possible) packages to help. Biggest drawback for me with JS in VS is the custom snippet system is just such a pain.
... View more
04-05-2013
06:16 PM
|
0
|
0
|
2555
|
|
POST
|
The other option would be to write your own zoom slider widget to handle zooming in and out, custom functions and disable the default zoom slider, but I prefer to handle most things like this via css and minimal js when possible rather than recreate the wheel.
... View more
03-20-2013
09:32 AM
|
0
|
0
|
3744
|
|
POST
|
I don't know if it's in the docs, but using the slider has an id #map_zoom_slider. It contains two divs of class .esriSimpleSliderIncrementButton and .esriSimpleSliderDecrementButton You'll want to use dojo/dom-construct or your favorite DOM manipulation library, or even vanilla JS is easy. Just add a new div with your icon after .esriSimpleSliderIncrementButton, give it an id to bind to and you should be good to go. Firebug in Firefox is great for this type of experimenting, because it will let you edit the DOM live. Attached is a screen of how I was able to test this in FireBug [ATTACH=CONFIG]22787[/ATTACH] Hope this helps.
... View more
03-20-2013
07:26 AM
|
0
|
0
|
3744
|
|
POST
|
You could frankenstein the Query Related Records example (which is broken by the way) http://help.arcgis.com/en/webapi/javascript/arcgis/samples/fl_query_related/index.html with the the Display identify results in popup http://help.arcgis.com/EN/webapi/javascript/arcgis/jssamples/find_popup.html Basically, do your related queries on a click event maybe (you can get the graphic and attributes on click of a featurelayer) and form the content of the window based on those results, then when done, show the infowindow.
... View more
03-14-2013
12:18 PM
|
0
|
0
|
624
|
|
POST
|
So do you already display the HTMLImageEl on the page and it will also be the PictureMarkerSymbol? It should be cached anyway once it's loaded once, but if you want to alleviate that issue of network calls, you can encode the image as base64 string and use that instead. A couple of resources http://www.base64-image.de/ http://webcodertools.com/imagetobase64converter Then set image src as "data:image/png;base64,<insert base64 string here>" I haven't used this for a PictureMarkerSymbol, but use it in other places. This works in most browsers, but with IE, only IE8 and up I think.
... View more
03-13-2013
11:34 AM
|
0
|
0
|
1338
|
|
POST
|
Connect and Aspect work off execution of method. So in the API, there is a method called onLayerAddResult() that is executed. Here is an older explanation of how these work. http://dojotoolkit.org/documentation/tutorials/1.6/events/ <- added a better reference In order for dojo.on to capture an event, the object, in this case the "map" would need to extend dojo/Evented and emit a custom event in the code somewhere by doing something like this.emit('onLayerAddResult', {layer:layerObject, error:errorMessage}) This still isn't 100% in the API yet. At the moment, esri.Map does extend dojo/Evented. You can test it by doing this. map.on('click', function(e) {console.log(e)}); It just doesn't emit all the custom events yet, but it works for DOM events.
... View more
03-11-2013
10:39 AM
|
0
|
0
|
3122
|
|
POST
|
Someone put one together here https://github.com/DavidSpriggs/ConfigurableViewerJSAPI And this one https://github.com/agrc/AGRCJavaScriptProjectBoilerPlate I've only browsed them, but they're pretty good starting points.
... View more
03-01-2013
03:07 PM
|
0
|
0
|
1359
|
|
POST
|
Ah crap, ignore everything I said. The regular URL works. My bad, the attachment link in the attachments endpoint works for this. Here is a gist https://gist.github.com/odoe/5059401 <!doctype html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>demo</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"> <link rel="stylesheet" href='http://serverapi.arcgisonline.com/jsapi/arcgis/3.3/js/esri/dijit/css/Popup.css'/> <style> html, body { height: 100%; width: 100%; margin: 0; padding: 0; } #map { position: absolute; top:0; bottom:0; left:0; right:0; } </style> </head> <body class="claro"> <div id="map"></div> </body> <script src="http://serverapi.arcgisonline.com/jsapi/arcgis/3.3/"></script> <script src="main.js"></script> </html> /* * Add attachment images through this sample: http://help.arcgis.com/en/webapi/javascript/arcgis/samples/ed_attachments/index.html * And use this demo to view them in a popup */ (function() { // dojo config stuff require({ parseOnLoad:true }); require([ 'dojo/dom-construct', 'dojo/_base/connect', 'esri/dijit/Popup', 'esri/layers/FeatureLayer', 'dojo/domReady!' ], function (domConstruct, connect) { var map, popup, featureLayer; popup = new esri.dijit.Popup(null, domConstruct.create('div')); map = new esri.Map('map', { basemap: 'streets', center: [-122.427, 37.769], zoom: 19, infoWindow: popup }); connect.connect(map, 'onLoad', function (_map_) { featureLayer = new esri.layers.FeatureLayer('http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/SanFrancisco/311Incidents/FeatureServer/0', { mode: esri.layers.FeatureLayer.MODE_ONDEMAND }); connect.connect(featureLayer, 'onClick', function (e) { var objectId, el; objectId = e.graphic.attributes[featureLayer.objectIdField]; featureLayer.queryAttachmentInfos(objectId, function (infos) { map.infoWindow.setTitle(objectId); el = document.createElement('img'); if (!!infos[0].url) { el.setAttribute('src', infos[0].url); map.infoWindow.setContent(el); map.infoWindow.show(e.screenPoint, map.getInfoWindowAnchor(e.screenPoint)); } }); }); map.addLayer(featureLayer); }); }); }).call(this); Tony is right about the queryAttachmentInfos being all your need. It's the same URL you would see in the attribute inspector. My head is somewhere else today.
... View more
02-28-2013
10:02 AM
|
0
|
0
|
4531
|
|
POST
|
I put a gist together to demonstrate this. https://gist.github.com/odoe/5059401 Based it roughly off this example, but only display attachment images if available. http://help.arcgis.com/en/webapi/javascript/arcgis/samples/ed_attachments/index.html My FTP is acting up, but I put a demo on my dropbox, let's see if this works. http://dl.dropbox.com/u/3193991/attimgdemo/index.html There should be an image attachment on that black dot in the middle of the screen.
... View more
02-28-2013
09:53 AM
|
0
|
0
|
4531
|
|
POST
|
Ignore this HTMLPopup nonsense, the attachment link will work for this.
... View more
02-28-2013
06:15 AM
|
0
|
0
|
4531
|
|
POST
|
I'm a little confused at these two lines.
m_mapPoint[0] = new esri.geometry.Point(4804172, 753352, new esri.SpatialReference({ wkid: 26712 }));
var geogPt = esri.geometry.webMercatorToGeographic(m_mapPoint[0]);
wkid 26712 is not a web mercator projection. Web Mercator wkid is 102100 (and 102113? the two still throw me off). esri.geometry.webMercatorToGeographic will convert it to 4326. You should be able to skip the above step and go straight to the geometry service project() method specifying what output spatial reference you are looking for once you create your m_mapPoint[0]. Granted I haven't had a need to project very often beyond geographc and web mercator, so take this with a grain of salt.
... View more
02-26-2013
05:03 AM
|
0
|
0
|
1301
|
|
POST
|
I think you're referring to the Support for Popular Browsers under this section http://help.arcgis.com/en/webapi/javascript/arcgis/jshelp/#overview_api So far, I have not run into any issues with IE10 on Win8. Not to say that some things may not work. I think that section should probably be updated unless the API team hasn't run through all their testing in IE10. But I don't think you should have any issues moving forward.
... View more
02-22-2013
07:19 AM
|
0
|
0
|
515
|
| Title | Kudos | Posted |
|---|---|---|
| 2 | 05-19-2026 02:12 PM | |
| 1 | 04-24-2026 11:01 AM | |
| 2 | 04-21-2026 07:06 AM | |
| 1 | 02-27-2026 06:31 AM | |
| 1 | 01-13-2026 02:15 PM |
| Online Status |
Offline
|
| Date Last Visited |
13 hours ago
|