Click or drag to resize

Map Class

This class represents the basic map control without any gadgets. It is used as the WPFMap's base class, and as a proxy for the WinForms map control. So, it is possible to provide a common implementation for both environments, i.e. WPF and WinForms.
Inheritance Hierarchy

Namespace:  Ptv.XServer.Controls.Map
Assembly:  Ptv.XServer.Controls.Map (in Ptv.XServer.Controls.Map.dll) Version: 1.7.10.0
Syntax
public class Map : UserControl, IMap, IToolTipManagement, 
	IDisposable

The Map type exposes the following members.

Constructors
  NameDescription
Public methodMap
Initializes a new instance of the Map class. By default, the map uses animation and the scale is shown in km.
Top
Properties
  NameDescription
Public propertyCenter
Gets or sets the center of the map in WGS84 coordinates.
Public propertyCoordinateDiplayFormat
Gets or sets the display format for coordinates.
Public propertyCurrentCenter
Gets the center of the map in WGS84 coordinates while it is in animation mode.
Public propertyCurrentScale
Gets the current scale of the map in meters per pixel while it is in animation mode.
Public propertyCurrentZoomLevel
Gets the current zoom level of the map while it is in animation mode.
Public propertyDefaultThemeResources
Gets or sets the default theme. The default theme is initialized in the WpfMap.xaml file and used by UseDefaultTheme.
Public propertyFitInWindow
Gets or sets a value indicating whether the map should be fitted in the window or not.
Public propertyInvertMouseWheel
Gets or sets a value indicating whether the orientation for mouse-wheel zoom is inverted. If so, zoom in and zoom out mouse wheel direction is exchanged. The default value is false.
Public propertyIsAnimating
Gets a value indicating whether an animation is in progress. Returns true while the map performs a transition to a new map section.
Public propertyLayers
Gets the collection of map layers.
Public propertyMaxPixelDistance
Distance (specified in Pixels) between the current mouse position and a layer object, for which tooltip information should be shown. Each layer has to interpolate to its own coordinate format, what is meant by the pixel sized distance.
Public propertyMaxZoom
Gets or sets the maximal level of detail according to the standard tiling scheme. The current detail level (see ZoomLevel property) is corrected, if it is higher than the new maximum value.
Public propertyMetersPerPixel
Gets the number of meters spanned by one pixel.
Public propertyMinZoom
Gets or sets the minimal level of detail according to the standard tiling scheme. The current detail level (see ZoomLevel property) is corrected, if it is lower than the new minimum value.
Public propertyMouseDoubleClickZoom
Gets or sets the activation for zoom on double-click. If true, the user can zoom-in be double left-click and zoom-out by double right-click.
Public propertyMouseDragMode
Gets or sets the behavior when dragging the mouse while holding the left button.
Public propertyMouseWheelSpeed
Gets or sets the speed for mouse-wheel zoom. The value defines the number of map zoom levels per wheel delta. The default value is 0.5.
Public propertyScale
Gets the scale of the map in meters per pixel.
Public propertyToolTipDelay
Reads or writes the value (in [ms]) to delay tool tip display.
Public propertyToolTipManagement
Gets the object providing all functionality relevant for tool tip management.
Public propertyUseAnimation
Gets or sets a value indicating whether the map uses transitions for panning, zooming and fade-in of tiles. The default value is true.
Public propertyUseDefaultTheme

Gets or sets a value indicating whether the built-in PTV theme should be used, and thus overriding an optionally set style. The application theme can be set in the App.xaml. If no theme at all is set and the default PTV theme is not used either, the UI will look like the current Windows theme.

See the Theming Concept topic for an example.

Public propertyUseMiles
Gets or sets a value indicating whether the scale is displayed in miles or it is displayed in km.
Public propertyXmap2LayerFactory
Gets the helper object for integration of XMap2 layers and Feature Layers of XServer 2. The reference is only set when property XMapUrl is set with an XMap2 conform URL.
Public propertyXMapCopyright
Gets or sets the copyright text.
Public propertyXMapCredentials
Gets or sets the credentials for xMapServer basic HTTP authentication. The format of the credential string is "<user>:<password>".
Public propertyXMapStyle
Gets or sets the style profile of the xMapServer base map.
Public propertyXMapUrl
Gets or sets the url pointing to where the xMapServer is located (e.g. http://127.0.0.1:50010/xmap/ws/XMap).
Public propertyZoom
Gets or sets the zoom level of the map.
Public propertyZoomLevel
Gets or sets the zoom level of the map.
Top
Methods
  NameDescription
Public methodDispose
Disposal of the map. All layers are disposed.
Public methodGeoAsRelToMapView(Point)
Converts a geographic point to a point in WPF units.
Public methodGeoAsRelToMapView(Point, String)
Converts a geographic point to a point in WPF units.
Public methodGetCurrentEnvelope
Gets the bounding box of the visible map section while the map is in animation mode.
Public methodGetCurrentEnvelope(String)
Gets the bounding box of the visible map section while the map is in animation mode.
Public methodGetEnvelope
Gets the anticipated bounding box of the visible map section after the map was in animation mode / the current box while the map is in animation mode.
Public methodGetEnvelope(String)
Gets the anticipated bounding box of the visible map section after the map was in animation mode / the current box while the map is in animation mode. The bounding box coordinates are specified in a coordinate format according the parameter value of spatialReferenceId.
Public methodMouseToGeo(MouseEventArgs)
Converts the click point of the mouse event to a geographic point in WGS84 units. The click point of the mouse is determined relative to the map.
Public methodMouseToGeo(MouseEventArgs, String)
Converts the click point of the mouse event to a geographic point corresponding to the given spatial reference id. The click point of the mouse is determined relative to the map.
Public methodPrintMap
Prints the currently displayed map.
Public methodRelToMapViewAsGeo(Point)
Converts a point from WPF coordinates to a geographic point.
Public methodRelToMapViewAsGeo(Point, String)
Converts a point from WPF coordinates to a geographic point.
Public methodSetEnvelope(MapRectangle)
Centers the map resulting in all elements within the specified rectangle are visible.
Public methodSetEnvelope(MapRectangle, String)
Centers the map, so all elements within the specified rectangle are visible.
Public methodSetMapLocation(Point, Double)
Set the center and zooming level of the map.
Public methodSetMapLocation(Point, Double, String)
Set the center and zooming level of the map.
Public methodSetThemeFromXaml

Sets the current theme from a XAML file provided by the stream. The XAML file must contain a ResourceDictionary on the top level. See the attached XAML files in the demo project.

See the Theming Concept topic for an example.

Top
Events
  NameDescription
Public eventUseMilesChanged
Event indicating a change of the UseMiles property. It can be used to update the scale gadget.
Public eventViewportBeginChanged
Event indicating the beginning of a change of the visible map section. This event is intended for more longtime actions (for example reading DB-objects), when the map section will change.
Public eventViewportEndChanged
Event indicating the ending of a change of the visible map section. It is the counterpart of the event.
Public eventViewportWhileChanged
Event indicating an intermediate view, when animation mode is active. It can be used to adapt the size of WPF objects, or other actions, which are not time-consuming. This event may called multiple times, when animation mode is active.
Top
Fields
  NameDescription
Protected fieldcopyrightHintText
The text block which displays the hint for the missing xMap url.
Public fieldGadgets
Dictionary holding all existing gadgets like Scale gadget, zoom slider etc.
Protected fieldmapView
MapView to be displayed in the map.
Top
Extension Methods
  NameDescription
Public Extension MethodFindRelativeT
Finds an object of type T for a framework element which is somewhere in the visual tree.
(Defined by MapElementExtensions.)
Public Extension MethodToJson
Converts an object to a JSON string representation.
(Defined by JSONWriter.)
Top
See Also