Skip to content

Commit

Permalink
Merge pull request #314 from dymaptic/develop
Browse files Browse the repository at this point in the history
Release v3.0.0
  • Loading branch information
TimPurdum authored Mar 23, 2024
2 parents b4a9009 + 1b8985a commit df6e543
Show file tree
Hide file tree
Showing 136 changed files with 9,992 additions and 1,733 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<PropertyGroup>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<CoreVersion>2.5.3.2</CoreVersion>
<CoreVersion>3.0.0</CoreVersion>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<CustomOverlay @ref="Overlay" Position="OverlayPosition.BottomLeft">
<div id="sr-div" class="esri-widget">view.spatialReference.wkid = <b>@_spatialReference.Wkid</b></div>
</CustomOverlay>
<ExpandWidget Position="OverlayPosition.TopRight" ExpandIconClass="esri-icon-basemap">
<ExpandWidget Position="OverlayPosition.TopRight" ExpandIcon="esri-icon-basemap">
<BasemapGalleryWidget>
<PortalBasemapsSource
QueryParams="@(new Dictionary<string, string> { { "id", "bdb9d65e0b5c480c8dcc6916e7f4e099" } })" />
Expand Down
73 changes: 46 additions & 27 deletions samples/dymaptic.GeoBlazor.Core.Sample.Shared/Pages/Basemaps.razor
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,21 @@
<div class="flex-column">
<div class="toggle-row">
<label class="radio-container">
From Static Default
From Style
<input type="radio" checked
name="basemap-type" @onclick="@(() => SetBasemap(0))" />
<div class="radio-box" />
</label>
<a class="btn btn-primary" target="_blank" href="https://www.arcgis.com/home/item.html?id=67372ff42cd145319639a99152b15bc3">Topographic BaseMap</a>
@if (_basemapType == 0)
{
<select @onchange="SelectStyleMapChanged">
@foreach (BasemapStyleName style in Enum.GetValues(typeof(BasemapStyleName)))
{
<option value="@style">@style</option>
}
</select>
}
<a class="btn btn-primary" target="_blank" href="https://developers.arcgis.com/javascript/latest/api-reference/esri-support-BasemapStyle.html">Basemap Style Service</a>
</div>
<div class="toggle-row">
<label class="radio-container">
Expand All @@ -23,23 +32,23 @@
name="basemap-type" @onclick="@(() => SetBasemap(1))" />
<div class="radio-box" />
</label>
<a class="btn btn-primary" target="_blank" href="https://www.arcgis.com/home/group.html?id=702026e41f6641fb85da88efe79dc166&view=list#content">ArcGIS Online BaseMaps</a>
@if (_basemapType == 1)
{
<select @onchange="SelectPortalMapChanged">
<option value="55ebf90799fa4a3fa57562700a68c405">Default-Street</option>
<option value="da10cf4ba254469caf8016cd66369157">Satellite</option>
<option value="86265e5a4bbb4187a59719cf134e0018">Hybrid</option>
<option value="f33a34de3a294590ab48f246e99958c9">National Geographic</option>
<option value="67372ff42cd145319639a99152b15bc3">Topographic</option>
<option value="979c6cc89af9449cbeb5342a439c6a76">Gray</option>
<option value="1a386c5dfd864bfda3f03ab428e57640">Dark Gray</option>
<option value="fae788aa91e54244b161b59725dcbb2a">Open Street Map</option>
<option value="9053b6cd38d54e65bb0967f355a232df">Streets Night</option>
<option value="c50de463235e4161b206d000587af18b">Streets Navigation</option>
</select>
}
<a class="btn btn-primary" target="_blank" href="https://www.arcgis.com/home/group.html?id=702026e41f6641fb85da88efe79dc166&view=list#content">ArcGIS Online Basemaps</a>
</div>
@if (_basemapType == 1)
{
<select @onchange="SelectMapChanged">
<option value="55ebf90799fa4a3fa57562700a68c405">Default-Street</option>
<option value="da10cf4ba254469caf8016cd66369157">Satellite</option>
<option value="86265e5a4bbb4187a59719cf134e0018">Hybrid</option>
<option value="f33a34de3a294590ab48f246e99958c9">National Geographic</option>
<option value="67372ff42cd145319639a99152b15bc3">Topographic</option>
<option value="979c6cc89af9449cbeb5342a439c6a76">Gray</option>
<option value="1a386c5dfd864bfda3f03ab428e57640">Dark Gray</option>
<option value="fae788aa91e54244b161b59725dcbb2a">Open Street Map</option>
<option value="9053b6cd38d54e65bb0967f355a232df">Streets Night</option>
<option value="c50de463235e4161b206d000587af18b">Streets Navigation</option>
</select>
}
<div class="toggle-row">
<label class="radio-container">
From Tile Layers
Expand All @@ -55,8 +64,12 @@
@switch (_basemapType)
{
case 0:
<MapView Class="map-view" Zoom="11" Latitude="_latitude" Longitude="_longitude">
<Map ArcGISDefaultBasemap="arcgis-topographic" />
<MapView @ref="_mapView1" Class="map-view" Zoom="11" Latitude="_latitude" Longitude="_longitude">
<Map>
<Basemap>
<BasemapStyle Name="_basemapStyleName" />
</Basemap>
</Map>
</MapView>
break;
case 1:
Expand All @@ -72,12 +85,12 @@
<MapView Class="map-view" Zoom="11" Latitude="_latitude" Longitude="_longitude">
<Map>
<Basemap>
<TileLayer>
<PortalItem Id="1b243539f4514b6ba35e7d995890db1d" />
</TileLayer>
<VectorTileLayer Opacity="0.75">
<PortalItem Id="6976148c11bd497d8624206f9ee03e30" />
</VectorTileLayer>
<TileLayer>
<PortalItem Id="1b243539f4514b6ba35e7d995890db1d" />
</TileLayer>
</Basemap>
</Map>
</MapView>
Expand All @@ -90,19 +103,25 @@
{
_basemapType = val;
}

private void SelectStyleMapChanged(ChangeEventArgs obj)
{
_basemapStyleName = (BasemapStyleName)Enum.Parse(typeof(BasemapStyleName), obj.Value!.ToString()!, true);
_mapView1?.Refresh();
}

private void SelectMapChanged(ChangeEventArgs obj)
private void SelectPortalMapChanged(ChangeEventArgs obj)
{
_basemapId = obj.Value?.ToString() ?? "55ebf90799fa4a3fa57562700a68c405";
_mapView2!.Refresh();
_mapView2?.Refresh();
}

private MapView? _mapView1;
private MapView? _mapView2;
private int _basemapType;
private readonly double _latitude = 34.027;
private readonly double _longitude = -118.805;
private string _basemapId = "55ebf90799fa4a3fa57562700a68c405";


private BasemapStyleName _basemapStyleName = BasemapStyleName.ArcgisNova;

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,21 @@
Select the "eye" icons to toggle a layer's visibility on the basemap.
</p>

<div id="control-set">
<div class="form-group">
<label>
Toggle Reference Layers Visibility in Widget
<input type="checkbox" @bind="_showReferenceLayers" />
</label>
</div>
<div class="form-group">
<label>
Toggle Base Layers Visibility in Widget
<input type="checkbox" @bind="_showBaseLayers" />
</label>
</div>
</div>

@if (_windowWidth is not null)
{
if (_windowWidth >= 800)
Expand All @@ -23,7 +38,10 @@
<WebScene>
<PortalItem Id="bfefe7a603c94fc29edca0f4a6662b44" />
</WebScene>
<BasemapLayerListWidget Position="OverlayPosition.TopRight" OnBaseListItemCreatedHandler="OnBaseListItemCreated" OnReferenceListItemCreatedHandler="OnReferenceListItemCreated" />
<BasemapLayerListWidget Position="OverlayPosition.TopRight">
<BasemapLayerListWidgetVisibleElements BaseLayers="_showBaseLayers"
ReferenceLayers="_showReferenceLayers" />
</BasemapLayerListWidget>
</SceneView>
}
else // for mobile, move the widget off of the map so you can see the whole map
Expand All @@ -33,7 +51,10 @@
<WebScene>
<PortalItem Id="bfefe7a603c94fc29edca0f4a6662b44" />
</WebScene>
<BasemapLayerListWidget ContainerId="widget-holder" OnBaseListItemCreatedHandler="OnBaseListItemCreated" OnReferenceListItemCreatedHandler="OnReferenceListItemCreated" />
<BasemapLayerListWidget ContainerId="widget-holder">
<BasemapLayerListWidgetVisibleElements BaseLayers="_showBaseLayers"
ReferenceLayers="_showReferenceLayers" />
</BasemapLayerListWidget>
</SceneView>
}
}
Expand All @@ -51,17 +72,7 @@
}

private int? _windowWidth;

private Task<ListItem> OnBaseListItemCreated(ListItem baseListItem)
{
return Task.Run(() => baseListItem);
}

private Task<ListItem> OnReferenceListItemCreated(ListItem baseListItem)
{
baseListItem.Visible = true;

return Task.Run(() => baseListItem);
}
private bool _showReferenceLayers = true;
private bool _showBaseLayers = true;

}
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@

private async Task OnStyleChanged(ChangeEventArgs a)
{
_style = Enum.Parse<BingImageryStyle>(a.Value!.ToString()!);
_style = Enum.Parse<BingImageryStyle>(a.Value!.ToString()!, true);
if (_bingMapsLayer is not null)
{
await AddRemoveLayer();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<Basemap>
<PortalItem Id="d582a9e953c44c09bb998c7d9b66f8d4" />
</Basemap>
<GraphicsLayer @ref="ResultsLayer" />
<GraphicsLayer @ref="GraphicsLayer">
<Graphic>
<Point @ref="PointGeometry" Longitude="-118.80657463861" Latitude="34.0005930608889" />
Expand All @@ -42,8 +43,6 @@
</SimpleFillSymbol>
</Graphic>
</GraphicsLayer>
<GraphicsLayer @ref="ResultsLayer">
</GraphicsLayer>
</Map>
<CustomOverlay Position="OverlayPosition.TopRight">
<div id="controls" class="esri-widget">
Expand All @@ -55,21 +54,14 @@
</CustomOverlay>
</MapView>

<SimpleFillSymbol @ref="BufferGraphicFill" Color="@(new MapColor(81, 46, 132, 0.5))">
<Outline Color="@(new MapColor(255, 255, 255, 255))" />
</SimpleFillSymbol>
<SimpleFillSymbol @ref="HighlightFill" FillStyle="FillStyle.Cross" Color="@(new MapColor(255, 255, 255))">
<Outline Color="@(new MapColor(255, 255, 255))" />
</SimpleFillSymbol>

@code {

private async Task CreateBuffer()
{
if (_bufferPolygon is not null) return;

_bufferPolygon = await GeometryEngine.GeodesicBuffer(PointGeometry!, 1, LinearUnit.Kilometers);
_bufferGraphic = new Graphic(_bufferPolygon, BufferGraphicFill);
_bufferGraphic = new Graphic(_bufferPolygon, _bufferGraphicFill);
await GraphicsLayer!.Add(_bufferGraphic);
}

Expand All @@ -79,7 +71,7 @@

await ClearResultsLayer();
_highlightPolygon = await GeometryEngine.Intersect(PolygonGeometry!, _bufferPolygon) as Polygon;
_highlightGraphic = new Graphic(_highlightPolygon, HighlightFill);
_highlightGraphic = new Graphic(_highlightPolygon, _highlightFill);
await ResultsLayer!.Add(_highlightGraphic);
}

Expand All @@ -89,7 +81,7 @@

await ClearResultsLayer();
_highlightPolygon = await GeometryEngine.Union(PolygonGeometry!, _bufferPolygon) as Polygon;
_highlightGraphic = new Graphic(_highlightPolygon, HighlightFill);
_highlightGraphic = new Graphic(_highlightPolygon, _highlightFill);
await ResultsLayer!.Add(_highlightGraphic);
}

Expand Down Expand Up @@ -131,11 +123,13 @@
private GraphicsLayer? GraphicsLayer { get; set; }
private GraphicsLayer? ResultsLayer { get; set; }

private Symbol? BufferGraphicFill { get; set; }
private readonly Symbol _bufferGraphicFill = new SimpleFillSymbol(new Outline(new MapColor(255, 255, 255)),
new MapColor(81, 46, 132, 0.5));
private Graphic? _bufferGraphic;
private Polygon? _bufferPolygon;

private Symbol? HighlightFill { get; set; }
private readonly Symbol _highlightFill = new SimpleFillSymbol(new Outline(new MapColor(255, 255, 255)),
new MapColor(255, 255, 255), FillStyle.Cross);
private Polygon? _highlightPolygon;
private Graphic? _highlightGraphic;
}
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@
new MapPoint(-118.791432890735, 34.0163883241613),
new MapPoint(-118.79596686535, 34.008564864635),
new MapPoint(-118.808558110679, 34.0035027131376));
private readonly AttributesDictionary _graphicAttributes = new(new Dictionary<string, object>
private readonly AttributesDictionary _graphicAttributes = new(new Dictionary<string, object?>
{
{ "Name", "Sample Polygon" },
{ "Description", "This is where you can describe the polygon." }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,21 +95,21 @@
</SimpleRenderer>
<Field Name="ObjectID" Type="FieldType.Oid" />
<Field Name="url" Type="FieldType.String" />
<Graphic Attributes="@(new AttributesDictionary(new Dictionary<string, object>
<Graphic Attributes="@(new AttributesDictionary(new Dictionary<string, object?>
{
{ "ObjectID", "6" },
{ "url", "https://arcgis.github.io/arcgis-samples-javascript/sample-data/featurelayer-collection/photo-6.jpg" }
}))">
<Point Longitude="-118.805" Latitude="34.027" />
</Graphic>
<Graphic Attributes="@(new AttributesDictionary(new Dictionary<string, object>
<Graphic Attributes="@(new AttributesDictionary(new Dictionary<string, object?>
{
{ "ObjectID", "5" },
{ "url", "https://arcgis.github.io/arcgis-samples-javascript/sample-data/featurelayer-collection/photo-5.jpg" }
}))">
<Point Longitude="-118.815" Latitude="34.017" />
</Graphic>
<Graphic Attributes="@(new AttributesDictionary(new Dictionary<string, object>
<Graphic Attributes="@(new AttributesDictionary(new Dictionary<string, object?>
{
{ "ObjectID", "4" },
{ "url", "https://arcgis.github.io/arcgis-samples-javascript/sample-data/featurelayer-collection/photo-4.jpg" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<button disabled="@(!_mapRendered)" @onclick="ToggleMovement">@(_mapRendered ? _isMoving ? "Stop" : "Start" : "Wait...")</button>
<button @onclick="ResetGraphics">Reset</button>
<button @onclick="CenterView">Center</button>
<MapView @ref="_view" Class="map-view" Latitude="_lat" Longitude="_lon" Zoom="13" OnMapRendered="OnMapRendered">
<MapView @ref="_view" Class="map-view" Latitude="_lat" Longitude="_lon" Zoom="13" OnViewRendered="OnViewRendered">
<Map>
<Basemap>
<PortalItem Id="d582a9e953c44c09bb998c7d9b66f8d4" />
Expand All @@ -33,7 +33,7 @@
}
}

private void OnMapRendered()
private void OnViewRendered()
{
_mapRendered = true;
}
Expand All @@ -43,7 +43,7 @@
List<Graphic> graphics = new();
for (var i = 1; i < 11; i++)
{
var attributes = new Dictionary<string, object> { { i.ToString(), i } };
var attributes = new Dictionary<string, object?> { { i.ToString(), i } };
var graphic = new Graphic(
new Point(_lon + _random.NextDouble() / 100, _lat + _random.NextDouble() / 100),
attributes: new AttributesDictionary(attributes));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<button disabled="@(!_mapRendered)" @onclick="(()=>_markup = !_markup)">Add new Imagery Layer in Markup</button>

<MapView @ref="_view" class="map-view"
OnViewRendered="OnMapRendered">
OnViewRendered="OnViewRendered">
<Map ArcGISDefaultBasemap="arcgis-light-gray">
@if (_markup)
{
Expand All @@ -26,7 +26,7 @@

@code {

private void OnMapRendered() => _mapRendered = true;
private void OnViewRendered() => _mapRendered = true;

public async Task AddRemoveImageryLayer()
{
Expand Down
Loading

0 comments on commit df6e543

Please sign in to comment.