Skip to content

Commit

Permalink
ASP.NET Core 3.0 support
Browse files Browse the repository at this point in the history
- Blazor API(s) are fixed to for ASP.NET Core 3.0
- Google Maps final improvments are fixed
  • Loading branch information
ardacetinkaya committed Oct 15, 2019
1 parent 8496001 commit 90661d4
Show file tree
Hide file tree
Showing 56 changed files with 527 additions and 459 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -328,3 +328,4 @@ ASALocalRun/

# MFractors (Xamarin productivity tool) working folder
.mfractor/
demo/Blazor.GoogleMap.Server/appsettings.Development.json
28 changes: 7 additions & 21 deletions Blazor.GoogleMap.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.28902.138
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Blazor.GoogleMap.Server", "demo\Blazor.GoogleMap.Server\Blazor.GoogleMap.Server.csproj", "{9D7D3AA1-A81E-454B-9B17-0B35CDBDCC3C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Blazor.GoogleMap.Client", "demo\Blazor.GoogleMap.Client\Blazor.GoogleMap.Client.csproj", "{8015065B-010D-420B-9539-518D042BA0B4}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Blazor.GoogleMap.Shared", "demo\Blazor.GoogleMap.Shared\Blazor.GoogleMap.Shared.csproj", "{5265BA8E-F1A9-436A-9A19-2AC97373E3D2}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo", "demo", "{A76C4CD5-7315-48CE-8A01-122B0662BAA5}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{EB447513-2400-44A6-B2B1-A3E53EBFC999}"
Expand All @@ -20,37 +14,29 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_solutionItems", "_solution
README.md = README.md
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Blazor.GoogleMap.Server", "demo\Blazor.GoogleMap.Server\Blazor.GoogleMap.Server.csproj", "{72279C45-BCD5-4F61-8E2B-179DED8BE123}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9D7D3AA1-A81E-454B-9B17-0B35CDBDCC3C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9D7D3AA1-A81E-454B-9B17-0B35CDBDCC3C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9D7D3AA1-A81E-454B-9B17-0B35CDBDCC3C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9D7D3AA1-A81E-454B-9B17-0B35CDBDCC3C}.Release|Any CPU.Build.0 = Release|Any CPU
{8015065B-010D-420B-9539-518D042BA0B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8015065B-010D-420B-9539-518D042BA0B4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8015065B-010D-420B-9539-518D042BA0B4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8015065B-010D-420B-9539-518D042BA0B4}.Release|Any CPU.Build.0 = Release|Any CPU
{5265BA8E-F1A9-436A-9A19-2AC97373E3D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5265BA8E-F1A9-436A-9A19-2AC97373E3D2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5265BA8E-F1A9-436A-9A19-2AC97373E3D2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5265BA8E-F1A9-436A-9A19-2AC97373E3D2}.Release|Any CPU.Build.0 = Release|Any CPU
{8833072A-796E-43D9-840C-346F4C80409E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8833072A-796E-43D9-840C-346F4C80409E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8833072A-796E-43D9-840C-346F4C80409E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8833072A-796E-43D9-840C-346F4C80409E}.Release|Any CPU.Build.0 = Release|Any CPU
{72279C45-BCD5-4F61-8E2B-179DED8BE123}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{72279C45-BCD5-4F61-8E2B-179DED8BE123}.Debug|Any CPU.Build.0 = Debug|Any CPU
{72279C45-BCD5-4F61-8E2B-179DED8BE123}.Release|Any CPU.ActiveCfg = Release|Any CPU
{72279C45-BCD5-4F61-8E2B-179DED8BE123}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{9D7D3AA1-A81E-454B-9B17-0B35CDBDCC3C} = {A76C4CD5-7315-48CE-8A01-122B0662BAA5}
{8015065B-010D-420B-9539-518D042BA0B4} = {A76C4CD5-7315-48CE-8A01-122B0662BAA5}
{5265BA8E-F1A9-436A-9A19-2AC97373E3D2} = {A76C4CD5-7315-48CE-8A01-122B0662BAA5}
{8833072A-796E-43D9-840C-346F4C80409E} = {EB447513-2400-44A6-B2B1-A3E53EBFC999}
{72279C45-BCD5-4F61-8E2B-179DED8BE123} = {A76C4CD5-7315-48CE-8A01-122B0662BAA5}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9FE02341-2660-48BD-A738-C721556C415E}
Expand Down
33 changes: 24 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,37 @@
# Blazor.GoogleMap
Blazor component for GoogleMap which allows to manipulate with GoogleMap just with C# language and no JS is required.
Blazor(Server) component for Google Map which allows to mapping features just with C# language and ASP.NET Core 3.0

Blazor Web Assembly is still in preview for ASP.NET Core 3.0 and its' API(s) are still changing a lot. So Blazor.GoogleMap.Client project is removed for now.

## IMPORTANT!
This is very very first preview version and API it will increase and also documentation.
This is just a preview version of the component but ready to use in PROD at your own risj.
In future new features will be added. Feel free to send PR(s).

# Instalation
[![NuGet Pre Release](https://img.shields.io/badge/nuget-0.0.2--preview-orange.svg)](https://www.nuget.org/packages/BlazorMap)
Soon

# Setup
Just add ``AddGoogleMaps`` service extension to default service collection of the application. Also don't forget to check other options.

```cs
public void ConfigureServices(IServiceCollection services)
{
services.AddGoogleMaps(options =>
{
options.ApiKey = "Your Google Maps Api Key";
options.ApiKey = "Your Google Maps Api Key";
});
}
```

Also don't forget to add following .js files into _Host.cshtml file as below

```html
<script src="_framework/blazor.server.js"></script>

<script src="~/GoogleMapInterop.js"></script>
<script src="~/GoogleMapMarkerInterop.js"></script>
```

# Features
* Add marker to the map
* Add OnClick, OnDoubleClick event listeners on the map and marker
Expand All @@ -37,10 +51,11 @@ If you add marker into map whit filled property **AssociatedInfoWindowId**, afte
@page "/map"
@inject MarkerCollectionFactory MarkerCollectionFactory;
@inject InfoWindow InfoWindow;
@inject IJSRuntime JsRuntime;

<h1>Google Map</h1>

<GoogleMap OnClick="@MapOnClick" OnDoubleClick="@MapOnDoubleClick"></GoogleMap>
<GoogleMap OnClick="(args)=>MapOnClick(args)" OnDoubleClick="(args)=>MapOnDoubleClick(args)"></GoogleMap>
<GoogleMapInfoWindow Id="infoWindow">
<div>
<h4>Infowindow 1</h4>
Expand All @@ -50,7 +65,7 @@ If you add marker into map whit filled property **AssociatedInfoWindowId**, afte
}


<button onclick="@RemoveMarker">Remove marker</button>
<button @onclick="()=>RemoveMarker()">Remove marker</button>
</div>
</GoogleMapInfoWindow>

Expand All @@ -63,7 +78,7 @@ If you add marker into map whit filled property **AssociatedInfoWindowId**, afte
}


<button onclick="@RemoveMarker">Remove marker</button>
<button @onclick="()=>RemoveMarker()">Remove marker</button>
</div>
</GoogleMapInfoWindow>

Expand All @@ -72,9 +87,9 @@ If you add marker into map whit filled property **AssociatedInfoWindowId**, afte
IMarkerCollection markers;
Marker selectedMarker;

protected override void OnInit()
protected async override Task OnInitializedAsync()
{
base.OnInit();
await base.OnInitializedAsync();
markers = MarkerCollectionFactory.Create();
}

Expand Down
1 change: 0 additions & 1 deletion demo/Blazor.GoogleMap.Client/App.razor

This file was deleted.

24 changes: 0 additions & 24 deletions demo/Blazor.GoogleMap.Client/Blazor.GoogleMap.Client.csproj

This file was deleted.

45 changes: 0 additions & 45 deletions demo/Blazor.GoogleMap.Client/Pages/FetchData.razor

This file was deleted.

7 changes: 0 additions & 7 deletions demo/Blazor.GoogleMap.Client/Pages/Index.razor

This file was deleted.

1 change: 0 additions & 1 deletion demo/Blazor.GoogleMap.Client/Pages/_Imports.razor

This file was deleted.

16 changes: 0 additions & 16 deletions demo/Blazor.GoogleMap.Client/Program.cs

This file was deleted.

37 changes: 0 additions & 37 deletions demo/Blazor.GoogleMap.Client/Shared/NavMenu.razor

This file was deleted.

15 changes: 0 additions & 15 deletions demo/Blazor.GoogleMap.Client/Shared/SurveyPrompt.razor

This file was deleted.

21 changes: 0 additions & 21 deletions demo/Blazor.GoogleMap.Client/Startup.cs

This file was deleted.

16 changes: 0 additions & 16 deletions demo/Blazor.GoogleMap.Client/wwwroot/index.html

This file was deleted.

10 changes: 10 additions & 0 deletions demo/Blazor.GoogleMap.Server/App.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Router AppAssembly="@typeof(Program).Assembly">
<Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
</Found>
<NotFound>
<LayoutView Layout="@typeof(MainLayout)">
<p>Sorry, there's nothing at this address.</p>
</LayoutView>
</NotFound>
</Router>
23 changes: 13 additions & 10 deletions demo/Blazor.GoogleMap.Server/Blazor.GoogleMap.Server.csproj
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<RestoreAdditionalProjectSources>
https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json;
https://dotnet.myget.org/F/blazor-dev/api/v3/index.json;
</RestoreAdditionalProjectSources>
<LangVersion>7.3</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Blazor.Server" Version="3.0.0-preview5-19227-01" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.0.0-preview5-19227-01" />
<Content Remove="wwwroot\GoogleMapInterop.js" />
<Content Remove="wwwroot\GoogleMapMarkerInterop.js" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Blazor.GoogleMap.Client\Blazor.GoogleMap.Client.csproj" />
<ProjectReference Include="..\Blazor.GoogleMap.Shared\Blazor.GoogleMap.Shared.csproj" />
<EmbeddedResource Include="wwwroot\GoogleMapInterop.js">
<LogicalName>blazor:js:%(RecursiveDir)%(Filename)%(Extension)</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="wwwroot\GoogleMapMarkerInterop.js">
<LogicalName>blazor:js:%(RecursiveDir)%(Filename)%(Extension)</LogicalName>
</EmbeddedResource>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Blazor.GoogleMap\Blazor.GoogleMap.csproj" />
</ItemGroup>

</Project>
Loading

0 comments on commit 90661d4

Please sign in to comment.