Skip to main content
All docs
V26.1
  • Use Map Control Project and Form Templates

    • 3 minutes to read

    The VCL Template Kit ships with automatically installed Project and Form templates for the ExpressMapControl Suite. These templates are designed to reduce time spent on repetitive project and form setups, as well as improve onboarding for new VCL developers and boost productivity in experienced teams.

    VCL Map Control: Run and Test the Generated App

    Project Template

    The Map Application template creates a single-form application project that contains the TdxMapControl component with a Ribbon UI and a configured OpenStreetMap tile data provider.

    To run the Application/Project Wizard, select the following item in the RAD Studio IDE menu:

    FileNewDevExpress VCL v26.1 Application/Project - Delphi

    VCL Map Control: RAD Studio Menu Items for the VCL Template Kit

    VCL Map Control: The "Map Application" Template

    Select Map Application in the Office-Inspired Controls category and click Create Project.

    Result: Generated Project

    The TdxMapControl component occupies the main form area. The generated form is derived from the TdxRibbonForm class and encapsulates all best app building practices for high-DPI multi-monitor environments. The generated project includes all DevExpress vector skins and palettes.

    VCL Map Control: A Generated Map Project Example in the RAD Studio IDE

    Sample Map Layers

    The TdxMapControl component includes a map tile layer with a pre-configured OpenStreetMap provider. In addition, the map control includes an overlay item layer to display a marker on the map.

    VCL Map Control: Project Structure — Map Layers

    Note

    The TdxMapControl component displays content at runtime.

    UI Elements & End-User Functionality

    In addition to the TdxMapControl positioned using the TdxLayoutControl component, the main application form includes a Ribbon UI with two tabs – Options and Skins. The Ribbon Form caption bar includes an embedded TdxOfficeSearchBox component.

    The Options tab displays the following buttons from left to right:

    VCL Map Control: The Generated Ribbon UI — Options

    Initial View
    Restores the map view displayed at startup.
    Zoom In | Zoom Out
    Zoom the map in or out by 1 (within the range between 1 and 20). Alternatively, you can use built-in UI elements on the Map Control Navigation Panel. Refer to the following topic for detailed information on end-user map zoom functionality: TdxCustomMapControl.ZoomLevel.

    The Skins tab displays the Ribbon Skin Selector component that allows users to switch between all DevExpress vector skins and palettes in the generated application.

    VCL Map Control: The Generated Ribbon UI — Skins

    Run & Test the App

    Build and run the generated project. Use Ribbon buttons and built-in UI elements to zoom and pan the displayed OpenStreet map.

    VCL Map Control: Run and Test the Generated App

    Form Template

    The Map Form template allows you to add a configured DevExpress form with a TdxMapControl component to an existing application.

    To run the Form/User Control Wizard, select the following item in the RAD Studio IDE menu:

    FileNewDevExpress VCL v26.1 Form/User Control - Delphi

    VCL Map Control: RAD Studio Menu items for the VCL Template Kit

    VCL Map Control: The "Map Form" Template

    Select Map Form in the Office-Inspired Controls category and click Create Project.

    Result: Generated Form

    The template creates a child form derived from the TdxRibbonForm class. The added form has the same layout and Ribbon UI as a standalone application created using the Map Application template.

    Use the Generated Form

    The form template does not automatically associate the generated form with existing app functionality. You need to manually display the form in code. For example:

    uses
      uChildForm;  // Adds the generated form's unit explicitly
    
    procedure TMainForm1.cxMapControlDisplayButton1Click(Sender: TObject);
    begin
      ChildForm.Show;  // Displays the generated form
    end;
    
    See Also