-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Google static maps parser for #2
- Loading branch information
1 parent
312c5e3
commit ef62b39
Showing
20 changed files
with
1,116 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
// <copyright file="ILocationString.cs" company="Freiwillige Feuerwehr Krems/Donau"> | ||
// Freiwillige Feuerwehr Krems/Donau | ||
// Austraße 33 | ||
// A-3500 Krems/Donau | ||
// Austria | ||
// Tel.: +43 (0)2732 85522 | ||
// Fax.: +43 (0)2732 85522 40 | ||
// E-mail: [email protected] | ||
// | ||
// This software is furnished under a license and may be | ||
// used and copied only in accordance with the terms of | ||
// such license and with the inclusion of the above | ||
// copyright notice. This software or any other copies | ||
// thereof may not be provided or otherwise made | ||
// available to any other person. No title to and | ||
// ownership of the software is hereby transferred. | ||
// | ||
// The information in this software is subject to change | ||
// without notice and should not be construed as a | ||
// commitment by Freiwillige Feuerwehr Krems/Donau. | ||
// | ||
// </copyright> | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
namespace At.FF.Krems.Configuration.Google | ||
{ | ||
public interface ILocationString | ||
{ | ||
string LocationString { get; } | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
Product/Shared/Configuration/Google/QueryStringParametersList.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
// <copyright file="QueryStringParametersList.cs" company="Freiwillige Feuerwehr Krems/Donau"> | ||
// Freiwillige Feuerwehr Krems/Donau | ||
// Austraße 33 | ||
// A-3500 Krems/Donau | ||
// Austria | ||
// Tel.: +43 (0)2732 85522 | ||
// Fax.: +43 (0)2732 85522 40 | ||
// E-mail: [email protected] | ||
// | ||
// This software is furnished under a license and may be | ||
// used and copied only in accordance with the terms of | ||
// such license and with the inclusion of the above | ||
// copyright notice. This software or any other copies | ||
// thereof may not be provided or otherwise made | ||
// available to any other person. No title to and | ||
// ownership of the software is hereby transferred. | ||
// | ||
// The information in this software is subject to change | ||
// without notice and should not be construed as a | ||
// commitment by Freiwillige Feuerwehr Krems/Donau. | ||
// | ||
// </copyright> | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
namespace At.FF.Krems.Configuration.Google | ||
{ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
public class QueryStringParametersList | ||
{ | ||
private List<KeyValuePair<string, string>> List { get; } = new List<KeyValuePair<string, string>>(); | ||
|
||
public void Add(string key, string value) | ||
{ | ||
this.List.Add(new KeyValuePair<string, string>(key, value)); | ||
} | ||
|
||
public string GetQueryStringPostfix() | ||
{ | ||
return string.Join("&", this.List.Select(p => Uri.EscapeDataString(p.Key) + "=" + Uri.EscapeDataString(p.Value))); | ||
} | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
Product/Shared/Configuration/Google/StaticMaps/Entities/ImageSize.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
// <copyright file="ImageSize.cs" company="Freiwillige Feuerwehr Krems/Donau"> | ||
// Freiwillige Feuerwehr Krems/Donau | ||
// Austraße 33 | ||
// A-3500 Krems/Donau | ||
// Austria | ||
// Tel.: +43 (0)2732 85522 | ||
// Fax.: +43 (0)2732 85522 40 | ||
// E-mail: [email protected] | ||
// | ||
// This software is furnished under a license and may be | ||
// used and copied only in accordance with the terms of | ||
// such license and with the inclusion of the above | ||
// copyright notice. This software or any other copies | ||
// thereof may not be provided or otherwise made | ||
// available to any other person. No title to and | ||
// ownership of the software is hereby transferred. | ||
// | ||
// The information in this software is subject to change | ||
// without notice and should not be construed as a | ||
// commitment by Freiwillige Feuerwehr Krems/Donau. | ||
// | ||
// </copyright> | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
namespace At.FF.Krems.Configuration.Google.StaticMaps.Entities | ||
{ | ||
/// <summary> | ||
/// Images may be retrieved in sizes up to 640 by 640 pixels. | ||
/// The size parameter takes a string with two values separated by the x character. | ||
/// 640x640 is the largest image size allowed. | ||
/// Note that the center parameter, combined with the size parameter implicitly defines the coverage area of the map image. | ||
/// </summary> | ||
public struct ImageSize | ||
{ | ||
public readonly int Width; | ||
public readonly int Height; | ||
|
||
public ImageSize(int width, int height) | ||
{ | ||
this.Width = width; | ||
this.Height = height; | ||
} | ||
} | ||
} |
81 changes: 81 additions & 0 deletions
81
Product/Shared/Configuration/Google/StaticMaps/Entities/MapStyle.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
// <copyright file="MapStyle.cs" company="Freiwillige Feuerwehr Krems/Donau"> | ||
// Freiwillige Feuerwehr Krems/Donau | ||
// Austraße 33 | ||
// A-3500 Krems/Donau | ||
// Austria | ||
// Tel.: +43 (0)2732 85522 | ||
// Fax.: +43 (0)2732 85522 40 | ||
// E-mail: [email protected] | ||
// | ||
// This software is furnished under a license and may be | ||
// used and copied only in accordance with the terms of | ||
// such license and with the inclusion of the above | ||
// copyright notice. This software or any other copies | ||
// thereof may not be provided or otherwise made | ||
// available to any other person. No title to and | ||
// ownership of the software is hereby transferred. | ||
// | ||
// The information in this software is subject to change | ||
// without notice and should not be construed as a | ||
// commitment by Freiwillige Feuerwehr Krems/Donau. | ||
// | ||
// </copyright> | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
namespace At.FF.Krems.Configuration.Google.StaticMaps.Entities | ||
{ | ||
using At.FF.Krems.Configuration.Google.StaticMaps.Enums; | ||
|
||
/// <summary> | ||
/// Styled maps allow you to customize the presentation of the standard Google map styles, changing the visual display of such elements as roads, parks, and built-up areas to reflect a different style than that used in the default map type. | ||
/// These components are known as features and a styled map allows you to select these features and apply visual styles to their display (including hiding them entirely). | ||
/// With these changes, the map can be made to emphasize particular components or complement content within the surrounding page. | ||
/// A customized "styled" map consists of one or more specified styles, each indicated through a style parameter within the Static Map request URL. | ||
/// Additional styles are specified by passing additional style parameters. | ||
/// A style consists of a selection(s) and a set of rules to apply to that selection. | ||
/// The rules indicate what visual modification to make to the selection. | ||
/// </summary> | ||
public class MapStyle | ||
{ | ||
/// <summary> | ||
/// (optional) indicates what features to select for this style modification. (See Map Features below.) If no feature argument is passed, all features will be selected. | ||
/// </summary> | ||
public MapFeature MapFeature { get; set; } | ||
|
||
/// <summary> | ||
/// (optional) indicates what sub-set of the selected features to select. (See Map Elements below.) If no element argument is passed, all elements of the given feature will be selected. | ||
/// </summary> | ||
public MapElement MapElement { get; set; } | ||
|
||
/// <summary> | ||
/// (an RGB hex string of format 0xRRGGBB) indicates the basic color to apply to the selection. | ||
/// </summary> | ||
// ReSharper disable once InconsistentNaming | ||
public string HUE { get; set; } | ||
|
||
/// <summary> | ||
/// (a floating point value between -100 and 100) indicates the percentage change in brightness of the element. Negative values increase darkness (where -100 specifies black) while positive values increase brightness (where +100 specifies white). | ||
/// </summary> | ||
public float? Lightness { get; set; } | ||
|
||
/// <summary> | ||
/// (a floating point value between -100 and 100) indicates the percentage change in intensity of the basic color to apply to the element. | ||
/// </summary> | ||
public float? Saturation { get; set; } | ||
|
||
/// <summary> | ||
/// (a floating point value between 0.01 and 10.0, where 1.0 applies no correction) indicates the amount of gamma correction to apply to the element. Gammas modify the lightness of hues in a non-linear fashion, while unaffecting white or black values. Gammas are typically used to modify the contrast of multiple elements. For example, you could modify the gamma to increase or decrease the contrast between the edges and interiors of elements. Low gamma values (less than 1) increase contrast, while high values (> 1) decrease contrast. | ||
/// </summary> | ||
public float? Gamma { get; set; } | ||
|
||
/// <summary> | ||
/// simply inverts the existing lightness. | ||
/// </summary> | ||
public bool InverseLightness { get; set; } | ||
|
||
/// <summary> | ||
/// indicates whether and how the element appears on the map. visibility:simplified indicates that the map should simplify the presentation of those elements as it sees fit. (A simplified road structure may show fewer roads, for example.) | ||
/// </summary> | ||
public MapVisibility MapVisibility { get; set; } | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
Product/Shared/Configuration/Google/StaticMaps/Entities/Marker.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
// <copyright file="Marker.cs" company="Freiwillige Feuerwehr Krems/Donau"> | ||
// Freiwillige Feuerwehr Krems/Donau | ||
// Austraße 33 | ||
// A-3500 Krems/Donau | ||
// Austria | ||
// Tel.: +43 (0)2732 85522 | ||
// Fax.: +43 (0)2732 85522 40 | ||
// E-mail: [email protected] | ||
// | ||
// This software is furnished under a license and may be | ||
// used and copied only in accordance with the terms of | ||
// such license and with the inclusion of the above | ||
// copyright notice. This software or any other copies | ||
// thereof may not be provided or otherwise made | ||
// available to any other person. No title to and | ||
// ownership of the software is hereby transferred. | ||
// | ||
// The information in this software is subject to change | ||
// without notice and should not be construed as a | ||
// commitment by Freiwillige Feuerwehr Krems/Donau. | ||
// | ||
// </copyright> | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
namespace At.FF.Krems.Configuration.Google.StaticMaps.Entities | ||
{ | ||
using System.Collections.Generic; | ||
|
||
/// <summary> | ||
/// The markers parameter defines a set of one or more markers at a set of locations. Each marker defined within a single markers declaration must exhibit the same visual style; if you wish to display markers with different styles, you will need to supply multiple markers parameters with separate style information. | ||
/// </summary> | ||
public class Marker | ||
{ | ||
/// <summary> | ||
/// Marker's style | ||
/// </summary> | ||
public MarkerStyle Style { get; set; } | ||
|
||
public IList<ILocationString> Locations { get; set; } | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
Product/Shared/Configuration/Google/StaticMaps/Entities/MarkerStyle.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
// <copyright file="MarkerStyle.cs" company="Freiwillige Feuerwehr Krems/Donau"> | ||
// Freiwillige Feuerwehr Krems/Donau | ||
// Austraße 33 | ||
// A-3500 Krems/Donau | ||
// Austria | ||
// Tel.: +43 (0)2732 85522 | ||
// Fax.: +43 (0)2732 85522 40 | ||
// E-mail: [email protected] | ||
// | ||
// This software is furnished under a license and may be | ||
// used and copied only in accordance with the terms of | ||
// such license and with the inclusion of the above | ||
// copyright notice. This software or any other copies | ||
// thereof may not be provided or otherwise made | ||
// available to any other person. No title to and | ||
// ownership of the software is hereby transferred. | ||
// | ||
// The information in this software is subject to change | ||
// without notice and should not be construed as a | ||
// commitment by Freiwillige Feuerwehr Krems/Donau. | ||
// | ||
// </copyright> | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
namespace At.FF.Krems.Configuration.Google.StaticMaps.Entities | ||
{ | ||
using At.FF.Krems.Configuration.Google.StaticMaps.Enums; | ||
|
||
public class MarkerStyle | ||
{ | ||
/// <summary> | ||
/// (optional) specifies the size of marker from the set {tiny, mid, small}. If no size parameter is set, the marker will appear in its default (normal) size. | ||
/// </summary> | ||
public MarkerSize Size { get; set; } | ||
|
||
/// <summary> | ||
/// optional) specifies a 24-bit color (example: color=0xFFFFCC) or a predefined color from the set {black, brown, green, purple, yellow, blue, gray, orange, red, white}. | ||
/// Note that transparencies (specified using 32-bit hex color values) are not supported in markers, though they are supported for paths. | ||
/// </summary> | ||
public string Color { get; set; } | ||
|
||
/// <summary> | ||
/// (optional) specifies a single uppercase alphanumeric character from the set {A-Z, 0-9}. | ||
/// (The requirement for uppercase characters is new to this version of the API.) | ||
/// Note that default and mid sized markers are the only markers capable of displaying an alphanumeric-character parameter. | ||
/// tiny and small markers are not capable of displaying an alphanumeric-character. | ||
/// </summary> | ||
public string Label { get; set; } | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
Product/Shared/Configuration/Google/StaticMaps/Entities/Path.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
// <copyright file="Path.cs" company="Freiwillige Feuerwehr Krems/Donau"> | ||
// Freiwillige Feuerwehr Krems/Donau | ||
// Austraße 33 | ||
// A-3500 Krems/Donau | ||
// Austria | ||
// Tel.: +43 (0)2732 85522 | ||
// Fax.: +43 (0)2732 85522 40 | ||
// E-mail: [email protected] | ||
// | ||
// This software is furnished under a license and may be | ||
// used and copied only in accordance with the terms of | ||
// such license and with the inclusion of the above | ||
// copyright notice. This software or any other copies | ||
// thereof may not be provided or otherwise made | ||
// available to any other person. No title to and | ||
// ownership of the software is hereby transferred. | ||
// | ||
// The information in this software is subject to change | ||
// without notice and should not be construed as a | ||
// commitment by Freiwillige Feuerwehr Krems/Donau. | ||
// | ||
// </copyright> | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
namespace At.FF.Krems.Configuration.Google.StaticMaps.Entities | ||
{ | ||
using System.Collections.Generic; | ||
|
||
public class Path | ||
{ | ||
public PathStyle Style { get; set; } | ||
|
||
public IList<ILocationString> Locations { get; set; } | ||
} | ||
} |
Oops, something went wrong.