POST
|
I am using the fieldInfos to set the content in a popup. At 4.3, I could put html in the label property to take advantage of the title attribute that would show a description of the field when the user hovered. At 4.4, the html is not converted to text. fieldInfos: [{
fieldName: "SufficiencyRating",
visible: true,
label: "<span title='An indication of the bridge’s capacity to remain in service (0 -100)'>Sufficiency Rating</span>"
}] at 4.3: (not sure why the screen shot has transparency on the tooltip, please ignore) at 4.4: Here are a couple JSBins to show the problem: 4.3: JS Bin - Collaborative JavaScript Debugging 4.4: JS Bin - Collaborative JavaScript Debugging Is this a bug? Is there another way to accomplish this?
... View more
07-26-2017
07:32 AM
|
0
|
1
|
642
|
POST
|
I'm making a bar chart that graphs car accidents by the day of the week the accident occurred. The problem is that the bar chart automatically sorts alphabetically by category. I want to have the days of the week in order ( mon, tue, wed, thurs etc.) not alphabetically (fri, mon, sat, sun, thurs, tues, wed). Is there a way to do this? Note I tried using a numeric field which worked to get the days in the correct order, but then the axis labels were 0, 1, 2 etc. which is not what I'm after (See below). I couldn't find anyway to alter the labels. I tried using a coded value domain, ( 0 = Monday, 1 = Tuesday etc.) but the chart resorted back to alphabetical order. I also tried using a date field where I coerced all the dates into one week but the labels were again not satisfactory (1/5/2015 for Monday) and I couldn't find a way to format the date labels to show day of week.
... View more
07-20-2017
06:23 AM
|
0
|
9
|
2511
|
POST
|
Mihkel, I imagine its almost the same pattern. In the solution, the response from the request actually contains multiple layers and I only added the first (response.layers[0]). I would start by going to the the feature service layer url, adding '/data' to the end of it and see what the response is. My guess is that it will contain what you need to create the feature layer in your app.
... View more
07-03-2017
04:46 AM
|
0
|
0
|
1341
|
POST
|
Thanks for your reply Alycia. For #4, let's say I use the selection tool to make a selection on the map. Then I want to see just the selected records in the attribute table. So I click on the icon on the bottom left of the attribute table that shows only the selected records. The first click focuses the attribute table pane and removes focus from the map pane. Then I have to click again to see the selected records. Its perhaps not a big deal, just slightly annoying and I think I only mentioned it out of frustration. I'm using version 1.4 now. I haven't considered a ticket because this seemed more like a user interface design choice and not a bug. I'm looking forward to 2.0!
... View more
06-01-2017
05:07 AM
|
0
|
0
|
860
|
POST
|
I ran across a need to do this and wrote a script. It only transfers the shape field but could be edited to transfer whatever attributes you want. Set the interval variable to however long you want the output lines to be. Note that there will be a fraction at the end of each line that is less than the interval distance. ## splitLinesAtIntervals.py
## inputs ##
interval = 50 ## units of inFC projection
inFC = r'path\to\inFeatureClass'
outFC = r'path\to\outFeatureClass'
## get to work
import arcpy
arcpy.env.overwriteOutput = True
iCur = arcpy.da.InsertCursor(outFC, ['SHAPE@'])
with arcpy.da.SearchCursor(inFC, ['SHAPE@']) as sCur:
for row in sCur:
lineLength = row[0].length
position = 0
lineGeometry = row[0]
## while length left??
while lineLength > position:
## position point along line at interval
splitPoint = lineGeometry.positionAlongLine(interval)
## split line at point
arcpy.SplitLineAtPoint_management(lineGeometry, splitPoint, 'in_memory/split')
## insert the split line into outFC
with arcpy.da.SearchCursor('in_memory/split', ['OID@', 'SHAPE@']) as splitCur:
for i in splitCur:
if i[0] == 1:
## insert row
iCur.insertRow([i[1]])
else:
lineGeometry = i[1]
position += interval
del iCur
... View more
05-24-2017
09:43 AM
|
0
|
0
|
561
|
POST
|
The attribute table constantly wants to scroll all the way left or change positions. If I select a record, the table scrolls back to the left. If I calculate a field, back to the left. If I manually enter a value, it doesn't scroll left but changes position. This is extremely annoying when working with a table with many columns. No way to subset or highlight a selection. If I want to reorder the fields, I can only move the field a few columns, then I have to scroll the table, then move the field and repeat as many times as needed. When the map pane is focused, I have to click twice to see only the selected records in the table When selecting by attributes, the table often shows wacky results like 184 of 100 selected. Or 24 of 24 selected when the feature class contains several thousand records. This list is WAY TOO long for a product that has been out for years now. Get it together ESRI. I don't need 3D or integrated mesh blah blah blah; I need basic, core functionality to work.
... View more
05-12-2017
09:00 AM
|
3
|
7
|
1306
|
POST
|
The answer is to turn map topology off. Why is map topology on be default? No idea.
... View more
05-12-2017
07:38 AM
|
1
|
0
|
358
|
POST
|
I have a point feature class. Some points are coincident with others. I want to move one point. I select only the one point, move the point, but then all of the other coincident points move too. I just want to move the one point. How do I do this?
... View more
05-12-2017
07:35 AM
|
0
|
1
|
664
|
POST
|
Thanks for your reply Ken. The docs referenced in that discussion appear to be from the 3.20 version. I can't find any documentation in the 4.3 docs that say you can't do this. However, I believe you are correct. It's likely just the docs that need updating, or maybe I'm looking in the wrong place. For now I'll loop through my graphics array manually. Seems like the API should handle this for me with a definitionExpression ...
... View more
05-04-2017
06:48 AM
|
0
|
3
|
699
|
POST
|
I'm trying to filter features on a feature layer that is created from client side graphics. When I set the definitionExpression, the layer does not update. To replicate, use this sample, then add document.getElementById('filter').addEventListener('change', function(e){
if (e.target.checked){
lyr.definitionExpression = "mag < 2";
} else {
lyr.definitionExpression = "";
}
console.log(lyr.definitionExpression);
}); immediately below the errback function and <div style="position:absolute; top: 15px; right: 15px; color: #fff;"><label><input type="checkbox" id="filter" > Filter</label></div> in the body of the html. When you click the checkbox, the definitionExpression is updated, but the view is not. From the docs: If the definition expression is set after the layer has been added to the map, the view will automatically refresh itself to display the features that satisfy the new definition expression. Can anyone confirm if this is a bug or if I'm making some other mistake? Note that in my test application I was able to get this to work when the feature layer was constructed using a url instead of client side data.
... View more
05-04-2017
05:26 AM
|
0
|
5
|
1578
|
POST
|
Thanks for your reply Robert. I was hoping to use some CSS to add some animation and transition effects but your method is likely the best and easiest option for now.
... View more
05-01-2017
08:03 AM
|
0
|
0
|
468
|
POST
|
I'm looking for a way to change the style of certain graphics based on user interaction. I have a bar chart in my application and when the user hovers over, for example, the 2015 bar, I want to highlight all the points on the map that occurred in 2015. I thought the best way to do this would be to add a data-year attribute to the graphic's dom node and use some CSS similar to Styling SVG with CSS | Guide | ArcGIS API for JavaScript 3.20. But I see in Functionality matrix | ArcGIS API for JavaScript 4.3 that the dataAttributes method is "Not planned". Is there a way to do this at 4.x? Classes and CSS styling is used at 4.3 here: https://github.com/nickcam/FlareClusterLayer so it seems like it should be possible.
... View more
05-01-2017
07:39 AM
|
0
|
2
|
838
|
POST
|
Thanks for your reply FC Basson. You code works, the trouble for me was figuring out all the events to wait for to make sure the layers were loaded and attribution set. The Mapbox layer is used as a basemap in my application and I have a basemap toggle which changes the attribution text when you toggle between basemaps. Here's my hackish solution: when the mapView is ready watch the attribution text if the attribution text equals the Mapbox copyright text try to update the text to make it html, but this doesn't work try to update it every 2 milliseconds if update successful, clear interval mapView.watch('ready', function(){
var attribution = mapView.ui._components[0];
attribution.widget.viewModel.watch('attributionText', function(evt){
if (evt == '<a href="http://mapbox.com/about/maps" class="mapbox-wordmark" target="_blank">Mapbox</a>© <a href="http://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors, © <a href="https://www.mapbox.com/map-feedback/" target="_blank"><strong>Improve this map</strong></a>'){
document.getElementsByClassName('esri-attribution__sources')[0].innerHTML = evt; // never works, don't know why
updateAttr = setInterval(function(){
document.getElementsByClassName('esri-attribution__sources')[0].innerHTML = evt;
if (document.getElementsByClassName('esri-attribution__sources')[0].innerText == "Mapbox© OpenStreetMap contributors, © Improve this map"){
clearInterval(updateAttr);
}
}, 2);
}
});
}); Of course this would need to be edited if any operational layers had attribution or copyright text. Not a satisfying solution. This was so easy at 3.x!! Sure there is a better way.
... View more
04-25-2017
06:44 AM
|
0
|
0
|
4090
|
POST
|
Looks like this is still 'coming soon' as of April 2017, but as a work around you can place a div over top of the mapView div to 'catch' mouse/touch events. This will only work if the map is completely for display and the user will not need to click for an popup, etc. Here's some help to implement: html - Displaying one div on top of another - Stack Overflow
... View more
04-24-2017
11:35 AM
|
0
|
0
|
721
|
POST
|
I'm attempting to use a 3rd party (Mapbox) basemap in 4.3 JavaScript API. I need to include copyright and links in the map attribution as per Mapbox's policy. I've included the html as a string in the layers copyright property, but the string is not 'translated' into html and instead shows the html as text. var basemap = new WebTileLayer({
urlTemplate: "...",
copyright: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, © <a href="https://www.mapbox.com/map-feedback/">Mapbox</a>'
});
map.add(basemap); Output: The behavior can also be seen in this sample (click the attribution to see the Stamen copyright shown as text): ArcGIS API for JavaScript Sandbox This was valid in the 3.x API, how do I do this at 4.x?
... View more
04-24-2017
09:12 AM
|
0
|
3
|
5333
|
Title | Kudos | Posted |
---|---|---|
1 | 05-12-2017 07:38 AM | |
1 | 04-10-2017 07:57 AM | |
1 | 05-27-2015 05:50 AM | |
1 | 02-15-2018 09:17 AM | |
1 | 03-27-2019 12:06 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|