Skip to content

Commit

Permalink
Merge pull request #185 from ArnoldV/develop
Browse files Browse the repository at this point in the history
Fixes for issues #182 and #179
  • Loading branch information
robertjf authored Dec 14, 2024
2 parents 14a636d + d83297b commit 56118f7
Show file tree
Hide file tree
Showing 11 changed files with 56 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
# https://learn.microsoft.com/en-us/dotnet/core/compatibility/sdk/7.0/solution-level-output-no-longer-valid

- name: Upload artifacts
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
with:
name: nuget
path: ${{ env.OUTPUT_PATH }}
4 changes: 2 additions & 2 deletions Our.Umbraco.GMaps.Core/Models/Legacy/LegacyMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ internal class LegacyMap
[DataMember(Name = "address")]
[JsonProperty("address")]
[JsonPropertyName("address")]
internal LegacyAddress Address { get; set; }
public LegacyAddress Address { get; set; }

[DataMember(Name = "mapconfig")]
[JsonProperty("mapconfig")]
[JsonPropertyName("mapconfig")]
internal LegacyMapConfig MapConfig { get; set; }
public LegacyMapConfig MapConfig { get; set; }

}
}
41 changes: 40 additions & 1 deletion Our.Umbraco.GMaps.Core/Models/Legacy/LegacyMapConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,47 @@ internal class LegacyMapConfig : MapConfig
[JsonPropertyName("mapcenter")]
public string MapCenter { get; set; }

[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public new string Zoom { get; set; }

[JsonProperty("zoom")]
[JsonPropertyName("zoom")]
public new string Zoom { get; set; }
public object _zoom
{
get
{
if (int.TryParse(Zoom, out var intValue)) return intValue;
return this.Zoom;
}
set { this.Zoom = value.ToString(); }
}

[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public new MapType MapType { get; set; }

[JsonProperty("maptype")]
[JsonPropertyName("maptype")]
public new object _mapType

Check warning on line 34 in Our.Umbraco.GMaps.Core/Models/Legacy/LegacyMapConfig.cs

View workflow job for this annotation

GitHub Actions / publish-nuget (7.x)

The member 'LegacyMapConfig._mapType' does not hide an accessible member. The new keyword is not required.

Check warning on line 34 in Our.Umbraco.GMaps.Core/Models/Legacy/LegacyMapConfig.cs

View workflow job for this annotation

GitHub Actions / publish-nuget (7.x)

The member 'LegacyMapConfig._mapType' does not hide an accessible member. The new keyword is not required.

Check warning on line 34 in Our.Umbraco.GMaps.Core/Models/Legacy/LegacyMapConfig.cs

View workflow job for this annotation

GitHub Actions / publish-nuget (7.x)

The member 'LegacyMapConfig._mapType' does not hide an accessible member. The new keyword is not required.

Check warning on line 34 in Our.Umbraco.GMaps.Core/Models/Legacy/LegacyMapConfig.cs

View workflow job for this annotation

GitHub Actions / publish-nuget (7.x)

The member 'LegacyMapConfig._mapType' does not hide an accessible member. The new keyword is not required.

Check warning on line 34 in Our.Umbraco.GMaps.Core/Models/Legacy/LegacyMapConfig.cs

View workflow job for this annotation

GitHub Actions / publish-nuget (7.x)

The member 'LegacyMapConfig._mapType' does not hide an accessible member. The new keyword is not required.

Check warning on line 34 in Our.Umbraco.GMaps.Core/Models/Legacy/LegacyMapConfig.cs

View workflow job for this annotation

GitHub Actions / publish-nuget (7.x)

The member 'LegacyMapConfig._mapType' does not hide an accessible member. The new keyword is not required.
{
get
{
return this.MapType;
//return base.MapType?.ToString().ToLower();
}
set {
this.MapType = value switch
{
"roadmap" => Models.MapType.Roadmap,
"satellite" => Models.MapType.Satellite,
"hybrid" => Models.MapType.Hybrid,
"terrain" => Models.MapType.Terrain,
"styled_map" => Models.MapType.StyledMap,
"styled map" => Models.MapType.StyledMap,
_ => Models.MapType.Roadmap,
};
}
}
}
}
2 changes: 1 addition & 1 deletion Our.Umbraco.GMaps.Core/Models/MapType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ public enum MapType
[EnumMember(Value = "terrain")]
Terrain,
[EnumMember(Value = "styled_map")]
StyledMap
StyledMap
}
}
4 changes: 2 additions & 2 deletions Our.Umbraco.GMaps.Core/Our.Umbraco.GMaps.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>

<Version>3.0.2</Version>
<Version>3.0.3</Version>
<Authors>Arnold Visser</Authors>
<Company>Arnold Visser</Company>
<Description>Basic Google Maps with autocomplete property editor for Umbraco 8+. This package contains the Core DLL only.</Description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ public override object ConvertIntermediateToObject(IPublishedElement owner, IPub
{
model.MapConfig.Zoom = string.IsNullOrEmpty(intermediate.MapConfig.Zoom) ? 17 : Convert.ToInt32(intermediate.MapConfig.Zoom);
}
if (model.MapConfig.MapType == null)
{
model.MapConfig.MapType = intermediate.MapConfig.MapType;
}
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Umbraco.Cms" Version="13.0.1" />
<PackageReference Include="Umbraco.Cms" Version="13.5.2" />

<!-- Force Windows to use ICU. Otherwise Windows 10 2019H1+ will do it, but older Windows 10 and most, if not all, Windows Server editions will run NLS -->
<PackageReference Include="Microsoft.ICU.ICU4C.Runtime" Version="72.1.0.3" />
Expand Down
4 changes: 2 additions & 2 deletions Our.Umbraco.GMaps/Our.Umbraco.GMaps.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<StaticWebAssetBasePath>App_Plugins/Our.Umbraco.GMaps</StaticWebAssetBasePath>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<ContentTargetFolders>.</ContentTargetFolders>
<IncludeBuildOutput>false</IncludeBuildOutput>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>

<Version>3.0.2</Version>
<Version>3.0.3</Version>
<Authors>Arnold Visser</Authors>
<Company>Arnold Visser</Company>
<Description>Basic Google Maps with autocomplete property editor for Umbraco 8+</Description>
Expand Down
3 changes: 2 additions & 1 deletion Our.Umbraco.GMaps/wwwroot/js/maps.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ angular.module('umbraco').controller('GMapsMapsController', ['$scope', '$element

var mapOptions = {
zoom: vm.zoomLevel,
mapId: 'DEMO_MAP_ID',
center: latLngMapCenter,
streetViewControl: false, // Fix for #15
gestureHandling: 'cooperative',
Expand All @@ -281,7 +282,7 @@ angular.module('umbraco').controller('GMapsMapsController', ['$scope', '$element

vm.map.setMapTypeId(mapTypeId)

vm.marker = new google.maps.Marker({
vm.marker = new google.maps.marker.AdvancedMarkerElement({
position: latLng,
title: 'Marker',
map: vm.map,
Expand Down
2 changes: 1 addition & 1 deletion Our.Umbraco.GMaps/wwwroot/js/maps.factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

return {
initialize: function (apiKey) {
var url = 'https://maps.googleapis.com/maps/api/js?key=' + apiKey + '&libraries=places&callback=googleMapsInitialized';
var url = 'https://maps.googleapis.com/maps/api/js?key=' + apiKey + '&libraries=places&libraries=marker&callback=googleMapsInitialized&v=weekly';
if (!scriptExists(url)) {
var script = document.createElement('script');
script.async = true;
Expand Down

0 comments on commit 56118f7

Please sign in to comment.