User Tools

Site Tools


thinkgeo.mapsuite.mvcedition.map

ThinkGeo.MapSuite.MvcEdition.Map

Note: The page was created before Map Suite 10. Map Suite 10.0 organized many classes into new namespaces and assemblies as well as had a few minor breaks in compatibility. The majority of previously built code should work without modification assuming the new namespaces are added. For guidance on upgrading your existing code, please check out MapSuite 10 Upgrade Guide.

This class represents the map control.

Inheritance Hierarchy

  • System.Object
    • ThinkGeo.MapSuite.MvcEdition.MvcControlBase
      • ThinkGeo.MapSuite.MvcEdition.Map

Members Summary

Public Constructors

Map()

  • Initializes a new instance of the Map class.
Remarks
  • N/A
Parameters

Map(String)

  • Initializes a new instance of the Map class with identifier.
Remarks
  • N/A
Parameters
  • name
    • Type:String
    • Description:N/A

Map(String,Unit,Unit)

  • Initializes a new instance of the Map class with identifier, map width, and map height specified.
Remarks
  • N/A
Parameters
  • name
    • Type:String
    • Description:N/A
  • width
    • Type:Unit
    • Description:N/A
  • height
    • Type:Unit
    • Description:N/A

Protected Constructors

Public Methods

ToScreenCoordinate(Double,Double)

  • Returns a point shape in screen coordinates from the specified X, Y world coordinates.
Remarks
  • This method converts X, Y world coordinates to a point in screen coordinates.
Return Value
Parameters
  • worldX
    • Type:Double
    • Description:The X world coordinate.
  • worldY
    • Type:Double
    • Description:The Y world coordinate.

ToScreenCoordinate(PointShape)

  • Returns a screen point from a point shape in world coordinates.
Remarks
  • This method converts the coordinates of a point shape to a point in screen coordinates.
Return Value
Parameters
  • worldPoint
    • Description:A point shape in world coordinates.

ToWorldCoordinate(Single,Single)

  • Returns a point shape in world coordinates from the specified X, Y screen coordinates.
Remarks
  • This method converts X, Y screen coordinates to a point shape in world coodinates.
Return Value
  • Description:A point shape in world coordinates.
Parameters
  • screenX
    • Type:Single
    • Description:The X-value in pixels referenced to the screen origin.
  • screenY
    • Type:Single
    • Description:The Y-value in pixels referenced to the screen origin.

ToWorldCoordinate(ScreenPointF)

  • Returns a point shape in world coordinates from a ScreenPointF structure.
Remarks
  • This method converts a screen point to a point in world coordinates.
Return Value
  • Description:A point shape in world coordinates.
Parameters
  • screenPoint
    • Description:The point (in screen coordinates) to convert to world coordinates.

CenterAt(PointShape)

  • Moves the center of the map to a specified point..
Remarks
  • N/A
Return Value
  • Type:Void
  • Description:N/A
Parameters
  • worldPoint
    • Description:The target point in world coordinates to set as the center of the map's CurrentExtent.

CenterAt(Double,Double)

  • Moves the center of the map to a point specified by the provided X, Y world coordinates.
Remarks
  • This method changes the map center to a point specified by the X, Y coordinates you provide.
Return Value
  • Type:Void
  • Description:N/A
Parameters
  • worldX
    • Type:Double
    • Description:The X-value in world coordinates of the new center.
  • worldY
    • Type:Double
    • Description:The Y-value in world coordinates of the new center.

ZoomTo(PointShape,Double)

  • Zooms the map to the center point and the scale that you specify.
Remarks
  • The map will be panned to the new center and zoomed to the scale that you specify. If the new scale is not within the scales of the zoomlevels, the map will snap to the nearest upper zoomlevel. Thus, the scale the map finally zooms to may not be exactly the same as the scale you specified.
Return Value
  • Type:Void
  • Description:N/A
Parameters
  • center
    • Description:The new center point of the map.
  • scale
    • Type:Double
    • Description:The new scale that the map will zoom to.

ZoomIn()

  • Zooms the map in to the next zoomlevel.
Remarks
  • N/A
Return Value
  • Type:Void
  • Description:N/A
Parameters

ZoomOut()

  • Zooms the map out to the next zoomlevel.
Remarks
  • N/A
Return Value
  • Type:Void
  • Description:N/A
Parameters

ZoomToMarkers(IEnumerable<Marker>)

  • Changes the current extent to the extent that includes all of the markers passed in.
Remarks
  • This method changes the map's current extent to the smallest BoundingBox that includes all of the markers you specified.
Return Value
  • Type:Void
  • Description:N/A
Parameters
  • markers
    • Type:IEnumerable<Marker>
    • Description:The markers that will be included in the new extent.

ZoomToScale(Double)

  • Zoom the map to a specific scale.
Remarks
  • This method will not affect the center of the map. It zooms the map to the zoomlevel whose scale is larger and nearest to the scale specified. For example, if you specify a scale that is between two zoomlevels, the map will snap to the nearest upper zoomlevel. So the map's final scale might not be equal to the specified scale after you call this method.
Return Value
  • Type:Void
  • Description:N/A
Parameters
  • targetScale
    • Type:Double
    • Description:The scale the map will zoom to.

GetBitmap()

  • Save this object to a bitmap
Remarks
  • N/A
Return Value
  • Type:Bitmap
  • Description:a bitmap
Parameters

GetBitmap(Int32,Int32)

  • Gets a bitmap image based on the current map settings with the specified width and height.
Remarks
  • This method generates a bitmap map image with the current map settings, using the image width and height that you specify.
Return Value
  • Type:Bitmap
  • Description:A bitmap that is generated base on the current map settings.
Parameters
  • width
    • Type:Int32
    • Description:The width of bitmap.
  • height
    • Type:Int32
    • Description:The height of bitmap.

FromJson(String)

  • Load this object from a json string.
Remarks
  • N/A
Return Value
  • Type:Void
  • Description:N/A
Parameters
  • jsonString
    • Type:String
    • Description:a json string

GetScreenDistanceBetweenTwoWorldPoints(PointShape,PointShape)

  • Gets the distance in pixels between two specified points in world coordinates.
Remarks
  • N/A
Return Value
  • Type:Single
  • Description:The lengh in pixels between the two points.
Parameters
  • startPoint
    • Description:The first point in world coordinates.
  • endpoint
    • Description:The second point in world coordinates.

GetWorldDistanceBetweenTwoScreenPoints(ScreenPointF,ScreenPointF,DistanceUnit)

  • Gets the distance in the specified distance unit from two screen points.
Remarks
  • N/A
Return Value
  • Type:Double
  • Description:The distance value in the specified unit between two screen points.
Parameters
  • startPoint
    • Description:The first point in screen coordinates.
  • endpoint
    • Description:The second point in screen coordinates.
  • unitOfDistance
    • Description:The unit of return distance.

Pan(PanDirection,Int32)

  • Moves the map by the specified direction and percentage of the current extent.
Remarks
  • This method caculates the panning offset by the current extent and the percentage. If the percentage is 20, the panning offset in the X direction is CurrentExtent.Width* 0.2 and the offset in the Y direction is CurrentExtent.Hight*0.2.
Return Value
  • Type:Void
  • Description:N/A
Parameters
  • panDirection
    • Description:Up, Down, Left, Right, UpperRight, LowerRight, UpperLeft, LowerLeft.
  • percentage
    • Type:Int32
    • Description:The percentage of the current extent.

Pan(Single,Int32)

  • Moves the map by the specified angle and the percentage of the current extent.
Remarks
  • This method moves the map by the angle and the percentage that you specify.The angle starts from the east and increases counterclockwise. For example, angle 0 represents precisely east and angle 90 represents precisely north.The percentage specifies the offset related to the current extent. If the percentage is 20, the panning offset in the X direction is CurrentExtent.Width* 0.2 and the offset in the Y direction is CurrentExtent.Hight*0.2.
Return Value
  • Type:Void
  • Description:N/A
Parameters
  • degree
    • Type:Single
    • Description:The angle value that determines the panning direction.
  • percentage
    • Type:Int32
    • Description:The percentage of the current extent.

Fill(String)

  • N/A
Remarks
  • N/A
Return Value
  • Type:Void
  • Description:N/A
Parameters
  • entityString
    • Type:String
    • Description:N/A

Fill(String,String)

  • N/A
Remarks
  • N/A
Return Value
  • Type:Void
  • Description:N/A
Parameters
  • modelName
    • Type:String
    • Description:N/A
  • entityString
    • Type:String
    • Description:N/A

ToString(String)

  • N/A
Remarks
  • N/A
Return Value
  • Type:String
  • Description:N/A
Parameters
  • modelName
    • Type:String
    • Description:N/A

ToString()

  • N/A
Remarks
  • N/A
Return Value
  • Type:String
  • Description:N/A
Parameters

Equals(Object)

  • N/A
Remarks
  • N/A
Return Value
  • Type:Boolean
  • Description:N/A
Parameters
  • obj
    • Type:Object
    • Description:N/A

GetHashCode()

  • N/A
Remarks
  • N/A
Return Value
  • Type:Int32
  • Description:N/A
Parameters

GetType()

  • N/A
Remarks
  • N/A
Return Value
  • Type:Type
  • Description:N/A
Parameters

Protected Methods

LoadState()

  • Restores the control information from a persistent object the was saved by the SaveState method.
Remarks
  • N/A
Return Value
  • Type:Void
  • Description:N/A
Parameters

PreRender()

  • Does the preparation before sending the Mvc control to the provided HtmlWriter of the ViewContext.
Remarks
  • This method notifies the Mvc control to perform any necessary prerendering steps prior to rendering content and save state.
Return Value
  • Type:Void
  • Description:N/A
Parameters

Render(HtmlTextWriter)

  • Sends the Mvc control content to a provided HtmlTextWriter object, which wirtes the content to be rendered on the client.
Remarks
  • When developing a custom server control, you can override this method to generate conteol for a page.
Return Value
  • Type:Void
  • Description:N/A
Parameters
  • htmlTextWriter
    • Type:HtmlTextWriter
    • Description:The HtmlTextWriter object that receives the Mvc control content.

SaveState()

  • Saves any necessary information of the Mvc control, which will be used in some other places.
Remarks
  • N/A
Return Value
  • Type:Void
  • Description:N/A
Parameters

Finalize()

  • N/A
Remarks
  • N/A
Return Value
  • Type:Void
  • Description:N/A
Parameters

MemberwiseClone()

  • N/A
Remarks
  • N/A
Return Value
  • Type:Object
  • Description:N/A
Parameters

Public Properties

GeoCanvas

N/A

Remarks

N/A

Return Value

ZoomLevelSet

Gets or sets the ZoomLevelSet applied to the map.

Remarks

N/A

Return Value

MapBackground

Gets or sets the BackgroundLayer object that paints the map background.

Remarks

This property determines the background of the map. The map will use the brush defined on this BackgroundLayer to paint the background.

Return Value

ContextMenu

Gets or sets the shortcut menu associated with the map.

Remarks

N/A

Return Value

CurrentExtent

Gets or sets the current extent of the map.

Remarks

N/A

Return Value

Cursor

Gets or sets the cursor that appears when the mouse pointer is over the map control.

Remarks

N/A

Return Value

WebConfigRegisterMode

Gets or sets a value that indicates whether the application allows map to register the Web.config on the fly in runtime. The default value is “WebConfigRegisterMode.AutoRegistered”, otherwise, you need to copy the code below to the web.config manually. … …

Remarks

N/A

Return Value

ResourceDeploymentMode

Gets or sets a value that indicates whether the application allows map to copy its resource images under “~/theme/default/img/” and a css file “~/theme/default/style.css”. The default value is “ResourceDeploymentMode.Automatically”, otherwise, you need to copy images to the directory.

Remarks

N/A

Return Value

MapUnit

Gets or sets the GeographyUnit for the map.

Remarks

N/A

Return Value

ActiveBaseOverlay

Gets or sets the active base overlay.

Remarks

The map can contain multiple base overlays, though only one of them can be displayed at a time. The ActiveBaseOverlay property specifies the one that is currently displayed. When you switch the base overlays in the OverlaySwitcher, the currently selected overlay will be synchronized to this property after postback.

Return Value

IsDefaultJavascriptLibraryDisabled

Gets or sets whether the default javascript library is disabled or not.

Remarks

N/A

Return Value
  • Type:Boolean

BackgroundOverlay

Gets or sets an Overlay object that displays as the background map by default.

Remarks

The background overlay is one of the base overlays of the map. It can only be the base overlay. If you set a non-base overlay to it, there will be an exception thrown. The background overlay is the active base overlay by default, if you do not set the ActiveBaseOverlay property.

Return Value

StaticOverlay

Gets a LayerOverlay object that displays as a background map.

Remarks

The StaticOverlay is a shortcut way for you to add a LayerOverlay to the map. It can only be the base overlay. It is not the active base overlay by default. You need to set it to the ActiveBaseOverlay property in order to display it.

Return Value

DynamicOverlay

Gets a LayerOverlay object that can overlap other overlays.

Remarks

N/A

Return Value

MarkerOverlay

Gets an InMemoryMarkerOverlay object that renders markers by the specified features.

Remarks

The MarkerOverlay overlaps on the base overlay and other non-base overlays. It displays markers based on the features you add to it. If you want to render markers by feature source, use the FeatureSourceMarkerOverlay and add it to the CustomOverlays collection.

Return Value

CustomOverlays

Gets an Overlay collection, into which you can add different types of overlays.

Remarks

You can create any type of Overlay object and add it to the CustomOverlays collection. The CustomOverlays collection will disable the BackgroundOverlay, StaticOverlay, DynamicOverlay and MarkerOverlay properties. This means you have two options for using overlays: Either set those overlay properties, or use the CustomOverlays collection. The CustomOverlays collection has higher priority and is more flexible. By contrast, the overlay properties act as shortcut way to use overlays.

Return Value

EditOverlay

Gets an EditOverlay object, with which you can draw and edit shapes at the client.

Remarks

N/A

Return Value

HighlightOverlay

Gets an HighlightFeatureOverlay object, which draws its features at the client side and can attach the specified click event and context menu to them.

Remarks

The HighlightOverlay actually serializes all its features to the client for drawing. These are client features whose styles changes when you mouse over them, thus generating the mouse-over highlight effect.Note: Performance may be slow when the features added to the HighlightOverlay contain many vertices, because serializing and drawing these features at the client side may take some time.

Return Value

AdornmentOverlay

This property gets or sets the adornment overlay in the MapControl.

Remarks

N/A

Return Value

MapTools

Gets an object that contains all types of map controls for configuration.

Remarks

N/A

Return Value

WidthInPixels

Get the actual width, in pixels, of the map control.

Remarks

When you set your map's width with percentage values (for example, 100%), you might want to know the actual pixel width of your map at a given time. This property returns the map's pixel width as determined by the browser.Note: When the map width is a percent value, the WidthInPixels is double.NaN only until a postback generates. When the page postbacks, the actual width of the map will be synchronized to this property.

Return Value
  • Type:Double

HeightInPixels

Get the actual height, in pixels, of the map control.

Remarks

When you set your map's height with percentage values (for example, 100%), you might want to know the actual pixel height of your map at a given time. This property returns the map's pixel height as determined by the browser.Note: When the map height is a percent value, the HeightInPixels is double.NaN only until a postback generates. When the page postbacks, the actual height of the map will be synchronized to this property.

Return Value
  • Type:Double

OnClientDrawEnd

Gets or sets the client-side script that executes whenever a feature is drawn at the client.

Remarks

The OnClientDrawEnd property holds the Javascript function that will be executed whenever you finish drawing a shape. The Javascript function takes one parameter, which is the feature that you just drew. You can use this parameter to add extra data to the feature (add to feature.fieldValues). You can then retrieve that extra data from the feature's ColumnValues collection after postback.

Return Value
  • Type:String

OnClientEditEnd

Gets or sets the client-side script that executes whenever you finish editing a shape at the client.

Remarks

The OnClientEditEnd property holds the Javascript function that will be executed whenever you finish editing a shape. The Javascript function takes one parameter, which is the feature that you just edited. You can use this parameter to edit the extra data of the feature (feature.fieldValues). You can then retrieve that extra data from the feature's ColumnValues collection after postback.

Return Value
  • Type:String

OnClientClick

Gets or sets the client-side script that executes when you click on the map.

Remarks

There is a default parameter:e, which includes one parameter: “worldXY”

Return Value
  • Type:String

OnClientDoubleClick

Gets or sets the client-side script that executes when you double-click on the map.

Remarks

There is a default parameter:e, which includes one parameter: “worldXY”

Return Value
  • Type:String

OnClientExtentChanged

Gets or sets the client-side script that executes when the map extent changes.

Remarks

There is a default parameter: e, which includes two parameters, “extent”, “scale”

Return Value
  • Type:String

OnClientBaseOverlayChanged

Gets or sets the client-side script that executes when the current base overlay changes in the OverlaySwitcher.

Remarks

There is a default parameter: e, which includes a parameter “baseLayer” which is the name of the layer

Return Value
  • Type:String

OnClientTrackShapeFinished

Gets or sets the client-side script that executes after tracking the shape.

Remarks

There is a default parameter: e, which represents the editing geometry in json format

Return Value
  • Type:String

OnClientPopupsRequesting

N/A

Remarks

N/A

Return Value
  • Type:String

OnClientPopupsRequested

N/A

Remarks

N/A

Return Value
  • Type:String

Popups

Gets a Popup collection that holds all of the popups in the map.

Remarks

N/A

Return Value

RestrictedExtent

Gets or sets an extent that limits the area to which the map can be navigated within.

Remarks

N/A

Return Value

CurrentScale

Gets or sets a double value that indicates the current scale of the map.

Remarks

N/A

Return Value
  • Type:Double

CustomCursorUri

Gets and sets a custom cursor image URI for the mouse cursor to use when you select 'CursorType.Custom'.

Remarks

N/A

Return Value
  • Type:Uri

Id

N/A

Remarks

N/A

Return Value
  • Type:String

Name

N/A

Remarks

N/A

Return Value
  • Type:String

Width

N/A

Remarks

N/A

Return Value
  • Type:Unit

Height

N/A

Remarks

N/A

Return Value
  • Type:Unit

Visible

N/A

Remarks

N/A

Return Value
  • Type:Boolean

HtmlAttributes

N/A

Remarks

N/A

Return Value
  • Type:Dictionary<String,String>

ClientScriptFileNames

N/A

Remarks

N/A

Return Value
  • Type:Dictionary<String,String>

ClientScriptBlocks

N/A

Remarks

N/A

Return Value
  • Type:Dictionary<String,String>

StyleSheetFileNames

N/A

Remarks

N/A

Return Value
  • Type:Collection<String>

ViewContext

N/A

Remarks

N/A

Return Value
  • Type:ViewContext

Protected Properties

ClientResolutions

Gets the resolution collection corresponding to the specified ZoomLevelSets applied to the map.

Remarks

N/A

Return Value
  • Type:Collection<Double>

MaxExtent

N/A

Remarks

N/A

Return Value

PageRootPath

Gets a string value indicats the web page's root path for loading the default icons.

Remarks

N/A

Return Value
  • Type:String

ChY=

N/A

Remarks

N/A

Return Value

UniqueControlName

Gets current page's name.

Remarks

N/A

Return Value
  • Type:String

CenterX

Gets or sets a double value for center X of current viewport.

Remarks

N/A

Return Value
  • Type:Double

CenterY

Gets or sets a double value for center Y of current viewport.

Remarks

N/A

Return Value
  • Type:Double

DRY=

N/A

Remarks

N/A

Return Value
  • Type:Int32

ClientScriptManager

N/A

Remarks

N/A

Return Value

ClientStyleSheetManager

N/A

Remarks

N/A

Return Value

Public Events

thinkgeo.mapsuite.mvcedition.map.txt · Last modified: 2017/03/16 21:59 (external edit)