Maps Module Overview
- 4 minutes to read
The Maps Module allows you to display business objects on a map in ASP.NET Web Forms applications. The Maps module uses the following DevExpress JavaScript Widgets:
- dxMap - displays raster maps.
- dxVectorMap - displays vector maps.
You can see the demonstration of the Maps Module in the ListEditors | Maps section of the Feature Center application that is shipped with XAF. The default location of the application is %PUBLIC%\Documents\DevExpress Demos 24.1\Components\XAF\FeatureCenter.NETFramework.XPO.
Note
In WinForms applications, you can integrate the Map control as described in the following topics: How to: Include a Custom UI Control That Is Not Integrated by Default (WinForms, ASP.NET WebForms, and ASP.NET Core Blazor), How to display geospatial information in XAF Views using Google, Bing or OpenStreet maps. In Blazor applications, you can integrate the DevExtreme Map control as described in the following topic: Blazor - How to support the XAF Maps Module scenarios (display vector and raster maps).
Business Object Types Compatible with the Maps Module
The business class library does not supply built-in business classes supported by the Maps Module. This module should be used with your custom business classes that provide location information (e.g., Address, Office, Store, etc.). Implement one of the following interfaces declared in the DevExpress.Persistent.Base namespace in your custom business class (XPO persistent object or EF entity) to use this class with the Maps Module.
- IMapsMarker - declares properties of business objects that can be displayed as markers on a raster map.
- IAreaInfo - declares properties of business objects that can be displayed as an area on a vector map.
- IVectorMapsMarker - declares properties of business objects that can be displayed as a bubble marker on a vector map.
- IVectorMapsPieMarker - declares properties of business objects that can be displayed as a pie marker on a vector map.
For examples on implementing these interfaces, see their descriptions.
Maps Module Components
The Maps Module comprises a single ASP.NET Web Forms-specific MapsAspNetModule component that can be added to a corresponding application project in the Application Designer.
Note
You can add modules to your application when you use the Solution Wizard to create a new XAF solution. Select modules in the Choose Additional Modules step.
- To add an extra module in code, add it to the XafApplication.Modules or ModuleBase.RequiredModuleTypes list (adding a reference to the module assembly is insufficient).
The Maps Module ships with the following List and Property editors.
Editor | Editor’s Control | Description |
---|---|---|
WebMapsListEditor | MapViewer | Used automatically in List Views for business objects supporting the IMapsMarker interface. Displays markers corresponding to List View’s objects on an interactive map using the dxMap widget. |
WebMapsPropertyEditor | MapViewer | Used automatically in Detail Views for reference properties of the IMapsMarker type. Displays a marker corresponding to the current property on an interactive map using the dxMap widget. |
WebVectorMapsListEditor | VectorMapViewer | Used automatically in List Views for business objects supporting the IAreaInfo, IVectorMapsMarker or IVectorMapsPieMarker interface. Displays List View’s objects as areas, bubble markers or pie markers on an interactive vector map using the dxVectorMap widget. |
Application Model Extensions
The Maps Module allows you to access map widget settings in the Model Editor. It extends the Application Model structure with the following nodes.
- IModelMapSettings - a MapSettings child node added to each Views | <ListView> and Views | DetailView | Items | ViewItem nodes. Properties of the MapSettings node specify the options of the dxMap widget when the WebMapsListEditor/WebMapsPropertyEditor is used for the current List View or View Item.
- IModelVectorMapSettings - a VectorMapSettings child node added to each Views | <ListView> node. Properties of the VectorMapSettings node specify the options of the dxVectorMap widget when the WebVectorMapsListEditor is used for the current List View.