MapEngine¶
Namespace: ThinkGeo.Core
This class is for generating maps.
public class MapEngine
Inheritance Object → MapEngine
Remarks:
The MapEngine class is similar to a Map Control in Map Suite Desktop Edition or Web Edition.
Properties¶
Canvas¶
Gets and sets the GeoCanvas used to draw the Layers.
public GeoCanvas Canvas { get; set; }
Property Value¶
ShowLogo¶
This property specifies whether the logo is shown on the Map or not.
public bool ShowLogo { get; set; }
Property Value¶
AdornmentLayers¶
This property holds a collection of AdornmentLayers to be drawn on the MapEngine.
public GeoCollection<AdornmentLayer> AdornmentLayers { get; }
Property Value¶
Remarks:
This collection of Layers StaticLayers will be drawn when calling the DrawAdornmentLayers API.
CurrentExtent¶
This property gets or sets the current extent of the MapEngine.
public RectangleShape CurrentExtent { get; set; }
Property Value¶
Remarks:
The current extent is the rectangle that is currently being shown on the MapEngine.
StaticLayers¶
This property holds a group of Layers to be drawn on the MapEngine.
public GeoCollection<Layer> StaticLayers { get; }
Property Value¶
Remarks:
This collection of Layers StaticLayers will be drawn when calling the DrawStaticLayers API.
DynamicLayers¶
This property holds a group of Layers to be drawn on the MapEngine.
public GeoCollection<Layer> DynamicLayers { get; }
Property Value¶
Remarks:
This collection of Layers StaticLayers will be drawn when calling the DrawDynamicLayers API.
BackgroundFillBrush¶
Gets or sets the GeoBrush for the background of the MapEngine.
public GeoBrush BackgroundFillBrush { get; set; }
Property Value¶
Constructors¶
MapEngine()¶
Create a new instance of the MapEngine.
public MapEngine()
Methods¶
ZoomOutToCenter(Int32, Single, Single, Single, Single)¶
This method updates the CurrentExtent by using the ZoomOutToCenter operation.
public void ZoomOutToCenter(int percentage, float screenX, float screenY, float screenWidth, float screenHeight)
Parameters¶
percentage
Int32
This parameter is the percentage by which you want to zoom out.
screenX
Single
This parameter is the screen X you want to center on.
screenY
Single
This parameter is the screen Y you want to center on.
screenWidth
Single
This parameter is the width of the screen.
screenHeight
Single
This parameter is the height of the screen.
Remarks:
The CurrentExtent will be adjusted for the ratio of the screen. You do not need to call GetDrawingExtent afterwards.
Pan(RectangleShape, PanDirection, Int32)¶
This method returns a panned extent.
public static RectangleShape Pan(RectangleShape worldExtent, PanDirection direction, int percentage)
Parameters¶
worldExtent
RectangleShape
This parameter is the world extent you want to pan.
direction
PanDirection
This parameter is the direction you want to pan.
percentage
Int32
This parameter is the percentage by which you want to pan.
Returns¶
RectangleShape
This method returns a panned extent.
Remarks:
None
Pan(PanDirection, Int32)¶
Update the CurrentExtent by using a panning operation.
public void Pan(PanDirection panDirection, int percentage)
Parameters¶
panDirection
PanDirection
This parameter is the direction you want to pan.
percentage
Int32
This parameter is the percentage by which you want to pan.
Remarks:
None
Pan(RectangleShape, Single, Int32)¶
This method returns a panned extent.
public static RectangleShape Pan(RectangleShape worldExtent, float degree, int percentage)
Parameters¶
worldExtent
RectangleShape
This parameter is the world extent you want to pan.
degree
Single
This parameter is the angle in degrees in which you want to pan.
percentage
Int32
This parameter is the percentage by which you want to pan.
Returns¶
RectangleShape
This method returns a panned extent.
Remarks:
None
Pan(Single, Int32)¶
This method updates the CurrentExtent by using a panning operation.
public void Pan(float degree, int percentage)
Parameters¶
degree
Single
This parameter is the angle in degrees in which you want to pan.
percentage
Int32
This parameter is the percentage by which you want to pan.
Remarks:
None
ToScreenCoordinate(Double, Double, Single, Single)¶
This method returns screen coordinates from the specified world coordinates, based on the CurrentExtent.
public ScreenPointF ToScreenCoordinate(double worldX, double worldY, float screenWidth, float screenHeight)
Parameters¶
worldX
Double
This parameter is the world point X you want converted to a screen point.
worldY
Double
This parameter is the world point Y you want converted to a screen point.
screenWidth
Single
This parameter is the width of the screen for the CurrentExtent.
screenHeight
Single
This parameter is the height of the screen for the CurrentExtent.
Returns¶
ScreenPointF
This method returns screen coordinates from the specified world coordinates, based on the CurrentExtent.
Remarks:
None
ToScreenCoordinate(PointShape, Single, Single)¶
This method returns screen coordinates from the specified world coordinates, based on the CurrentExtent.
public ScreenPointF ToScreenCoordinate(PointShape worldPoint, float screenWidth, float screenHeight)
Parameters¶
worldPoint
PointShape
This parameter is the world point you want converted to a screen point.
screenWidth
Single
This parameter is the width of the screen for the CurrentExtent.
screenHeight
Single
This parameter is the height of the screen for the CurrentExtent.
Returns¶
ScreenPointF
This method returns screen coordinates from the specified world coordinates, based on the CurrentExtent.
Remarks:
None
ToScreenCoordinate(Feature, Single, Single)¶
This method returns screen coordinates from the specified world coordinate pointFeature, based on the CurrentExtent.
public ScreenPointF ToScreenCoordinate(Feature worldPointFeature, float screenWidth, float screenHeight)
Parameters¶
worldPointFeature
Feature
This parameter is the world coordinate pointFeature you want converted to a screen point.
screenWidth
Single
This parameter is the width of the screen for the CurrentExtent.
screenHeight
Single
This parameter is the height of the screen for the CurrentExtent.
Returns¶
ScreenPointF
This method returns screen coordinates from the specified world coordinate pointFeature, based on the CurrentExtent.
Remarks:
None
ToWorldCoordinate(Single, Single, Single, Single)¶
This method returns world coordinates from screen coordinates, based on the CurrentExtent.
public PointShape ToWorldCoordinate(float screenX, float screenY, float screenWidth, float screenHeight)
Parameters¶
screenX
Single
This parameter is the X of the point you want converted to world
coordinates.
screenY
Single
This parameter is the Y of the point you want converted to world
coordinates.
screenWidth
Single
This parameter is the width of the screen.
screenHeight
Single
This parameter is the height of the screen.
Returns¶
PointShape
This method returns world coordinates from screen coordinates, based on the CurrentExtent.
Remarks:
None
ToWorldCoordinate(ScreenPointF, Single, Single)¶
This method returns world coordinates from screen coordinates, based on the CurrentExtent.
public PointShape ToWorldCoordinate(ScreenPointF screenPoint, float screenWidth, float screenHeight)
Parameters¶
screenPoint
ScreenPointF
This parameter is the point you want converted to world coordinates.
screenWidth
Single
This parameter is the width of the screen.
screenHeight
Single
This parameter is the height of the screen.
Returns¶
PointShape
This method returns world coordinates from screen coordinates, based on the CurrentExtent.
Remarks:
None
ToScreenCoordinate(RectangleShape, Double, Double, Single, Single)¶
This method returns screen coordinates from world coordinates.
public static ScreenPointF ToScreenCoordinate(RectangleShape worldExtent, double worldX, double worldY, float screenWidth, float screenHeight)
Parameters¶
worldExtent
RectangleShape
This parameter is the world extent.
worldX
Double
This parameter is the world X you want converted to screen points.
worldY
Double
This parameter is the world Y you want converted to screen points.
screenWidth
Single
This parameter is the width of the screen.
screenHeight
Single
This parameter is the height of the screen.
Returns¶
ScreenPointF
This method returns screen coordinates from world coordinates.
Remarks:
None
ToScreenCoordinate(RectangleShape, PointShape, Single, Single)¶
This method returns screen coordinates from world coordinates.
public static ScreenPointF ToScreenCoordinate(RectangleShape worldExtent, PointShape worldPoint, float screenWidth, float screenHeight)
Parameters¶
worldExtent
RectangleShape
This parameter is the world extent.
worldPoint
PointShape
This parameter is the world point you want converted to a screen point.
screenWidth
Single
This parameter is the width of the screen.
screenHeight
Single
This parameter is the height of the screen.
Returns¶
ScreenPointF
This method returns screen coordinates from world coordinates.
Remarks:
None
ToScreenCoordinate(RectangleShape, Feature, Single, Single)¶
This method returns screen coordinates from world coordinates.
public static ScreenPointF ToScreenCoordinate(RectangleShape worldExtent, Feature worldPointFeature, float screenWidth, float screenHeight)
Parameters¶
worldExtent
RectangleShape
This parameter is the world extent.
worldPointFeature
Feature
This parameter is the world point feature you want converted to a screen point.
screenWidth
Single
This parameter is the width of the screen.
screenHeight
Single
This parameter is the height of the screen.
Returns¶
ScreenPointF
This method returns screen coordinates from world coordinates.
Remarks:
None
ToWorldCoordinate(RectangleShape, Single, Single, Single, Single)¶
This method returns world coordinates from screen coordinates.
public static PointShape ToWorldCoordinate(RectangleShape worldExtent, float screenX, float screenY, float screenWidth, float screenHeight)
Parameters¶
worldExtent
RectangleShape
This parameter is the world extent.
screenX
Single
This parameter is the X coordinate of the point you want converted to world
coordinates.
screenY
Single
This parameter is the Y coordinate of the point you want converted to world
coordinates.
screenWidth
Single
This parameter is the width of the screen.
screenHeight
Single
This parameter is the height of the screen.
Returns¶
PointShape
This method returns world coordinates from screen coordinates.
Remarks:
None
ToWorldCoordinate(RectangleShape, ScreenPointF, Single, Single)¶
This method returns world coordinates from screen coordinates.
public static PointShape ToWorldCoordinate(RectangleShape worldExtent, ScreenPointF screenPoint, float screenWidth, float screenHeight)
Parameters¶
worldExtent
RectangleShape
This parameter is the world extent.
screenPoint
ScreenPointF
This parameter is the screen point you want converted to a world point.
screenWidth
Single
This parameter is the width of the screen.
screenHeight
Single
This parameter is the height of the screen.
Returns¶
PointShape
This method returns world coordinates from screen coordinates.
Remarks:
None
SnapToZoomLevel(RectangleShape, GeographyUnit, Single, Single, ZoomLevelSet)¶
This method returns an extent that is snapped to a zoom level in the provided zoom level set.
public static RectangleShape SnapToZoomLevel(RectangleShape worldExtent, GeographyUnit worldExtentUnit, float screenWidth, float screenHeight, ZoomLevelSet zoomLevelSet)
Parameters¶
worldExtent
RectangleShape
This parameter is the world extent you want snapped.
worldExtentUnit
GeographyUnit
This parameter is the geographic unit of the world extent parameter.
screenWidth
Single
This parameter is the screen width.
screenHeight
Single
This parameter is the screen height.
zoomLevelSet
ZoomLevelSet
This parameter is the set of zoom levels you want to snap to.
Returns¶
This method returns an extent that is snapped to a zoom level in the provided
zoom level set.
Remarks:
None
SnapToZoomLevel(GeographyUnit, Single, Single, ZoomLevelSet)¶
This method updates the CurrentExtent by snapping to a zoom level in the provided zoom level set.
public void SnapToZoomLevel(GeographyUnit worldExtentUnit, float screenWidth, float screenHeight, ZoomLevelSet zoomLevelSet)
Parameters¶
worldExtentUnit
GeographyUnit
This parameter is the geographic unit of the CurrentExtent.
screenWidth
Single
This parameter is the screen width.
screenHeight
Single
This parameter is the screen height.
zoomLevelSet
ZoomLevelSet
This parameter is the set of zoom levels you want to snap to.
Remarks:
None
ZoomToScale(Double, RectangleShape, GeographyUnit, Single, Single)¶
This method returns a extent that has been zoomed into a certain scale.
public static RectangleShape ZoomToScale(double targetScale, RectangleShape worldExtent, GeographyUnit worldExtentUnit, float screenWidth, float screenHeight)
Parameters¶
targetScale
Double
This parameter is the scale you want to zoom into.
worldExtent
RectangleShape
This parameter is the world extent you want zoomed into the scale.
worldExtentUnit
GeographyUnit
This parameter is the geographic unit of the world extent parameter.
screenWidth
Single
This parameter is the screen width.
screenHeight
Single
This parameter is the screen height.
Returns¶
RectangleShape
This method returns a extent that has been zoomed into a certain scale.
Remarks:
None
ZoomToScale(Double, GeographyUnit, Single, Single)¶
This method updates the CurrentExtent by zooming to a certain scale.
public void ZoomToScale(double targetScale, GeographyUnit worldExtentUnit, float screenWidth, float screenHeight)
Parameters¶
targetScale
Double
This parameter is the scale you want to zoom into.
worldExtentUnit
GeographyUnit
This parameter is the geographic unit of the CurrentExtent.
screenWidth
Single
This parameter is the screen width.
screenHeight
Single
This parameter is the screen height.
Remarks:
None
GetVersion()¶
Get the current MapSuiteCore.dll file version.
public static string GetVersion()
Returns¶
String
A string representing the file version of MapSuiteCore.dll.
LoadDataTable(Collection<Feature>, IEnumerable<String>)¶
This method is a static API to get information about a group of passed-in features with the specified returningColumns, in the format of a DataTable.
public static DataTable LoadDataTable(Collection<Feature> features, IEnumerable<string> returningColumnNames)
Parameters¶
features
Collection<Feature>
This parameter specifies the target features.
returningColumnNames
IEnumerable<String>
This parameter specifies the returning columnNames for the features.
Returns¶
DataTable
A DateTable of information about those passed-in features and the returning columnNames.
OnAdornmentLayersDrawing(DrawingAdornmentLayersEventArgs)¶
This event is raised before AdornmentLayers are drawn.
protected void OnAdornmentLayersDrawing(DrawingAdornmentLayersEventArgs e)
Parameters¶
e
DrawingAdornmentLayersEventArgs
The AdornmentLayersDrawingEventArgs passed for the event raised.
OnAdornmentLayersDrawn(DrawnAdornmentLayersEventArgs)¶
This event is raised after AdornmentLayers are drawn.
protected void OnAdornmentLayersDrawn(DrawnAdornmentLayersEventArgs e)
Parameters¶
e
DrawnAdornmentLayersEventArgs
The AdornmentLayersDrawnEventArgs passed for the event raised.
OnAdornmentLayerDrawing(DrawingAdornmentLayerEventArgs)¶
This event is raised before an AdornmentLayer is drawn.
protected void OnAdornmentLayerDrawing(DrawingAdornmentLayerEventArgs e)
Parameters¶
e
DrawingAdornmentLayerEventArgs
The AdornmentLayerDrawingEventArgs passed for the event raised.
OnAdornmentLayerDrawn(DrawnAdornmentLayerEventArgs)¶
This event is raised after an AdornmentLayer is drawn.
protected void OnAdornmentLayerDrawn(DrawnAdornmentLayerEventArgs e)
Parameters¶
e
DrawnAdornmentLayerEventArgs
The AdornmentLayerDrawnEventArgs passed for the event raised.
OnLayersDrawing(LayersDrawingEventArgs)¶
This event is raised before Layers are drawn.
protected void OnLayersDrawing(LayersDrawingEventArgs e)
Parameters¶
e
LayersDrawingEventArgs
The LayersDrawingEventArgs passed for the event raised.
OnLayersDrawn(LayersDrawnEventArgs)¶
This event is raised after Layers are drawn.
protected void OnLayersDrawn(LayersDrawnEventArgs e)
Parameters¶
e
LayersDrawnEventArgs
The LayersDrawnEventArgs passed for the event raised.
OnLayerDrawing(LayerDrawingEventArgs)¶
This event is raised before a Layer is drawn.
protected void OnLayerDrawing(LayerDrawingEventArgs e)
Parameters¶
e
LayerDrawingEventArgs
The LayerDrawingEventArgs passed for the event raised.
OnLayerDrawn(LayerDrawnEventArgs)¶
This event is raised after a Layer is drawn.
protected void OnLayerDrawn(LayerDrawnEventArgs e)
Parameters¶
e
LayerDrawnEventArgs
The LayerDrawnEventArgs passed for the event raised.
FindStaticFeatureLayer(String)¶
Finds a feature layer by key (specified in the "name" parameter) within the collection of StaticLayers.
public FeatureLayer FindStaticFeatureLayer(string name)
Parameters¶
name
String
The key to find the final result feature layer.
Returns¶
FeatureLayer
The corresponding FeatureLayer with the specified key in the MapControl.
FindStaticRasterLayer(String)¶
Find the raster layer by key (specified in the "name" parameter) within the collection of StaticLayers.
public RasterLayer FindStaticRasterLayer(string name)
Parameters¶
name
String
The key to find the final result raster layer.
Returns¶
RasterLayer
The corresponding RasterLayer with the passing specified in the MapControl.
FindDynamicFeatureLayer(String)¶
Find the feature layer by key (specified in the "name" parameter) within the collection of DynamicLayers.
public FeatureLayer FindDynamicFeatureLayer(string name)
Parameters¶
name
String
The key to find the final result feature layer.
Returns¶
FeatureLayer
The corresponding FeatureLayer with the specified key in the MapControl.
FindDynamicRasterLayer(String)¶
Find the raster layer by key (specified in the "name" parameter) within the collection of DynamicLayers.
public RasterLayer FindDynamicRasterLayer(string name)
Parameters¶
name
String
The key to find the final result raster layer.
Returns¶
RasterLayer
The corresponding RasterLayer with the specified key in the MapControl.
GetDrawingExtent(Single, Single)¶
This method returns an adjusted extent based on the ratio of the screen width and height.
public RectangleShape GetDrawingExtent(float screenWidth, float screenHeight)
Parameters¶
screenWidth
Single
This parameter is the width of the screen.
screenHeight
Single
This parameter is the height of the screen.
Returns¶
This method returns an adjusted extent based on the ratio of the screen width and
height.
Remarks:
This function is used because the extent to draw must be the rame ratio as the screen width and height. If they are not, then the image drawn will be stretched or compressed. We always adjust the extent upwards to ensure that no matter how we adjust it, the original extent will fit within the new extent. This ensures that everything you wanted to see in the first extent is visible and maybe a bit more.
GetDrawingExtent(RectangleShape, Single, Single)¶
This method returns an adjusted extent based on the ratio of the screen width and height.
public static RectangleShape GetDrawingExtent(RectangleShape worldExtent, float screenWidth, float screenHeight)
Parameters¶
worldExtent
RectangleShape
This parameter is the world extent you want to adjust for drawing.
screenWidth
Single
This parameter is the width of the screen.
screenHeight
Single
This parameter is the height of the screen.
Returns¶
This method returns an adjusted extent based on the ratio of the screen width and
height.
Remarks:
This function is used because the extent to draw must be the rame ratio as the screen width and height. If they are not, then the image drawn will be stretched or compressed. We always adjust the extent upwards to ensure that no matter how we adjust it, the original extent will fit within the new extent. This ensures that everything you wanted to see in the first extent is visible and maybe a bit more.
This function takes a height and width in screen coordinates, then looks at a world extent passed, and returns an adjusted world rectangle so that the ratio to height and width in screen and world coordinates match.
OpenAllLayers()¶
This API allows you to open all of the layers (either static or dynamic).
public void OpenAllLayers()
CloseAllLayers()¶
This API allows you close all of the layers (either static or dynamic).
public void CloseAllLayers()
CenterAt(RectangleShape, PointShape, Single, Single)¶
This is a static function that allows you to pass in a world rectangle, a world point to center on, and a height and width in screen units. The function will center the rectangle based on the point, then adjust the rectangle's ratio based on the height and width in screen coordinates.
public static RectangleShape CenterAt(RectangleShape worldExtent, PointShape worldPoint, float screenWidth, float screenHeight)
Parameters¶
worldExtent
RectangleShape
This parameter is the current extent you want to center.
worldPoint
PointShape
This parameter is the world point you want to center on.
screenWidth
Single
This parameter is the width of the screen.
screenHeight
Single
This parameter is the height of the screen.
Returns¶
RectangleShape
This method returns an adjusted extent centered on a point.
Remarks:
None
CenterAt(PointShape, Single, Single)¶
This is a function that allows you to pass a world point to center on and a height and width in screen units. The function will update the current extent by centering on the point and adjusting its ratio based on the height and width in screen coordinates.
public void CenterAt(PointShape worldPoint, float screenWidth, float screenHeight)
Parameters¶
worldPoint
PointShape
This parameter is the world point you want to center on.
screenWidth
Single
This parameter is the width of the screen.
screenHeight
Single
This parameter is the height of the screen.
Remarks:
This API will update the CurrentExtent.
CenterAt(RectangleShape, Feature, Single, Single)¶
This is a static function that allows you to pass in a world rectangle, a world point to center on, and a height and width in screen units. The function will center the rectangle based on the point, then adjust the rectangle's ratio based on the height and width in screen coordinates.
public static RectangleShape CenterAt(RectangleShape worldExtent, Feature centerFeature, float screenWidth, float screenHeight)
Parameters¶
worldExtent
RectangleShape
This parameter is the current extent you want to center.
centerFeature
Feature
This parameter is the world point feature you want to center on.
screenWidth
Single
This parameter is the width of the screen.
screenHeight
Single
This parameter is the height of the screen.
Returns¶
RectangleShape
This method returns an adjusted extent centered on a point.
Remarks:
None
CenterAt(Feature, Single, Single)¶
This is a function that allows you to pass in a feature to center on, as well as a height and width in screen units. The function will center the CurrentExtent based on the specified feature and adjust its ratio based on the height and width in screen coordinates.
public void CenterAt(Feature centerFeature, float screenWidth, float screenHeight)
Parameters¶
centerFeature
Feature
This parameter is the world point feature you want to center on.
screenWidth
Single
This parameter is the width of the screen.
screenHeight
Single
This parameter is the height of the screen.
Remarks:
This API will update the CurrentExtent.
CenterAt(RectangleShape, Single, Single, Single, Single)¶
This is a static function that allows you to pass in a world rectangle, a point in screen coordinates to center on, and a height and width in screen units. The function will center the rectangle based on the screen point, then adjust the rectangle's ratio based on the height and width in screen coordinates.
public static RectangleShape CenterAt(RectangleShape worldExtent, float screenX, float screenY, float screenWidth, float screenHeight)
Parameters¶
worldExtent
RectangleShape
This parameter is the current extent you want to center.
screenX
Single
This parameter is the X coordinate on the screen to center to.
screenY
Single
This parameter is the Y coordinate on the screen to center to.
screenWidth
Single
This parameter is the width of the screen.
screenHeight
Single
This parameter is the height of the screen.
Returns¶
RectangleShape
This method returns an adjusted extent centered on a point.
Remarks:
None
CenterAt(Single, Single, Single, Single)¶
This is a function that allows you to pass a screen point to center on and a height and width in screen units. The function will update the current extent by centering on the point and adjusting its ratio based on the height and width in screen coordinates.
public void CenterAt(float screenX, float screenY, float screenWidth, float screenHeight)
Parameters¶
screenX
Single
This parameter is the X coordinate on the screen to center on.
screenY
Single
This parameter is the Y coordinate on the screen to center on.
screenWidth
Single
This parameter is the width of the screen.
screenHeight
Single
This parameter is the height of the screen.
Remarks:
This API will update the CurrentExtent.
GetScreenDistanceBetweenTwoWorldPoints(RectangleShape, PointShape, PointShape, Single, Single)¶
This method returns the number of pixels between two world points.
public static float GetScreenDistanceBetweenTwoWorldPoints(RectangleShape worldExtent, PointShape worldPoint1, PointShape worldPoint2, float screenWidth, float screenHeight)
Parameters¶
worldExtent
RectangleShape
This parameter is the world extent.
worldPoint1
PointShape
This parameter is the first point -- the one you want to measure from.
worldPoint2
PointShape
This parameter is the second point -- the one you want to measure to.
screenWidth
Single
This parameter is the width of the screen.
screenHeight
Single
This parameter is the height of the screen.
Returns¶
Single
This method returns the number of pixels between two world points.
Remarks:
None
GetScreenDistanceBetweenTwoWorldPoints(PointShape, PointShape, Single, Single)¶
This method returns the number of pixels between two world points using the CurrentExtent as reference.
public float GetScreenDistanceBetweenTwoWorldPoints(PointShape worldPoint1, PointShape worldPoint2, float screenWidth, float screenHeight)
Parameters¶
worldPoint1
PointShape
This parameter is the first point -- the one you want to measure from.
worldPoint2
PointShape
This parameter is the second point -- the one you want to measure to.
screenWidth
Single
This parameter is the width of the screen.
screenHeight
Single
This parameter is the height of the screen.
Returns¶
Single
This method returns the number of pixels between two world points.
Remarks:
None
GetScreenDistanceBetweenTwoWorldPoints(Feature, Feature, Single, Single)¶
This method returns the number of pixels between two world points using the CurrentExtent as reference.
public float GetScreenDistanceBetweenTwoWorldPoints(Feature worldPointFeature1, Feature worldPointFeature2, float screenWidth, float screenHeight)
Parameters¶
worldPointFeature1
Feature
This parameter is the first pointFeture -- the one you want to measure from.
worldPointFeature2
Feature
This parameter is the second pointFeature -- the one you want to measure to.
screenWidth
Single
This parameter is the width of the screen.
screenHeight
Single
This parameter is the height of the screen.
Returns¶
Single
This method returns the number of pixels between two world points.
Remarks:
None
GetScreenDistanceBetweenTwoWorldPoints(RectangleShape, Feature, Feature, Single, Single)¶
This method returns the number of pixels between two world points.
public static float GetScreenDistanceBetweenTwoWorldPoints(RectangleShape worldExtent, Feature worldPointFeature1, Feature worldPointFeature2, float screenWidth, float screenHeight)
Parameters¶
worldExtent
RectangleShape
This parameter is the world extent.
worldPointFeature1
Feature
This parameter is the first point Feature -- the one you want to measure from.
worldPointFeature2
Feature
This parameter is the second point Feature -- the one you want to measure to.
screenWidth
Single
This parameter is the width of the screen.
screenHeight
Single
This parameter is the height of the screen.
Returns¶
Single
This method returns the number of pixels between two world points.
Remarks:
None
GetWorldDistanceBetweenTwoScreenPoints(RectangleShape, ScreenPointF, ScreenPointF, Single, Single, GeographyUnit, DistanceUnit)¶
This method returns the distance in world units between two screen points.
public static double GetWorldDistanceBetweenTwoScreenPoints(RectangleShape worldExtent, ScreenPointF screenPoint1, ScreenPointF screenPoint2, float screenWidth, float screenHeight, GeographyUnit worldExtentUnit, DistanceUnit distanceUnit)
Parameters¶
worldExtent
RectangleShape
This parameter is the world extent.
screenPoint1
ScreenPointF
This is the screen point you want to measure from.
screenPoint2
ScreenPointF
This is the screen point you want to measure to.
screenWidth
Single
This parameter is the width of the screen.
screenHeight
Single
This parameter is the height of the screen.
worldExtentUnit
GeographyUnit
This is the geographic unit of the world extent rectangle.
distanceUnit
DistanceUnit
This is the geographic unit you want the result to show in.
Returns¶
Double
This method returns the distance in wold units between two screen points.
Remarks:
None
GetWorldDistanceBetweenTwoScreenPoints(ScreenPointF, ScreenPointF, Single, Single, GeographyUnit, DistanceUnit)¶
This method returns the distance in world units between two screen points by using the CurrentExtent as a reference.
public double GetWorldDistanceBetweenTwoScreenPoints(ScreenPointF screenPoint1, ScreenPointF screenPoint2, float screenWidth, float screenHeight, GeographyUnit mapUnit, DistanceUnit distanceUnit)
Parameters¶
screenPoint1
ScreenPointF
This is the screen point you want to measure from.
screenPoint2
ScreenPointF
This is the screen point you want to measure to.
screenWidth
Single
This parameter is the width of the screen.
screenHeight
Single
This parameter is the height of the screen.
mapUnit
GeographyUnit
This parameter specifies the MapUnit used in the current map.
distanceUnit
DistanceUnit
This is the geographic unit you want the result to show in.
Returns¶
Double
This method returns the distance in world units between two screen points.
Remarks:
None
GetWorldDistanceBetweenTwoScreenPoints(RectangleShape, Single, Single, Single, Single, Single, Single, GeographyUnit, DistanceUnit)¶
This method returns the distance in wold units between two screen points.
public static double GetWorldDistanceBetweenTwoScreenPoints(RectangleShape worldExtent, float screenPoint1X, float screenPoint1Y, float screenPoint2X, float screenPoint2Y, float screenWidth, float screenHeight, GeographyUnit worldExtentUnit, DistanceUnit distanceUnit)
Parameters¶
worldExtent
RectangleShape
This parameter is the world extent.
screenPoint1X
Single
This parameter is the X of the point you want to measure from.
screenPoint1Y
Single
This parameter is the Y of the point you want to measure from.
screenPoint2X
Single
This parameter is the X of the point you want to measure to.
screenPoint2Y
Single
This parameter is the Y of the point you want to measure to.
screenWidth
Single
This parameter is the width of the screen.
screenHeight
Single
This parameter is the height of the screen.
worldExtentUnit
GeographyUnit
This is the geographic unit of the world extent you passed in.
distanceUnit
DistanceUnit
This is the geographic unit you want the result to show in.
Returns¶
GetCurrentScale(Single, Single, GeographyUnit)¶
Get the current Scale responding to the CurrentExtent.
public double GetCurrentScale(float screenWidth, float screenHeight, GeographyUnit mapUnit)
Parameters¶
screenWidth
Single
This parameter specifies the screen width responding to the
CurrentExtent.
screenHeight
Single
mapUnit
GeographyUnit
This parameter specifies the MapUnit used in the current map.
Returns¶
Double
The calculated scale based on the CurrentExtent.
GetCurrentScale(RectangleShape, Single, Single, GeographyUnit)¶
This Static API is used to calculate the scale based on the specified worldExtent and its corresponding ScreenWidth and MapUnit.
public static double GetCurrentScale(RectangleShape worldExtent, float screenWidth, float screenHeight, GeographyUnit mapUnit)
Parameters¶
worldExtent
RectangleShape
This parameter specifies the worldExtent used to calculate the current
scale.
screenWidth
Single
This parameter specifies the screenWidth corresponding to the worldExtent.
screenHeight
Single
mapUnit
GeographyUnit
This parameter specifies the unit for the extent, the result will be different if
choose DecimalDegree as Unit and Meter as Unit.
Returns¶
GetBoundingBoxOfItems(IEnumerable<BaseShape>)¶
This API gets the BoundingBox of a group of BaseShapes.
public static RectangleShape GetBoundingBoxOfItems(IEnumerable<BaseShape> shapes)
Parameters¶
shapes
IEnumerable<BaseShape>
The target group of BaseShapes to get the BoundingBox for.
Returns¶
RectangleShape
The BoundingBox that contains all the shapes you passed in.
GetBoundingBoxOfItems(IEnumerable<Feature>)¶
This API gets the BoundingBox of a group of Features.
public static RectangleShape GetBoundingBoxOfItems(IEnumerable<Feature> features)
Parameters¶
features
IEnumerable<Feature>
The target group of Features to get the BoundingBox for.
Returns¶
RectangleShape
The BoundingBox that contains all the features you passed in.
Draw(IEnumerable<Layer>, GeoImage, GeographyUnit)¶
Draw a group of layers on the specified "background" image.
public GeoImage Draw(IEnumerable<Layer> layers, GeoImage image, GeographyUnit mapUnit)
Parameters¶
layers
IEnumerable<Layer>
This parameter specifies the target layers to be drawn.
image
GeoImage
This parameter specifies the "background" image of the returning image.
mapUnit
GeographyUnit
This parameter specifies the MapUnit used in the current map.
Returns¶
GeoImage
The resulting image after drawing the target layers on the specified "background" image.
Draw(IEnumerable<Layer>, Int32, Int32, GeographyUnit)¶
Draw a group of layers and return a new image with the specified width and height.
public GeoImage Draw(IEnumerable<Layer> layers, int width, int height, GeographyUnit mapUnit)
Parameters¶
layers
IEnumerable<Layer>
This parameter specifies the target layers to be drawn.
width
Int32
This parameter specifies the width of the returning image.
height
Int32
This parameter specifies the height of the returning image.
mapUnit
GeographyUnit
This parameter specifies the MapUnit used in the current map.
Returns¶
GeoImage
The resulting image after drawing the target layers based on the specified width and height.
DrawStaticLayers(GeoImage, GeographyUnit)¶
Draw a group of static layers on the specified "background" image.
public GeoImage DrawStaticLayers(GeoImage image, GeographyUnit mapUnit)
Parameters¶
image
GeoImage
This parameter specifies the "background" image of the returning image.
mapUnit
GeographyUnit
This parameter specifies the MapUnit used in the current map.
Returns¶
GeoImage
The resulting image after drawing the group of static layers on the specified "background" image.
DrawDynamicLayers(GeoImage, GeographyUnit)¶
Draw a group of dynamic layers on the specified "background" image.
public GeoImage DrawDynamicLayers(GeoImage image, GeographyUnit mapUnit)
Parameters¶
image
GeoImage
This parameter specifies the "background" image of the returning image.
mapUnit
GeographyUnit
This parameter specifies the MapUnit used in the current map.
Returns¶
GeoImage
The resulting image after drawing the group of dynamic layers on the specified "background" image.
DrawAdornmentLayers(GeoImage, GeographyUnit)¶
Draw a group of AdornmentLayers on the specified "background" image.
public GeoImage DrawAdornmentLayers(GeoImage image, GeographyUnit mapUnit)
Parameters¶
image
GeoImage
This parameter specifies the "background" image of the returning image.
mapUnit
GeographyUnit
This parameter specifies the MapUnit used in the current map.
Returns¶
GeoImage
The resulting image after drawing the group of AdornmentLayers on the specified "background" image.
DrawStaticLayers(Int32, Int32, GeographyUnit)¶
Draw a group of static layers and return a new image with the specified width and height.
public GeoImage DrawStaticLayers(int width, int height, GeographyUnit mapUnit)
Parameters¶
width
Int32
This parameter specifies the width of the returning image.
height
Int32
This parameter specifies the height of the returning image.
mapUnit
GeographyUnit
This parameter specifies the MapUnit used in the current map.
Returns¶
GeoImage
The resulting image after drawing the group of static layers based on the specified width and height.
DrawDynamicLayers(Int32, Int32, GeographyUnit)¶
Draw a group of dynamic layers and return a new image with the specified width and height.
public GeoImage DrawDynamicLayers(int width, int height, GeographyUnit mapUnit)
Parameters¶
width
Int32
This parameter specifies the width of the returning image.
height
Int32
This parameter specifies the height of the returning image.
mapUnit
GeographyUnit
This parameter specifies the MapUnit used in the current map.
Returns¶
GeoImage
The resulting image after drawing the group of dynamic layers based on the specified width and height.
DrawAdornmentLayers(Int32, Int32, GeographyUnit)¶
Draw a group of AdornmentLayers and return a new image with the specified width and height.
public GeoImage DrawAdornmentLayers(int width, int height, GeographyUnit mapUnit)
Parameters¶
width
Int32
This parameter specifies the width of the returning image.
height
Int32
This parameter specifies the height of the returning image.
mapUnit
GeographyUnit
This parameter specifies the MapUnit used in the current map.
Returns¶
GeoImage
The resulting image after drawing the group of AdornmentLayers based on the specified width and height.
ZoomIn(Int32)¶
This method updates the CurrentExtent that is zoomed in by the percentage provided.
public void ZoomIn(int percentage)
Parameters¶
percentage
Int32
This parameter is the percentage by which you want to zoom in.
Remarks:
None
ZoomIn(RectangleShape, Int32)¶
This method returns a new extent that is zoomed in by the percentage provided.
public static RectangleShape ZoomIn(RectangleShape worldExtent, int percentage)
Parameters¶
worldExtent
RectangleShape
This parameter is the world extent you want to zoom.
percentage
Int32
This parameter is the percentage by which you want to zoom in.
Returns¶
This method returns a new extent that is zoomed in by the percentage
provided.
Remarks:
None
ZoomIntoCenter(RectangleShape, Int32, PointShape, Single, Single)¶
This method returns an extent that is centered and zoomed in.
public static RectangleShape ZoomIntoCenter(RectangleShape worldExtent, int percentage, PointShape worldPoint, float screenWidth, float screenHeight)
Parameters¶
worldExtent
RectangleShape
This parameter is the world extent that you want centered and zoomed.
percentage
Int32
This parameter is the percentage by which you want to zoom in.
worldPoint
PointShape
This parameter is the world point you want the extent to be centered on.
screenWidth
Single
This parameter is the width in screen coordinates.
screenHeight
Single
This parameter is the height in screen coordinates.
Returns¶
RectangleShape
This method returns an extent that is centered and zoomed in.
Remarks:
The resulting rectangle will already be adjusted for the ratio of the screen. You do not need to call GetDrawingExtent afterwards.
ZoomIntoCenter(RectangleShape, Int32, Feature, Single, Single)¶
This method returns a new extent that is zoomed in by the percentage provided.
public static RectangleShape ZoomIntoCenter(RectangleShape worldExtent, int percentage, Feature centerFeature, float screenWidth, float screenHeight)
Parameters¶
worldExtent
RectangleShape
This parameter is the world extent you want to zoom.
percentage
Int32
This parameter is the percentage by which you want to zoom in.
centerFeature
Feature
This parameter is the world point feature you want the extent to be centered on.
screenWidth
Single
This parameter is the width in screen coordinates.
screenHeight
Single
This parameter is the height in screen coordinates.
Returns¶
This method returns a new extent that is zoomed in by the percentage
provided.
Remarks:
None
ZoomIntoCenter(Int32, PointShape, Single, Single)¶
This method will update the CurrentExtent by using the ZoomIntoCenter operation.
public void ZoomIntoCenter(int percentage, PointShape worldPoint, float screenWidth, float screenHeight)
Parameters¶
percentage
Int32
This parameter is the percentage by which you want to zoom in.
worldPoint
PointShape
This parameter is the world point you want the extent to be centered on.
screenWidth
Single
This parameter is the width in screen coordinates.
screenHeight
Single
This parameter is the height in screen coordinates.
Remarks:
The CurrentExtent will be adjusted for the ratio of the screen. You do not need to call GetDrawingExtent afterwards.
ZoomIntoCenter(Int32, Feature, Single, Single)¶
This method returns an extent that is centered and zoomed in.
public void ZoomIntoCenter(int percentage, Feature centerFeature, float screenWidth, float screenHeight)
Parameters¶
percentage
Int32
This parameter is the percentage by which you want to zoom in.
centerFeature
Feature
This parameter is the world point you want the extent to be centered on.
screenWidth
Single
This parameter is the width in screen coordinates.
screenHeight
Single
This parameter is the height in screen coordinates.
Remarks:
The resulting rectangle will already be adjusted for the ratio of the screen. You do not need to call GetDrawingExtent afterwards.
ZoomIntoCenter(RectangleShape, Int32, Single, Single, Single, Single)¶
This method returns an extent that is centered and zoomed in.
public static RectangleShape ZoomIntoCenter(RectangleShape worldExtent, int percentage, float screenX, float screenY, float screenWidth, float screenHeight)
Parameters¶
worldExtent
RectangleShape
This parameter is the world extent you want to center and zoom.
percentage
Int32
This parameter is the percentage by which you want to zoom in.
screenX
Single
This parameter is the screen X you want to center on.
screenY
Single
This parameter is the screen Y you want to center on.
screenWidth
Single
This parameter is the width of the screen.
screenHeight
Single
This parameter is the height of the screen.
Returns¶
RectangleShape
This method returns an extent that is centered and zoomed in.
Remarks:
The resulting rectangle will already be adjusted for the ratio of the screen. You do not need to call GetDrawingExtent afterwards.
ZoomIntoCenter(Int32, Single, Single, Single, Single)¶
This method updates the CurrentExtent based on a calculated rectangle that is centered and zoomed in.
public void ZoomIntoCenter(int percentage, float screenX, float screenY, float screenWidth, float screenHeight)
Parameters¶
percentage
Int32
This parameter is the percentage by which you want to zoom in.
screenX
Single
This parameter is the screen X you want to center on.
screenY
Single
This parameter is the screen Y you want to center on.
screenWidth
Single
This parameter is the width of the screen.
screenHeight
Single
This parameter is the height of the screen.
Remarks:
The CurrentExtent will be adjusted for the ratio of the screen. You do not need to call GetDrawingExtent afterwards.
ZoomOut(RectangleShape, Int32)¶
This method returns a new extent that is zoomed out by the percentage provided.
public static RectangleShape ZoomOut(RectangleShape worldExtent, int percentage)
Parameters¶
worldExtent
RectangleShape
This parameter is the world extent you want to zoom.
percentage
Int32
This parameter is the percentage by which you want to zoom out.
Returns¶
This method returns a new extent that is zoomed out by the percentage
provided.
Remarks:
None
ZoomOut(Int32)¶
This method will update the CurrentExtent by using the ZoomOut operation.
public void ZoomOut(int percentage)
Parameters¶
percentage
Int32
This parameter is the percentage by which you want to zoom.
Remarks:
None
ZoomOutToCenter(RectangleShape, Int32, PointShape, Single, Single)¶
This method returns an extent that is centered and zoomed out.
public static RectangleShape ZoomOutToCenter(RectangleShape worldExtent, int percentage, PointShape worldPoint, float screenWidth, float screenHeight)
Parameters¶
worldExtent
RectangleShape
This parameter is the world extent you want to center and zoom.
percentage
Int32
This parameter is the percentage by which you want to zoom out.
worldPoint
PointShape
This parameter is the world point you want the extent to be centered on.
screenWidth
Single
This parameter is the width of the screen.
screenHeight
Single
This parameter is the height of the screen.
Returns¶
RectangleShape
This method returns an extent that is centered and zoomed out.
Remarks:
The resulting rectangle will already be adjusted for the ratio of the screen. You do not need to call GetDrawingExtent afterwards.
ZoomOutToCenter(RectangleShape, Int32, Feature, Single, Single)¶
This method returns an extent that is centered and zoomed out.
public static RectangleShape ZoomOutToCenter(RectangleShape worldExtent, int percentage, Feature centerFeature, float screenWidth, float screenHeight)
Parameters¶
worldExtent
RectangleShape
This parameter is the world extent you want to center and zoom.
percentage
Int32
This parameter is the percentage by which you want to zoom out.
centerFeature
Feature
This parameter is the feature you want the extent to be centered on.
screenWidth
Single
This parameter is the width of the screen.
screenHeight
Single
This parameter is the height of the screen.
Returns¶
RectangleShape
This method returns an extent that is centered and zoomed out.
Remarks:
The resulting rectangle will already be adjusted for the ratio of the screen. You do not need to call GetDrawingExtent afterwards.
ZoomOutToCenter(Int32, PointShape, Single, Single)¶
This method updates the CurrentExtent by using the ZoomOutToCenter operation.
public void ZoomOutToCenter(int percentage, PointShape worldPoint, float screenWidth, float screenHeight)
Parameters¶
percentage
Int32
This parameter is the percentage by which you want to zoom out.
worldPoint
PointShape
This parameter is the world point you want the extent to be centered on.
screenWidth
Single
This parameter is the width of the screen.
screenHeight
Single
This parameter is the height of the screen.
Remarks:
The CurrentExtent will be adjusted for the ratio of the screen. You do not need to call GetDrawingExtent afterwards.
ZoomOutToCenter(Int32, Feature, Single, Single)¶
This method updates the CurrentExtent by using the ZoomOutToCenter operation.
public void ZoomOutToCenter(int percentage, Feature centerFeature, float screenWidth, float screenHeight)
Parameters¶
percentage
Int32
This parameter is the percentage by which you want to zoom out.
centerFeature
Feature
This parameter is the world point Feature you want the extent to be centered on.
screenWidth
Single
This parameter is the width of the screen.
screenHeight
Single
This parameter is the height of the screen.
Remarks:
The CurrentExtent will be adjusted for the ratio of the screen. You do not need to call GetDrawingExtent afterwards.
ZoomOutToCenter(RectangleShape, Int32, Single, Single, Single, Single)¶
This method returns an extent that is centered and zoomed out.
public static RectangleShape ZoomOutToCenter(RectangleShape worldExtent, int percentage, float screenX, float screenY, float screenWidth, float screenHeight)
Parameters¶
worldExtent
RectangleShape
This parameter is the world extent you want to center and zoom.
percentage
Int32
This parameter is the percentage by which you want to zoom out.
screenX
Single
This parameter is the screen X you want to center on.
screenY
Single
This parameter is the screen Y you want to center on.
screenWidth
Single
This parameter is the width of the screen.
screenHeight
Single
This parameter is the height of the screen.
Returns¶
RectangleShape
This method returns an extent that is centered and zoomed out.
Remarks:
The resulting rectangle will already be adjusted for the ratio of the screen. You do not need to call GetDrawingExtent afterwards.
Events¶
LayersDrawing¶
This event is raised before Layers are drawn.
public event EventHandler<LayersDrawingEventArgs> LayersDrawing;
LayersDrawn¶
This event is raised after Layers are drawn.
public event EventHandler<LayersDrawnEventArgs> LayersDrawn;
LayerDrawing¶
This event is raised before a Layer is drawn.
public event EventHandler<LayerDrawingEventArgs> LayerDrawing;
LayerDrawn¶
This event is raised after a Layer is drawn.
public event EventHandler<LayerDrawnEventArgs> LayerDrawn;
AdornmentLayersDrawing¶
This event is raised before AdornmentLayers are drawn.
public event EventHandler<DrawingAdornmentLayersEventArgs> AdornmentLayersDrawing;
AdornmentLayersDrawn¶
This event is raised after AdornmentLayers are drawn.
public event EventHandler<DrawnAdornmentLayersEventArgs> AdornmentLayersDrawn;
AdornmentLayerDrawing¶
This event is raised before an AdornmentLayer is drawn.
public event EventHandler<DrawingAdornmentLayerEventArgs> AdornmentLayerDrawing;
AdornmentLayerDrawn¶
This event is raised after an AdornmentLayer is drawn.
public event EventHandler<DrawnAdornmentLayerEventArgs> AdornmentLayerDrawn;