|
POST
|
Jake, I created a widget that was a derivation of the draw widget. It is for Web App Builder though. You can view it at: Measure Widget 1.1.1 for Web App Builder Regards, Tom
... View more
05-05-2015
11:37 AM
|
2
|
0
|
1333
|
|
POST
|
Sundus, I put together a quick jsfiddle for you to be able to see the complete javascript. You can view it at: Edit fiddle - JSFiddle Regards, Tom
... View more
05-05-2015
11:31 AM
|
1
|
5
|
2984
|
|
POST
|
Sundus, Of course you can just use a circle and no buffer needed to query as well. It would go something like this: map.on("click", executeQueries);
function executeQueries(e) {
var parcels, qGeom, point;
point = e.mapPoint;
var qGeom = new Circle(point,{
"radius": 100,
"spatialReference":point.spatialReference
});
// use the circle for the query geometry
qParcels.geometry = qGeom;
parcels = qtParcels.execute(qParcels, handleQueryResults);
} I am using a circle for the query geometry instead of an extent. You can change the radius to whatever you would appropriate for your query. Regards, Tom
... View more
05-05-2015
08:58 AM
|
0
|
0
|
2984
|
|
POST
|
Larry, Tested on my Windows 7 PC on: Chrome 42.0.2311.135 m - hasMouse: true, hasTouch: undefined Chrome mobile iPad emulator: hasMouse: undefined, hasTouch: true Internet Explorer 11: hasMouse: true, hasTouch: undefined FireFox 36.0.4: hasMouse:true, hasTouch: undefined Tested on my iPad: Safari: hasMouse: undefined, hasTouch:true Chrome: hasMouse: undefined, hasTouch:true Very nice! Regards, Tom
... View more
05-04-2015
03:06 PM
|
1
|
0
|
1109
|
|
POST
|
Yohan, There is also a method in the geometry engine to do offsets. Here is a link to reference in the API: esri/geometry/geometryEngine | API Reference | ArcGIS API for JavaScript Regards, Tom
... View more
05-04-2015
11:50 AM
|
2
|
1
|
3482
|
|
POST
|
Greetings Sundus, Here is a sample script from ESRI's page that queries using geometry. In this sample, it uses and extent, but you could easily reference the new geometry engine to create a buffer too. https://developers.arcgis.com/javascript/jssamples/query_deferred_list.html The specific bit of code that queries by geometry is: app.map.on("click", executeQueries);
function executeQueries(e) {
var parcels, buildings, promises,
qGeom, point, pxWidth, padding;
// create an extent from the mapPoint that was clicked
// this is used to return features within 3 pixels of the click point
point = e.mapPoint;
pxWidth = app.map.extent.getWidth() / app.map.width;
padding = 3 * pxWidth;
qGeom = new Extent({
"xmin": point.x - padding,
"ymin": point.y - padding,
"xmax": point.x + padding,
"ymax": point.y + padding,
"spatialReference": point.spatialReference
});
// use the extent for the query geometry
app.qParcels.geometry = app.qBuildings.geometry = qGeom;
parcels = app.qtParcels.execute(app.qParcels);
buildings = app.qtBuildings.execute(app.qBuildings);
console.log("deferreds: ", parcels, buildings);
promises = all([parcels, buildings]);
promises.then(handleQueryResults);
console.log("created d list");
} Here is a reference to the buffer geometry engine code. esri/geometry/geometryEngine | API Reference | ArcGIS API for JavaScript Regards, Tom
... View more
05-04-2015
08:09 AM
|
2
|
8
|
2984
|
|
POST
|
Mark, Is the application published so we can view it and maybe figure out what is going on? or URL for rest service or web map? Regards, Tom
... View more
05-01-2015
02:39 PM
|
1
|
0
|
2693
|
|
POST
|
Mark, Any chance that you are using a widget that displays your services directly and not from your web map? Regards, Tom
... View more
05-01-2015
01:09 PM
|
0
|
2
|
2693
|
|
POST
|
Mark, Have you tried flushing your browser cache? Regards, Tom
... View more
05-01-2015
11:58 AM
|
0
|
4
|
2694
|
|
POST
|
Francis, There might be a finite limit though the documentation doesn't show a limit. 10km does sound quite a long distance. You may have more luck using a "near" method. Regards, Tom
... View more
05-01-2015
11:23 AM
|
0
|
0
|
1466
|
|
POST
|
Francis, Yes, you can specify a distance parameter to the service. If you don't specify a distance, it defaults to 100 meters. Here is a link that might help: ArcGIS REST API Regards, Tom
... View more
05-01-2015
10:36 AM
|
0
|
2
|
1466
|
|
DOC
|
Subu, Yes, it has been resolved. Please let me know if you are seeing any problems. Regards, Tom
... View more
05-01-2015
09:04 AM
|
0
|
0
|
15800
|
|
POST
|
Brandon, Excellent! Glad you got it working and thanks for posting the result. Regards, Tom
... View more
05-01-2015
08:02 AM
|
0
|
2
|
5764
|
|
POST
|
Hamish, Your image of the JSON didn't come through. You should be able to get the information from the route task results. Using the route task sample at: Simple Routing I set a breakpoint when results are displayed and drilled in to the results as shown in this image: You should then be able to get the total travel time and distance from the results something like this: totDist = evt.result.routeResults[0].route.attributes.Total_Miles;
totTravelTime = evt.result.routeResults[0].route.attributes.Total_TravelTime; You can then use these values to update the <div>. Be aware that routeTask results can vary depending on the parameters and the service being used. Regards, Tom
... View more
04-30-2015
08:21 AM
|
2
|
3
|
1818
|
|
POST
|
Betsy, Excellent! Glad you found it. Could you please post the result as someone else may be researching the same problem and would benefit by your answer? Thanks very much! Regards, Tom
... View more
04-29-2015
10:30 AM
|
0
|
1
|
2877
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-24-2023 10:45 AM | |
| 1 | 05-19-2023 08:13 AM | |
| 1 | 02-22-2023 09:12 AM | |
| 1 | 05-15-2015 03:11 PM | |
| 1 | 02-10-2015 11:52 AM |
| Online Status |
Offline
|
| Date Last Visited |
02-26-2024
04:50 PM
|