79 lines
2.0 KiB
C#

using Manager.Interfaces.DTO;
using MongoDB.Bson.Serialization.Attributes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Manager.Interfaces.Models
{
/// <summary>
/// Section Information - MAP
/// </summary>
public class Map : Section
{
[BsonElement("Map")]
[BsonRequired]
public MapType MapType { get; set; } = MapType.hybrid;
[BsonElement("Zoom")]
public int Zoom { get; set; } = 18;
[BsonElement("Points")]
public List<GeoPoint> Points { get; set; }
[BsonElement("Icon")]
public string Icon { get; set; } // url to resource id (local) or on internet
public MapDTO ToDetailDTO()
{
return new MapDTO()
{
/*Id = Id,
Label = Label,
Type = Type,
ImageId = ImageId,*/
MapType = MapType,
Zoom = Zoom,
Points = Points.Select(p => p.ToDTO()).ToList(),
Icon = Icon
};
}
}
public class GeoPoint
{
public int Id { get; set; }
public List<TranslationDTO> Title { get; set; }
public List<TranslationDTO> Description { get; set; }
public string Image { get; set; } // url to resource id (local) or on internet
public List<TranslationDTO> Text { get; set; }
public string Latitude { get; set; }
public string Longitude { get; set; }
public GeoPointDTO ToDTO()
{
return new GeoPointDTO()
{
Id = Id,
Title = Title,
Description = Description,
Image = Image,
Text = Text,
Latitude = Latitude,
Longitude = Longitude
};
}
}
public enum MapType
{
none,
normal,
satellite,
terrain,
hybrid
}
}