-
-
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
Release Merge #226
Merged
Release Merge #226
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
2c0b798
remove twitter and add link to Pro doc page in Samples
TimPurdum 3813bad
Added sample click to add a point
TimPurdum 2443f72
Fix for graphic.popupTemplate.dotNetPopupTemplateReference
TimPurdum aa3a2ad
refactor ifs to switch on layer type
TimPurdum 843c19d
update package version to beta
TimPurdum 89afabb
Merge pull request #223 from dymaptic/bug/222_popup_action_update
TimPurdum a14ce00
remove docCopy logic (moved to Pro earlier)
TimPurdum 258cd8d
Merge branch 'develop' of https://github.com/dymaptic/dy-blazor-api-c…
TimPurdum 09c6110
update to release version
TimPurdum b169c45
build update package-lock.json
TimPurdum File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
just poking in to say generally speaking, it's best not to use !important most of the time in CSS. Specifying the class and element like you did here should be enough to ensure no other rules in this file take priority. Is there maybe another reason !important is needed?
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.
@agnesstelmach you are absolutely correct, and it was a shortcut months ago that I used instead of taking the time to figure out why it didn't work without it. I will try to revisit soon, or feel free when you're working in GB to update!