Skip to content

Commit

Permalink
Merge pull request #183 from robertjf/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 5d2d7ec + 0e9929c commit 3528174
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 11 deletions.
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; }

}
}
29 changes: 28 additions & 1 deletion Our.Umbraco.GMaps.Core/Models/Legacy/LegacyMapConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ internal class LegacyMapConfig : MapConfig

[JsonProperty("zoom")]
[JsonPropertyName("zoom")]
public object _value
public object _zoom
{
get
{
Expand All @@ -24,5 +24,32 @@ public object _value
}
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
{
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 3528174

Please sign in to comment.