This commit is contained in:
runette committed 2024-04-22 15:52:51 +01:00
commit e0afef912e
1285 files changed
+83219

No files matched your search

@@ -0,0 +1,96 @@
//-----------------------------------------------------------------------
// <copyright file="Feature.cs" company="Mapbox">
// Copyright (c) 2016 Mapbox. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
namespace Mapbox.Geocoding {
using System;
using System.Collections.Generic;
using Mapbox.Json;
using Mapbox.Utils;
using Mapbox.Utils.JsonConverters;
/// <summary> A GeoJSON FeatureCollection of points returned by geocoding API.</summary>
#if !WINDOWS_UWP
//http://stackoverflow.com/a/12903628
[Serializable]
#endif
public class Feature {
/// <summary> Gets or sets the id. Ids are unique in the Mapbox geocoder. </summary>
/// <value>The id.</value>
[JsonProperty("id")]
public string Id { get; set; }
/// <summary>
/// Gets or sets feature type. One of country, region, postcode, place, locality, neighborhood, address, poi.
/// </summary>
/// <value>The type.</value>
[JsonProperty("type")]
public string Type { get; set; }
/// <summary>
/// Gets or sets the text.
/// </summary>
/// <value>The text.</value>
[JsonProperty("text")]
public string Text { get; set; }
/// <summary>
/// Gets or sets the name of the place.
/// </summary>
/// <value>The name of the place.</value>
[JsonProperty("place_name")]
public string PlaceName { get; set; }
/// <summary>
/// Gets or sets the relevance.
/// </summary>
/// <value>The relevance.</value>
[JsonProperty("relevance")]
public double Relevance { get; set; }
/// <summary>
/// Gets or sets the properties.
/// </summary>
/// <value>The properties.</value>
[JsonProperty("properties")]
public Dictionary<string, object> Properties { get; set; }
/// <summary>
/// Gets or sets the bbox.
/// </summary>
/// <value>The bbox.</value>
[JsonProperty("bbox", NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(BboxToVector2dBoundsConverter))]
public Vector2dBounds? Bbox { get; set; }
/// <summary>
/// Gets or sets the center.
/// </summary>
/// <value>The center.</value>
[JsonProperty("center")]
[JsonConverter(typeof(LonLatToVector2dConverter))]
public Vector2d Center { get; set; }
/// <summary>
/// Gets or sets the geometry.
/// </summary>
/// <value>The geometry.</value>
[JsonProperty("geometry")]
public Geometry Geometry { get; set; }
/// <summary>
/// Gets or sets the address.
/// </summary>
[JsonProperty("address", NullValueHandling = NullValueHandling.Ignore)]
public string Address { get; set; }
/// <summary>
/// Gets or sets the context.
/// </summary>
/// <value>The context.</value>
[JsonProperty("context", NullValueHandling = NullValueHandling.Ignore)]
public List<Dictionary<string, string>> Context { get; set; }
}
}
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: f0645486f47864cd390751dd94d0302f
timeCreated: 1493218361
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,71 @@
//-----------------------------------------------------------------------
// <copyright file="GeocodeResponse.cs" company="Mapbox">
// Copyright (c) 2016 Mapbox. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
namespace Mapbox.Geocoding {
using System;
using System.Collections.Generic;
using Mapbox.Json;
/// <summary> Base geocode response. </summary>
#if !WINDOWS_UWP
//http://stackoverflow.com/a/12903628
[Serializable]
#endif
public abstract class GeocodeResponse {
/// <summary>
/// Gets or sets the type.
/// </summary>
/// <value>The type.</value>
[JsonProperty("type", Order = 0)]
public string Type { get; set; }
/// <summary>
/// Gets or sets the features.
/// </summary>
/// <value>The features.</value>
[JsonProperty("features", Order = 2)]
public List<Feature> Features { get; set; }
/// <summary>
/// Gets or sets the attribution.
/// </summary>
/// <value>The attribution.</value>
[JsonProperty("attribution", Order = 3)]
public string Attribution { get; set; }
}
/// <summary>
/// Reverse Geocode response.
/// </summary>
#if !WINDOWS_UWP
//http://stackoverflow.com/a/12903628
[Serializable]
#endif
public class ReverseGeocodeResponse : GeocodeResponse {
/// <summary>
/// Gets or sets the query.
/// </summary>
/// <value>The query.</value>
[JsonProperty("query", Order = 1)]
public List<double> Query { get; set; }
}
/// <summary>
/// Forward geocode response.
/// </summary>
#if !WINDOWS_UWP
//http://stackoverflow.com/a/12903628
[Serializable]
#endif
public class ForwardGeocodeResponse : GeocodeResponse {
/// <summary>
/// Gets or sets the query.
/// </summary>
/// <value>The query.</value>
[JsonProperty("query", Order = 1)]
public List<string> Query { get; set; }
}
}
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: f1cccf508c40144308be9518f5085a69
timeCreated: 1491243035
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,34 @@
//-----------------------------------------------------------------------
// <copyright file="Geometry.cs" company="Mapbox">
// Copyright (c) 2016 Mapbox. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
namespace Mapbox.Geocoding {
using System;
using Mapbox.Json;
using Mapbox.Utils;
using Mapbox.Utils.JsonConverters;
/// <summary> Point geometry representing location of geocode result. </summary>
#if !WINDOWS_UWP
//http://stackoverflow.com/a/12903628
[Serializable]
#endif
public class Geometry {
/// <summary>
/// Gets or sets type. Geocode results will always be type: point.
/// </summary>
/// <value>The GeoJSON geometry type.</value>
[JsonProperty("type")]
public string Type { get; set; }
/// <summary>
/// Gets or sets coordinates. Because they are points, Geocode results will always be a single Geocoordinate.
/// </summary>
/// <value>The coordinates.</value>
[JsonConverter(typeof(LonLatToVector2dConverter))]
[JsonProperty("coordinates")]
public Vector2d Coordinates { get; set; }
}
}
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: b599e78a14b3d42c8822cec5d5775397
timeCreated: 1493218361
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: