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
{
///
/// Section Information - MAP
///
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 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 Title { get; set; }
public List Description { get; set; }
public string Image { get; set; } // url to resource id (local) or on internet
public List 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
}
}