-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #226 from dymaptic/develop
Release Merge
- Loading branch information
Showing
14 changed files
with
245 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
samples/dymaptic.GeoBlazor.Core.Sample.Shared/Pages/ClickToAdd.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
@page "/click-to-add" | ||
<PageTitle>Click to Add Points</PageTitle> | ||
<h1>Click To Add Points</h1> | ||
<div class="links-div"> | ||
<a class="btn btn-primary" target="_blank" href="https://www.arcgis.com/home/item.html?id=1e126e7520f9466c9ca28b8f28b5e500">World Ocean Basemap</a> | ||
</div> | ||
|
||
<p class="instructions"> | ||
Click anywhere to see a point added to the map. Click on the point again to see a popup. Click on the popup action to add the point to the list below. | ||
</p> | ||
|
||
<MapView Class="map-view" OnClick="OnClick" Zoom="4"> | ||
<Map> | ||
<Basemap> | ||
<TileLayer> | ||
<PortalItem Id="1e126e7520f9466c9ca28b8f28b5e500" /> | ||
</TileLayer> | ||
</Basemap> | ||
<GraphicsLayer @ref="_graphicsLayer" /> | ||
</Map> | ||
</MapView> | ||
|
||
<div> | ||
<h2>Points Clicked</h2> | ||
@foreach (Point point in _points) | ||
{ | ||
<p>Long: @point.Longitude!.Value.ToString("N2") Lat: @point.Latitude!.Value.ToString("N2")</p> | ||
} | ||
</div> | ||
|
||
@code { | ||
private async Task OnClick(ClickEvent arg) | ||
{ | ||
Point point = arg.MapPoint; | ||
if (_graphic is null) | ||
{ | ||
_graphic = new Graphic(point); | ||
await _graphicsLayer!.Add(_graphic); | ||
} | ||
|
||
SimpleMarkerSymbol symbol = new SimpleMarkerSymbol(new Outline(new MapColor("blue")), | ||
new MapColor("yellow"), 10); | ||
|
||
ActionButton actionButton = new ActionButton("Click to Add to List", | ||
"./_content/dymaptic.GeoBlazor.Core.Sample.Shared/images/dymaptic_logo.png", "test-1", AddPoint); | ||
PopupTemplate popupTemplate = new PopupTemplate( | ||
$"New Point at Long: {point.Longitude!.Value:N2} Lat: {point.Latitude!.Value:N2}", | ||
actions: new[]{ actionButton }); | ||
|
||
await _graphic.SetPopupTemplate(popupTemplate); | ||
await _graphic.SetSymbol(symbol); | ||
await _graphic.SetGeometry(point); | ||
} | ||
|
||
private async Task AddPoint() | ||
{ | ||
_points.Add(((Point)_graphic!.Geometry!).Clone()); | ||
await InvokeAsync(StateHasChanged); | ||
} | ||
|
||
private Graphic? _graphic; | ||
private GraphicsLayer? _graphicsLayer; | ||
private readonly List<Point> _points = new(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.