CS4 webControl25

CS4 webControl25

Map25

Map25 is an advanced interactive map control built on top of Leaflet. It supports markers, routes, zones (polygons), circles, clustering, movable markers, and multiple map sources such as Google, Bing, and OpenStreetMap.

Features

  • Multiple map providers (Google, Bing, OSM)
  • Markers with icons, labels, and popups
  • Routes (polyline)
  • Zones (polygon)
  • Circles with radius
  • Marker clustering
  • Movable marker support
  • Server-side object response handling

Setup()

The Setup() method loads required CSS and JavaScript files. This must be called once per page.

@Html.Raw(Map25.Setup())
Always call Setup() before rendering the map HTML.

MapProperties

MapProperties is the main configuration object for Map25.

Property Description
ControlId Unique ID for the map container
Center Center point (Lat,Lng)
Zoom Default zoom level
MapHeight Custom height (CSS value)
MapSources List of map sources
MapMarkers List of markers
Routes List of routes
MapZones List of zones (polygons)
Circles List of circles
IsCluster Enable marker clustering
MovableMarker Allow marker movement

Map Sources

MapSources = new List<Map25.MapSource>
{
    Map25.MapSource.GoogleSatellite,
    Map25.MapSource.GoogleStreets,
    Map25.MapSource.OSM
}

Markers

MapMarkers = new List<Map25.MapMarker>
{
    new Map25.MapMarker
    {
        Point = "11.0168,76.9558",
        Label = "Office",
        MarkerId = "M1",
        PopupHtml = "Main Office"
    }
}

Routes

Routes = new List<Map25.MapRoute>
{
    new Map25.MapRoute
    {
        Points = "11.01,76.95;11.02,76.96",
        Color = "blue",
        LineWidth = "4",
        Label = "Delivery Route",
        RouteId = "R1"
    }
}

Zones (Polygon)

MapZones = new List<Map25.MapZone>
{
    new Map25.MapZone
    {
        Points = "11.01,76.95;11.02,76.96;11.03,76.94",
        LineColor = "red",
        FillColor = "#ffcccc",
        Label = "Restricted Area",
        ZoneId = "Z1"
    }
}

Circles

Circles = new List<Map25.MapCircle>
{
    new Map25.MapCircle
    {
        Point = "11.0168,76.9558",
        Radius = "500",
        Color = "orange",
        FillColor = "orange",
        CircleId = "C1"
    }
}

Rendering the Map

@Html.Raw(Map25.GetHtml(mapProperties))

Handling Object Response

When user draws or edits objects on the map, the response is captured in a hidden field and can be retrieved using:

var response = Map25.GetObjectResponse();