Skip to main content
Version: 4.2

MapView

Namespace: Wisej.Web

Assembly: Wisej.Framework (4.2.0.0)

Displays raster map tiles, observable markers, clusters, and value-shaded GeoJSON regions.

public class MapView : Control

Coordinates use latitude/longitude degrees; GeoJSON uses longitude/latitude order. Tile requests run in the browser. AzureMapsKey is therefore visible to the browser; use an application tile proxy through CustomTiles when credentials must remain on the server. Markers belong to one collection. Region properties named "name" supply literal tooltips.

Example:

var map = new MapView { Dock = DockStyle.Fill, Center = new GeoPoint(51, 10), Zoom = 5 };
map.Markers.Add(new MapMarker { Location = new GeoPoint(53.55, 9.99), Text = "Hamburg", Badge = "12", Tone = ChipTone.Success });
map.MarkerClick += (s, e) => Console.WriteLine(e.Marker.Tag);
Controls.Add(map);
map.FitBounds();

Constructors​

Instance member MapView()​

Creates a map centered at zero degrees at zoom level 3.

Properties​

Instance member Attribution​

String: Gets or sets: Additional literal tile provider attribution, displayed with the built-in provider credit. (Default: "")

Instance member AzureMapsKey​

String: Gets or sets: Azure Maps subscription key sent to the browser. Required by the Azure provider. (Default: "")

Instance member Center​

GeoPoint: Gets or sets the viewport center in degrees. The default is (0, 0). (Default: 0, 0)

Instance member Cluster​

Boolean: Gets or sets: Whether nearby markers combine into count buttons until zoom level 19. (Default: True)

Instance member ClusterText​

String: Gets or sets: Cluster accessible label; {0} is the marker count. (Default: null)

Null resolves the current UI culture's translation. An explicit empty string is preserved.

Protected member DefaultSize​

Size: Gets the default size, 480 by 280 pixels.

Instance member KeyboardHelpText​

String: Gets or sets: Keyboard help for panning and zooming. (Default: null)

Null resolves the current UI culture's translation. An explicit empty string is preserved.

Instance member LegendText​

String: Gets or sets: Region value legend title. (Default: null)

Null resolves the current UI culture's translation. An explicit empty string is preserved.

Instance member MapAccessibleText​

String: Gets or sets: Default accessible map name when AccessibleName is empty. (Default: null)

Null resolves the current UI culture's translation. An explicit empty string is preserved.

Instance member MapStyle​

MapStyle: Gets or sets the tile color treatment. The default is Light. (Default: Light)

Light preserves the provider's original tile colors. Dark applies a themeable CSS filter to tile images without changing markers, regions, or attribution. Changing this property preserves the viewport. Use Light with a provider that already supplies dark tiles.

Example:

map.MapStyle = MapStyle.Dark;

Instance member Markers​

MapMarkerCollection: Gets the owned marker collection. Item and collection edits automatically refresh the map.

Instance member Provider​

MapProvider: Gets or sets: The raster tile provider. (Default: OSM)

Instance member Regions​

String: Gets or sets GeoJSON Feature or FeatureCollection text containing Polygon or MultiPolygon regions. (Default: "")

The default is empty. Null becomes empty. Invalid geometry throws without replacing current regions. Rings must be closed; polygon holes are supported. Null geometry is ignored. Feature ids are returned by RegionClick; an absent id uses the zero-based feature index.

Instance member ShowLegend​

Boolean: Gets or sets: Whether the region value legend is visible when numeric values exist. (Default: True)

Instance member TileUrlTemplate​

String: Gets or sets: Custom XYZ tile URL with {z}, {x}, and {y} placeholders. Empty disables tiles. HTTPS, HTTP and application-relative paths are accepted. (Default: "")

Instance member ValueMember​

String: Gets or sets the direct GeoJSON properties member used for numeric shading. The default is "value". (Default: "value")

Missing, null, and nonnumeric values receive a neutral fill. Finite numbers use five equal intervals between the minimum and maximum values. A constant range uses the middle shade.

Instance member Zoom​

Int32: Gets or sets the integer zoom level from 0 through 19. The default is 3. (Default: 3)

Instance member ZoomInText​

String: Gets or sets: Zoom in button tooltip and accessible name. (Default: null)

Null resolves the current UI culture's translation. An explicit empty string is preserved.

Instance member ZoomOutText​

String: Gets or sets: Zoom out button tooltip and accessible name. (Default: null)

Null resolves the current UI culture's translation. An explicit empty string is preserved.

Methods​

Protected member Dispose(disposing)​

Releases owned item subscriptions and marker ownership.

ParameterTypeDescription
disposingBooleanWhether managed resources are being released.

Instance member FitBounds()​

Fits all owned markers using 64 pixels of edge padding.

Empty collections leave the view unchanged. A single location uses zoom 15. The shortest longitude interval is used when markers cross the antimeridian. Call after sizing the control to calculate the desired viewport.

Instance member FitBounds(markers, padding)​

Fits a sequence of marker locations in the current control size.

ParameterTypeDescription
markersIEnumerable<MapMarker>Markers to include; they need not belong to this map.
padding optionalInt32Nonnegative edge padding in pixels. The default is 64.

Protected member OnCenterChanged(e)​

Raises CenterChanged independently of subscribed delegates.

ParameterTypeDescription
eEventArgsEvent data.

Protected member OnMapClick(e)​

Raises MapClick independently of subscribed delegates.

ParameterTypeDescription
eMapClickEventArgsEvent data.

Protected member OnMarkerClick(e)​

Raises MarkerClick independently of subscribed delegates.

ParameterTypeDescription
eMapMarkerEventArgsEvent data.

Protected member OnRegionClick(e)​

Raises RegionClick independently of subscribed delegates.

ParameterTypeDescription
eMapRegionEventArgsEvent data.

Protected member OnViewChanged(e)​

Raises ViewChanged independently of subscribed delegates.

ParameterTypeDescription
eMapViewEventArgsEvent data.

Protected member OnWebEvent(e)​

Dispatches client events to private validation methods.

ParameterTypeDescription
eWisejEventArgsClient event data.

Protected member OnWebRender(config)​

Renders versioned records, first-level settings, and ordinary events.

ParameterTypeDescription
configObjectClient configuration.

Protected member OnZoomChanged(e)​

Raises ZoomChanged independently of subscribed delegates.

ParameterTypeDescription
eEventArgsEvent data.

Instance member PanTo(point)​

Centers the map on a coordinate while preserving Zoom.

ParameterTypeDescription
pointGeoPointThe new center in degrees.

Events​

Instance member CenterChanged​

EventHandler Center changed.

Instance member MapClick​

EventHandler<MapClickEventArgs> The map background was activated without panning.

Instance member MarkerClick​

EventHandler<MapMarkerEventArgs> An individual marker was activated.

Instance member RegionClick​

EventHandler<MapRegionEventArgs> A polygon region was activated.

Instance member ViewChanged​

EventHandler<MapViewEventArgs> Center or Zoom changed through code or a completed user navigation.

Instance member ZoomChanged​

EventHandler Zoom changed.

Implements​

NameDescription
IUserDataProvides access to the UserData and Tag properties associated to the component implementing this interface.
IBindableComponentBindable components implement this interface.
IDropTargetControls that support drag & drop operations implement this interface.
IWisejComponentAll wisej components implement this interface.
IWisejControlAll wisej controls derived from the Control class must implement this interface.
IWisejSerializableAllows an object to serialize itself.