-
-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding CSV Layer #169
Adding CSV Layer #169
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this! I think we need some new gissues to investigate properties and methods that are not implemented here, and on some other common layer types like GeoJSON
, but are in the ArcGIS spec. If you have time to write up some of those, feel free. An example of how I've done that is #117.
Request changes mostly just for the dedicated sample page.
Url = url; | ||
Title = title; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realize this is missing in a lot of classes, including most layers, but we should wrap these parameter setters in #pragma warning disable BL0005
. Search for that and you'll see some examples where I've implemented it. If you don't do this, and you create the class in C# with this constructor, you will get a warning about setting parameters outside of markup.
@@ -8,6 +8,7 @@ | |||
<button disabled="@(!_mapRendered)" @onclick="() => ToggleLayer(_graphicsLayer)">Graphics Layer</button> | |||
<button disabled="@(!_mapRendered)" @onclick="() => ToggleLayer(_geoJsonLayer)">GeoJSON Layer</button> | |||
<button disabled="@(!_mapRendered)" @onclick="() => ToggleLayer(_geoRssLayer)">GeoRSS Layer</button> | |||
<button disabled="@(!_mapRendered)" @onclick="() => ToggleLayer(_csvLayer)">CSV Layer</button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you create a full samples page for this new layer type? It helps with the discoverability, and this tests page is a mess that I don't publish to our samples.geoblazor.com
site.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
|
||
private async Task AddLayer() | ||
{ | ||
if (!string.IsNullOrEmpty(_csvLayerUrl)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we remove the original CSV layer when adding a new one? Did you try binding to the <CSVLayer Url="_csvLayerUrl">
value? I'm sure there could be issues with that, you might have to call mapView.Refresh()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't try it. I was trying to include multiple examples of adding a csv layer, so if you look at the source you can see how to do it declaratively and programmatically.
If(!(test-path -PathType container $path)) | ||
{ | ||
New-Item -ItemType Directory -Path $path | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this!
/// coordinate is the Y value, and the longitude coordinate is the X value. The X, Y coordinates must be stored | ||
/// in SpatialReference.WGS84 in csv feed. | ||
/// <a target="_blank" href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html"> | ||
/// ArcGIS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These line breaks cause issues with our docs generation, I believe. We might need to inline this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I think it was auto-formatted this way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like its formatted exactly like other layers in the project
Closes #65
Adding support for the CSV Layer
The sample pulls the sample CSV from the developer ArcGIS portal
It follows the GEOJson structure, so it sets the renderer and spatial reference in the interop js file