IMapsMarker Interface
Declares properties of business objects that can be displayed on a map using the Maps Module.
Namespace: DevExpress.Persistent.Base
Assembly:
DevExpress.Persistent.Base.v22.1.dll
Declaration
public interface IMapsMarker :
IBaseMapsMarker
Public Interface IMapsMarker
Inherits IBaseMapsMarker
You can implement this interface in an XPO or Entity Framework business object. As a result, the WebMapsListEditor will be used to display List Views of this business object. Each object is displayed as a marker. The Marker title is displayed after clicking a marker. An object’s Detail View is displayed after clicking the Show details link below the title.
XPO Example
using DevExpress.Persistent.Base;
using DevExpress.Persistent.BaseImpl;
using DevExpress.Xpo;
//...
public class Location : BaseObject, IMapsMarker {
public Location(Session session) : base(session) { }
//...
private string title;
public string Title {
get { return title; }
set { SetPropertyValue(nameof(Title), ref title, value); }
}
private double latitude;
public double Latitude {
get { return latitude; }
set { SetPropertyValue(nameof(Latitude), ref latitude, value); }
}
private double longitude;
public double Longitude {
get { return longitude; }
set { SetPropertyValue(nameof(Longitude), ref longitude, value); }
}
}
Imports DevExpress.Persistent.Base
Imports DevExpress.Persistent.BaseImpl
Imports DevExpress.Xpo
'...
Public Class Location
Inherits BaseObject
Implements IMapsMarker
Public Sub New(session As Session)
MyBase.New(session)
End Sub
'...
Private m_title As String
Public Property Title As String
Get
Return m_title
End Get
Set(value As String)
SetPropertyValue(NameOf(Title), m_title, value)
End Set
End Property
<Browsable(False)>
<PersistentAlias(NameOf(Title))>
Public ReadOnly Property Title2 As String Implements IBaseMapsMarker.Title
Get
Return Convert.ToString(EvaluateAlias(NameOf(Title2)))
End Get
End Property
Private m_latitude As Double
Public Property Latitude As Double
Get
Return m_latitude
End Get
Set(value As Double)
SetPropertyValue(NameOf(Latitude), m_latitude, value)
End Set
End Property
<Browsable(False)>
<PersistentAlias(NameOf(Latitude))>
Public ReadOnly Property Latitude2 As Double Implements IBaseMapsMarker.Latitude
Get
Return Convert.ToDouble(EvaluateAlias(NameOf(Latitude2)))
End Get
End Property
Private m_longitude As Double
Public Property Longitude As Double
Get
Return m_longitude
End Get
Set(value As Double)
SetPropertyValue(NameOf(Longitude), m_longitude, value)
End Set
End Property
<Browsable(False)>
<PersistentAlias(NameOf(Longitude))>
Public ReadOnly Property Longitude2 As Double Implements IBaseMapsMarker.Longitude
Get
Return Convert.ToDouble(EvaluateAlias(NameOf(Longitude2)))
End Get
End Property
End Class
Note
See the complete example in the Location.cs (Location.vb) file in the Main Demo that is installed in the %PUBLIC%\Documents\DevExpress Demos 22.1\Components\XAF\MainDemo folder by default.
EF Example
using DevExpress.Persistent.Base;
using System.ComponentModel;
// ...
public class Location : IMapsMarker {
[Browsable(false)]
public int ID { get; private set; }
// ...
public string Title { get; set; }
public double Latitude { get; set; }
public double Longitude { get; set; }
}
Imports DevExpress.Persistent.Base
Imports System.ComponentModel
' ...
Public Class Location
Implements IMapsMarker
Public Sub New()
End Sub
Private privateID As Integer
<Browsable(False)>
Public Property ID() As Integer
Get
Return privateID
End Get
Private Set(ByVal value As Integer)
privateID = value
End Set
End Property
'...
Public Property Title() As String
<Browsable(False)>
Public ReadOnly Property Title2() As String Implements IBaseMapsMarker.Title
Get
Return Convert.ToString(Title)
End Get
End Property
Public Property Longitude() As Double
<Browsable(False)>
Public ReadOnly Property Longitude2() As Double Implements IBaseMapsMarker.Longitude
Get
Return Convert.ToDouble(Longitude)
End Get
End Property
Public Property Latitude() As Double
<Browsable(False)>
Public ReadOnly Property Latitude2() As Double Implements IBaseMapsMarker.Latitude
Get
Return Convert.ToDouble(Latitude)
End Get
End Property
End Class
See Also