dymaptic.GeoBlazor.Core
2.0.0-beta-3
See the version list below for details.
dotnet add package dymaptic.GeoBlazor.Core --version 2.0.0-beta-3
NuGet\Install-Package dymaptic.GeoBlazor.Core -Version 2.0.0-beta-3
<PackageReference Include="dymaptic.GeoBlazor.Core" Version="2.0.0-beta-3" />
paket add dymaptic.GeoBlazor.Core --version 2.0.0-beta-3
#r "nuget: dymaptic.GeoBlazor.Core, 2.0.0-beta-3"
// Install dymaptic.GeoBlazor.Core as a Cake Addin #addin nuget:?package=dymaptic.GeoBlazor.Core&version=2.0.0-beta-3&prerelease // Install dymaptic.GeoBlazor.Core as a Cake Tool #tool nuget:?package=dymaptic.GeoBlazor.Core&version=2.0.0-beta-3&prerelease
GeoBlazor
Build Requirements
For the Asp.NET projects, including the core library, you can run on the latest .NET 6 SDK.
For the Maui sample project, you need the latest Visual Studio 2022 or .NET 7 SDK.
If you have not installed node.js on your system, you will need to download and install it in order for the npm scripts to run. Please select the appropriate installer for your system.
You will need to install Powershell 7 on your machine to run the powershell script as part of the build process. -Complete installation instructions for Powershell [can be found here] (https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell?view=powershell-7.2).
Note A reboot is required after installing the above components.
Because Geoblazor uses an unsigned, local powershell script to copy files in the Sample.Shared
project, you need to allow unsigned scripts to be run in Powershell.
-The procedure to change the "execution policies" and set them to RemoteSigned
are found here:
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-7.2#change-the-execution-policy
Note If you receive an unsigned error even after you set the above execution policy, try setting it again in the older version of PowerShell (the one that comes with Windows).
On the first build, the Core project needs to download a large number of files from npm
to node_modules
, and then copy them into wwwroot/assets
. If this process fails, or you get an error on running the samples of "Cannot load ArcGIS Assets", usually re-building the project will fix the errors.
Projects
dymaptic.GeoBlazor.Core
- The core logic library
dymaptic.GeoBlazor.Core.Sample.Shared
- A razor class library for sample applications
- All sample pages are based on the ArcGIS for Javascript API Tutorials.
dymaptic.GeoBlazor.Core.Sample.Server
- Asp.NET Core Blazor Server application sample
dotnet run --project .\samples\dymaptic.GeoBlazor.Core.Sample.Server\dymaptic.GeoBlazor.Core.Sample.Server.csproj
- Runs on kestrel or via IIS
- Serves pages via SignalR/Websockets
- Can be loaded with a
usersecrets
file to provide the ArcGIS Api Key.
dymaptic.GeoBlazor.Core.Sample.Wasm
dotnet run --project .\samples\dymaptic.GeoBlazor.Core.Sample.Wasm\dymaptic.GeoBlazor.Core.Sample.Wasm.csproj
- Runs Blazor in Web Assembly on the client browser
- No safe storage for API key, users must input an api key or sign in from the browser
dymaptic.GeoBlazor.Core.Sample.Maui
- Cross-platform mobile and desktop application
- Should be run from Visual Studio Preview. Command Line support appears to be limited at this time.
- Android and Windows versions tested
dymaptic.GeoBlazor.Interactive (not included in open source repo)
- Extended application features - coming soon!
- Please contact info@dymaptic.com to discuss licensing these advanced features!
This project wraps the ArcGIS Javascript API in a Blazor templating framework. It generates a nuget package that can be imported and consumed from any Blazor application, without directly interacting with javascript.
In addition to "hiding" the javascript implementation, the goal is also to make a simple, component-based system for declaring a map and view. For example:
<MapView Longitude="_longitude" Latitude="_latitude" Zoom="11" Style="height: 600px; width: 100%;">
<Map ArcGISDefaultBasemap="arcgis-topographic">
<GraphicsLayer>
<Graphic>
<Point Longitude="_longitude" Latitude="_latitude"/>
<SimpleMarkerSymbol Color="@(new MapColor(226, 119, 40))">
<Outline Color="@(new MapColor(255, 255, 255))" Width="1"/>
</SimpleMarkerSymbol>
</Graphic>
<Graphic>
<PolyLine Paths="@_mapPaths"/>
<SimpleLineSymbol Color="@(new MapColor(226, 119, 40))" Width="2"/>
</Graphic>
<Graphic>
<Polygon Rings="@_mapRings"/>
<SimpleFillSymbol Color="@(new MapColor(227, 139, 79, 0.8))">
<Outline Color="@(new MapColor(255, 255, 255))" Width="1"/>
</SimpleFillSymbol>
<Attributes Name="This is a Title" Description="And a Description"/>
<PopupTemplate Title="{Name}" Content="{Description}"/>
</Graphic>
</GraphicsLayer>
</Map>
</MapView>
for a 2D map with a default ArcGIS basemap, or
<SceneView Longitude="_longitude" Latitude="_latitude" Zoom="11" Style="height: 600px; width: 100%;" ZIndex="2000" Tilt="76">
<Map Ground="world-elevation">
<Basemap>
<PortalItem Id="f35ef07c9ed24020aadd65c8a65d3754" />
</Basemap>
<GraphicsLayer> <Graphic>
<Point Longitude="_longitude" Latitude="_latitude"/>
<SimpleMarkerSymbol Color="@(new MapColor(226, 119, 40))">
<Outline Color="@(new MapColor(255, 255, 255))" Width="1"/>
</SimpleMarkerSymbol>
</Graphic>
<Graphic>
<PolyLine Paths="@_mapPaths"/>
<SimpleLineSymbol Color="@(new MapColor(226, 119, 40))" Width="2"/>
</Graphic>
<Graphic>
<Polygon Rings="@_mapRings"/>
<SimpleFillSymbol Color="@(new MapColor(227, 139, 79, 0.8))">
<Outline Color="@(new MapColor(255, 255, 255))" Width="1"/>
</SimpleFillSymbol>
<Attributes Name="This is a Title" Description="And a Description"/>
<PopupTemplate Title="{Name}" Content="{Description}"/>
</Graphic>
</GraphicsLayer>
</Map>
</SceneView>
for a 3D map with a basemap loaded from a PortalId
.
Known Limitations/"Gotchas"
- All classes inheriting from
MapComponent
, implementIAsyncDisposable
. If you use these components in Razor markdown, it handles disposal for you. However, there may be situations (e.g., adding a new graphic on the fly), where you want to instantiate one of these components in C# code. Be aware that if you do this, you need to callDisposeAsync
yourself when you are done with the object. - Directly calling a
HashSet
collection likegraphicLayer.Add(graphic)
orMapView.Widgets.Add(widget)
does not work currently to register these components with the JavaScript API. Instead, usegraphicLayer.RegisterChildComponent(graphic)
orMapView.RegisterChildComponent(widget)
. - While
JsRuntime
calls are very efficient, some "real-time" events, like handling a mouse pointer moving, may have enough latency to notice on a round-trip to Blazor/C# and back to JavaScript. In these situations, it is our recommendation to instead write custom JavaScript code, which can handle the event completely client-side. SeeDisplayProjection.razor
in the...Sample.Shared
library for an example of writing your own JavaScript that interacts with GeoBlazor.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- Microsoft.AspNetCore.Components.Web (>= 6.0.13)
- Microsoft.Extensions.Configuration (>= 6.0.1)
- Microsoft.Extensions.Configuration.Binder (>= 6.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on dymaptic.GeoBlazor.Core:
Package | Downloads |
---|---|
dymaptic.GeoBlazor.Pro
GeoBlazor is a GIS Component Library and SDK for building interactive maps in Blazor, powered by ArcGIS. For more information, visit https://www.geoblazor.com or contact dymaptic at geoblazor@dymaptic.com |
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on dymaptic.GeoBlazor.Core:
Repository | Stars |
---|---|
dymaptic/GeoBlazor
Core Components for the Dymaptic GeoBlazor Library
|
Version | Downloads | Last updated | |
---|---|---|---|
3.1.1 | 880 | 8/15/2024 | |
3.1.0 | 347 | 8/1/2024 | |
3.0.3-beta-4 | 146 | 7/20/2024 | |
3.0.3-beta-3 | 202 | 6/27/2024 | |
3.0.3-beta-2 | 127 | 6/27/2024 | |
3.0.3-beta-1 | 139 | 6/27/2024 | |
3.0.2 | 1,175 | 5/8/2024 | |
3.0.2-beta-11 | 274 | 4/26/2024 | |
3.0.1 | 1,291 | 3/26/2024 | |
3.0.0 | 297 | 3/23/2024 | |
3.0.0-rc.2 | 129 | 3/9/2024 | |
3.0.0-rc.1 | 95 | 3/6/2024 | |
3.0.0-beta-95 | 325 | 2/24/2024 | |
2.5.3.2 | 5,160 | 2/11/2024 | |
2.5.3.1 | 301 | 2/10/2024 | |
2.5.3 | 336 | 2/10/2024 | |
2.5.2 | 1,746 | 12/20/2023 | |
2.5.1 | 734 | 12/13/2023 | |
2.5.0 | 1,079 | 11/26/2023 | |
2.4.1-beta-1 | 1,054 | 10/19/2023 | |
2.4.0 | 2,602 | 10/12/2023 | |
2.3.3 | 2,183 | 9/14/2023 | |
2.3.2 | 1,281 | 9/12/2023 | |
2.3.1-beta-1 | 1,580 | 8/18/2023 | |
2.3.0 | 2,124 | 8/9/2023 | |
2.3.0-beta-1 | 1,681 | 8/2/2023 | |
2.2.1 | 2,945 | 7/7/2023 | |
2.2.1-beta-1.1 | 153 | 6/16/2023 | |
2.2.0 | 3,041 | 6/2/2023 | |
2.2.0-beta-5 | 1,783 | 5/28/2023 | |
2.2.0-beta-4 | 2,174 | 5/23/2023 | |
2.2.0-beta-3 | 750 | 5/20/2023 | |
2.2.0-beta-2 | 775 | 5/20/2023 | |
2.2.0-beta-1 | 1,664 | 5/13/2023 | |
2.1.0 | 5,514 | 4/18/2023 | |
2.1.0-beta-1 | 1,754 | 4/16/2023 | |
2.0.2-beta-2 | 2,048 | 4/2/2023 | |
2.0.2-beta-1 | 2,044 | 4/1/2023 | |
2.0.1 | 2,272 | 3/18/2023 | |
2.0.1-beta-3 | 1,682 | 3/5/2023 | |
2.0.1-beta-2 | 1,706 | 3/4/2023 | |
2.0.1-beta-1 | 1,949 | 3/4/2023 | |
2.0.0 | 2,552 | 2/28/2023 | |
2.0.0-beta-9 | 1,778 | 2/24/2023 | |
2.0.0-beta-8 | 1,958 | 2/19/2023 | |
2.0.0-beta-7 | 1,659 | 2/19/2023 | |
2.0.0-beta-6 | 1,984 | 2/15/2023 | |
2.0.0-beta-5 | 1,739 | 2/15/2023 | |
2.0.0-beta-4 | 1,822 | 2/11/2023 | |
2.0.0-beta-3 | 1,903 | 2/9/2023 | |
2.0.0-beta-2 | 1,713 | 2/7/2023 | |
2.0.0-beta-11 | 1,844 | 2/25/2023 | |
2.0.0-beta-10 | 1,627 | 2/25/2023 | |
2.0.0-beta-1 | 1,790 | 2/5/2023 | |
1.2.0 | 2,946 | 11/13/2022 | |
1.1.1 | 1,370 | 10/20/2022 | |
1.1.0 | 1,198 | 10/8/2022 |