|
POST
|
I didn't realize you were using dojo's checkbox dijit. There are a couple of things you could try. First, check to see if your line of code in your original post is inside of a dojo/domReady. Is it possible that you are referencing an object that does not exist yet? Keep in mind that some things (not necessarily this one) occur asynchronously. If you reference a dom element by id that hasn't rendered completely, there is no dom element to reference. You could add an onChange event to your checkbox. This documentation is pretty terrible but, https://dojotoolkit.org/reference-guide/1.10/dijit/form/CheckBox.html# I would sooner use straight up javascript (or jQuery) create checkbox before using a dojo dijit for a dom element like that... especially after I played with the example on dojotoolkit.org for a little bit.
... View more
02-18-2016
09:11 AM
|
1
|
1
|
2291
|
|
POST
|
You could try to use dev tools (F12) and make sure that your ID is correct once your stuff is running.
... View more
02-18-2016
04:06 AM
|
1
|
0
|
9636
|
|
POST
|
Is there a dynamic service to calculate magnetic bearing in either the 3.x or 4.x JS API?
... View more
02-11-2016
08:57 AM
|
0
|
0
|
1746
|
|
POST
|
Before 4.x, the graphicLayerIds collection will appear on top of the layerIds collection. If you find a way to have a graphicLayer show up, on the map, behind another layer type, let me know.
... View more
02-04-2016
02:10 PM
|
0
|
0
|
579
|
|
POST
|
I was partially wrong in my explanation. FeatureLayers are graphic layers, aren't they? Or, they at least show up as graphicLayerIds? These can be reordered with graphicLayerIds from a draw tool (assuming you put them in a layer). The problem is that you cannot hide a graphic layer under another layer type. You can reorder all day long to max-1 but the graphic layers will always be on top. That's the problem.
... View more
02-04-2016
12:11 PM
|
0
|
2
|
992
|
|
POST
|
Please correct me if I'm wrong: Assume gLayer is a graphic layer and flayer is a feature layer. If I call map.reorderLayer(gLayer, 0), I will only be reordering the map.graphicLayerIds collection where 0 is the going to appear under any other graphic layer. If I call map.reorderLayer(fLayer, 1), I will be reordering all other layers where 1 will be just on top of the basemap but appear under all other layers. Right? Is there a way to reorder all layers at once? It appears that graphic layers will always appear on top of other layers. Is there a way to send a specific layer all the way to the front (appear on top of everything)? If 0 is the basemap, and 1 is the first layer added... how can I reorder a layer to be set to the front if don't know how many total layers there are? I know how many graphic layers, and I know how many other layers there are. Ideally, if I have 5 layers on the map (including the basemap), I would want to call map.reorderLayer(fLayer, 4). I haven't found a good way to manage the appearance order of all graphics. Must I order graphic layers and all other layers separately? Thoughts? Thanks!
... View more
01-29-2016
12:12 PM
|
0
|
4
|
3026
|
|
POST
|
Solved: If someone comes across this issue, make sure the values that come back from any conversions, mercators, etc spit out parseFloat values. My rings[0] had string values in it. That threw everything off. I figured I'd embarrassingly leave this here in case someone else has my same struggles. We also figured out why the map.graphics.graphics collection is so high. Each little icon for the edit toolbar is a shape. Those graphics are NaN b/c the rings with strings in it has a domino affect.
... View more
01-20-2016
12:31 PM
|
1
|
0
|
1083
|
|
POST
|
I haven't had a chance to test this out, yet. Do the graphics re-order on the map with this method, or are there further steps? In other words, if the graphics are all on top of each other with 100 opacity, does this bring a graphic to the top?
... View more
01-20-2016
09:53 AM
|
0
|
0
|
958
|
|
POST
|
Not a legitimate scenario, but even the default draw tool example allows you to. http://developers.arcgis.com/javascript/samples/toolbar_draw/ As a work around, on draw complete, if the graphic isn't an actual polygon, I cancel the draw and do not add the graphic.
... View more
01-19-2016
01:00 PM
|
0
|
0
|
349
|
|
POST
|
This only occurs on IE9 and we stopped caring about IE9 now. Thanks, though.
... View more
01-19-2016
12:52 PM
|
0
|
0
|
1484
|
|
POST
|
Is there a magic trick for graphics? Or is remove/add graphics the way to go still. Thanks for the pointer to reorderLayer. That worked great.
... View more
01-19-2016
12:28 PM
|
0
|
2
|
958
|
|
POST
|
I have a custom draw tool. The user can draw selected graphics on the map and edit them with the edit toolbar, or via a control panel with the graphic coordinates listed for edit. For instance, the user can draw a polygon with 4 sides on the map and select to edit that graphic. The edit toolbar becomes activated, and a list textboxes showing 4 coordinates are displayed. The user can move vertices or the graphic itself, and add points. If the edit toolbar is used to edit the shape, the coordinate list is updated. And, of course, if the coordinate list is updated, the graphic is also updated. What I do is create a new Esri Polygon object with the updated set of coordinates for the graphic and call setGeometry, passing the new Polygon. If the user updates one of the coordinates via textbox, then moves the graphic with the toolbar, the graphic disappears. The points remain visible only through the edit toolbar remaining active. The coordinate that was modified is now NaN so the polygon is not completed. In developer tools, a lot of interesting stuff happens that I don't understand. I set a breakpoint in the 'graphic-move-start' event and in the 'graphic-move-stop' event. Here is what I found... 1. Most importantly, the polygon's rings[0] for that graphic have coordinates appended at the end. Example below: The user modified the 2nd point. On graphic-move-start: map.getLayer('GraphicCollection').graphics[0].geometry.rings[0][1] 0 "-2010708.3024555703" 1 "6613938.375964609" On graphic-move-stop: map.getLayer('GraphicCollection').graphics[0].geometry.rings[0][1] 0 "-2010708.3024555703704443.6526759975" 1 "6613938.375964609332653.94709699973" (Note the double decimal. A new coordinate is appended at the end. And, if the coordinate was moved to the right place, it would also have the '-', like in "6613938.375964-609332653.94709699973" 2. I get the error from the subject line: SVG4601: SVG Path data has incorrect format and could not be completely parsed. Why? 3. I added one graphic with 4 sides to an otherwise empty blank basemap. Why would the map.graphics.graphics count be 12? I do have code that highlights each editable point, but I can't account for 12 graphics. Why are there 12? 4. Of the 12 graphics listed, after graphic-move-stop, a lot of them are points that have an x and y of NaN. Why? Note: No other code runs between graphic-move-start and graphic-move-stop events. In fact, I can remove the events completely and the bug remains. I just wanted to point out that the graphic rings are as expected after the graphic-move-start and become screwed up by the time graphic-move-stop would fire. My thought is that map.graphics.graphics collection does not get updated properly when I setGeometry of my map.getLayer('name').graphics. Are they out of sync to where I see the results that I see? Thanks! p.s. This is for 3.14 EDIT: I noticed that if I use the edit toolbar to move a vertice or change the scale of the graphic before I move the graphic, the above bug doesn't occur. I can move the graphic with the edit toolbar, with no problems unless I change the coordinates via textbox first. So the work around steps are, draw a graphic, edit a graphic with textboxes, change the scale, then I can move the graphic. Of course, this isn't helpful for my code, but thought it might be helpful in debugging?
... View more
01-19-2016
09:02 AM
|
0
|
1
|
4850
|
|
POST
|
Would it also be best to wait on 4.0 for re-ordering the layers themselves? If I add LayerA and LayerB (in that order), LayerB will display on top of LayerA. If I want LayerA shown on top, in 3.x, is that also a remove then re-add as mentioned above for graphics?
... View more
01-19-2016
07:23 AM
|
0
|
6
|
3193
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 12-31-2015 06:07 AM | |
| 1 | 09-25-2015 08:35 AM | |
| 1 | 12-07-2015 04:32 AM | |
| 1 | 11-06-2015 07:47 AM | |
| 1 | 03-28-2016 04:19 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:24 AM
|