DOC
|
Rebecca, Got it... I misinterpreted your suggestion. Thanks very much! Tom
... View more
02-18-2015
09:22 AM
|
0
|
0
|
13222
|
POST
|
Ryan, How about this: var parcelButton = new Button({
label: "More Details",
onClick: searchParcelDetail(resultFeatures.attributes.OBJECTID)
}, "button"+i).startup(); Regards, Tom
... View more
02-18-2015
09:16 AM
|
0
|
12
|
668
|
POST
|
Ryan, Thanks. I will have a look at it. Regards, Tom
... View more
02-18-2015
08:46 AM
|
0
|
13
|
668
|
POST
|
Ryan, It might be good to see the rest of your code to get some context. I am missing something, but without seeing the rest of the code, I am a bit lost. Regards, Tom
... View more
02-18-2015
08:05 AM
|
0
|
15
|
668
|
POST
|
Ryan, Have you added a reference to dojo/on? That may be what is breaking your loop. Regards, Tom
... View more
02-18-2015
07:53 AM
|
0
|
17
|
668
|
POST
|
Ryan, It is a scope issue. It is referencing a function outside the scope of button created. Create a unique id for each button in your loop and add an on event for it: details = details + "<tr><td><button id='button" + i + "'>More Details</button></td></tr>";
on(dom.byId("button"+i), "click", searchParcelDetail(resultFeatures.attributes.OBJECTID)); Regards, Tom
... View more
02-17-2015
05:34 PM
|
0
|
19
|
668
|
POST
|
Greetings Koliter, You could build a function similar to the one below. In this case I am reordering the drawing order of the graphics that have a textsymbol, so they will always draw on top of the other graphics. You could set/manage an drawing hierarchy that would suite you. function reorderGraphics() {
// text for measurements needs to be on type all others
var graArray = [];
// make 2 pass through the graphics in the measure array move text to the top.
// second pass adds text graphics
for (var i = 0; i < drawLayer.graphics.length; i++) {
var gra = drawLayer.graphics;
if (gra.symbol.type == 'textsymbol') {
graArray.push(gra);
}
}
// first pass adds non text graphics
for (var i = 0; i < drawLayer.graphics.length; i++) {
var gra = drawLayer.graphics;
if (gra.symbol.type != 'textsymbol') {
graArray.push(gra);
}
}
drawLayer.graphics = graArray;
drawLayer.redraw();
} I hope this will work for you. Regards, Tom
... View more
02-17-2015
04:51 PM
|
1
|
1
|
928
|
POST
|
Stan, Excellent! I had created a similar widget for the FlexViewer and had meant to create something similar for WAB, but had some other projects in my way until now. I hope this works well for you. Best Regards, Tom
... View more
02-17-2015
04:02 PM
|
1
|
0
|
879
|
POST
|
I found a minor bug in the draw widget. When measuring a polygon, extent, triangle, the function performing the perimeter calculation was dropping the last point from the polygon ring. This was creating an incomplete measurement of every polygon drawn. The offending line in the _addPolygonMeasure function: points = points.slice(0, points.length - 1); I commented out this line and in calculates the perimeter correctly. I am posting this in hopes that it will fixed in core project. Regards, Tom
... View more
02-17-2015
03:59 PM
|
0
|
2
|
4283
|
DOC
|
Rebecca, I was somewhat following Robert's example. WAB is 1.1, so I am using 1.1 for my prefix to follow WAB. The remainder is for my version, in this case 0.1. Best Regards, Tom
... View more
02-17-2015
03:55 PM
|
0
|
0
|
13222
|
DOC
|
Thank you Robert! That is what I had found too. Just getting my feet wet in this endeavor.
... View more
02-17-2015
03:43 PM
|
0
|
0
|
13222
|
DOC
|
Rebecca, I am actually following the version number that was used in the manifest.json for the draw widget which is 1.1. and adding my minor version number to it. Sorry if it is confusing. Best Regards, Tom
... View more
02-17-2015
03:39 PM
|
0
|
0
|
13222
|
DOC
|
Found it! It appears that a function was using a slice to put the points from the polygon ring into a polyline that can be measured. This was deleting the last leg of the perimeter and creating an incomplete measurement. I commented out the offending line and it appears to be calculating the perimeter measurement correctly now. I will post the updated widget.
... View more
02-17-2015
03:26 PM
|
0
|
0
|
13222
|
DOC
|
I am investigating a calculation problem on the completion of drawing extents and triangles. It appears that it is missing the last segment in the calculation. This is also showing up in the draw tool too. Regards, Tom
... View more
02-17-2015
01:10 PM
|
0
|
0
|
13222
|
DOC
|
Latest update: 02/11/2020 - fixed a change in the API that altered the way points were counted in path polylines and ring polygons. Thanks Robert Scheitlin! - also updated css to fix issue with trash can icon. Thank you Robert! - updated the editing as the event handlers had also changed in the API. TODO: found esri bug on edit toolbar that creates a ghost vertex as the last vertex. This creates issues when editing a polyline or polygon.05/04/2017 - added functionality to display an interactive polyline total when drawing two or more segments. 03/30/2017 - tested with WAB 2.4. Fixed bug with editing measures. 08/19/2016 - added logic to calculate bearing for each segment for polyline and polygon geometries. Minor bug fixes and tested with WAB 2.1. 02/16/2016 - updated logic to use the abbreviation on measurement labels. 02/12/2016 - added checkbox to display summary measurement labels. Fixed problem that was leaving a 0.0 measurement when finishing a line. 12/16/2015 - verified widget to work with WAB 1.3 and added nautical miles to the dropdown list for distances 10/13/2015 - added help page and editing for some geometry types (line, polyline and polygon) 09/30/2015 - updated to remove unnecessary logic for IE - NIM094815: The mouse-drag event now works correctly using IE10 and IE11. 09/29/2015 - updated the widget to use better calculations for area and length, especially for basemaps using a projected coordinate system 09/09/2015 - upgrade to new release of WAB 1.2 fixed problem with CSS that was corrupting apps at 1.2 04/06/2015 - upgrade to new release of WAB 1.1 use new JSAPI scaleUtils to get map units added logic for Internet Explorer to measure all geometry types updated offset for mobile on certain geometry types 03/04/2015 - stacked area measurements added logic for calculating map units added ability to change measure text size and color 02/24/2015 - added logic for using on iPad, iPhone and Android devices added logic for stopping popups 02/18/2015 - removed the last measure from the freehand polygon tool 02/17/2015 - fix problem with perimeter measurement 02/17/2015 - Initial release created from the draw widget. Demo of Measure Widget The example above will demonstrate the measure widget. A feature layer has been added to the map so you can also see how snapping works. You can hold the CTRL key when measuring a feature and it will snap to the closest nodes. Logic has been added to allow the widget to be used on mobile devices. It has been tested on an iPad and iPhone. An Android device was not available for testing. Polygon and polyline measures just use tap locations to provide segment measurements. All other measures are more interactive on mobile devices. The measure widget for WAB is my first attempt at converting the widget I had creating for the FlexViewer into the WAB context. It gives interactive measures for segments and drawn elements as they are being drawn. This widget is derived from the draw widget. This was very useful for the folks in our planning department, which is what made me create the widget originally. There are new measures for some of the other draw types. I am not sure that all of them will be as useful as the measures for the polygon and polyline measures. The widget now allows editing for some geometry times. Lines, polylines and polygons are now editable. You can click on a drawn measure graphic and put it in edit mode. Drag the vertex points to new locations and the widget will interactively update the measurements. You can also change the color, fill color, line type, text color and text size of a graphic in edit mode. Note: Does not work on IE or iOS. The edit function turns off mouse events on IE and iOS, so there is no way to track the measurement. Regards, Tom
... View more
02-17-2015
11:42 AM
|
23
|
310
|
62387
|
Title | Kudos | Posted |
---|---|---|
1 | 05-19-2023 08:13 AM | |
1 | 02-22-2023 09:12 AM | |
1 | 02-10-2015 11:19 AM | |
1 | 01-06-2017 08:44 AM | |
1 | 02-10-2015 11:52 AM |
Online Status |
Offline
|
Date Last Visited |
02-26-2024
04:50 PM
|