Map Class |
Namespace: Telogis.GeoBase
The Map type exposes the following members.
Name | Description | |
---|---|---|
Map |
Create with default size, center and zoom level.
| |
Map(LatLon, Int32, Int32, Double) |
Create a map with the given parameters.
|
Name | Description | |
---|---|---|
Busy |
Indicates if this Map is busy processing an asynchronous map request.
| |
Center |
Gets or sets the current center point of the map.
| |
CenterPixelOffset | ||
DisplayScale |
Gets or sets the scale of map overlay objects (such as labels, shields, direction arrows, and highlights) relative to the underlying map tiles.
| |
Heading |
Gets or sets the heading of the map.
| |
Layers |
Gets or sets an array of map layer names. These layers are rendered in accordance with the LayersRenderMode property.
| |
LayersRenderMode |
Gets or sets the render mode used to render the map's Layers.
| |
MapQuality |
Gets or sets the quality at which this Map will be rendered.
| |
MapRepository |
Gets or sets the Repository used to render the map.
| |
MapScale |
Gets the scale of the map.
| |
MaxZoom |
Gets the maximum zoom value of this map.
| |
MinSizeToBrand | ||
MinZoom |
Gets the minimum zoom value of this map.
| |
PaddingSize |
Gets or sets the number of additional pixels to load on each side of the map as
padding.
| |
Perspective |
Gets or sets the perspective of this map. See MapPerspective.
| |
PixelSizeMeters |
Gets the number of meters each pixel of the map represents.
| |
PixelSizeMiles |
Gets the number of miles each pixel of the map represents.
| |
Projected |
Gets or sets whether this map is projected (curved) or not.
| |
ProjectionCentre |
Represents the center of the map projection. By default this value is null and the center is always the center of the visible map area.
| |
Renderer |
An IMapRenderer that will be called when the map is rendered.
| |
RenderLabels |
Controls whether labels are rendered on the map.
| |
Satellite |
Gets or sets whether the map is rendered using satellite imagery.
| |
SatelliteLayerName |
The name of the map layer that will be used to provide satellite imagery. If
specified then the imagery will be taken from the appropriate WMS layer in the
GeoStream's layers.config file. Otherwise, standard GeoBase satellite imagery
will be used.
| |
Size |
Gets or sets the map size in pixels.
| |
StickyLabels |
Gets or sets whether map labels are sticky.
| |
Style |
Gets or sets the MapStyle used to draw the map. Set this value to null to use the
default map style.
| |
StyleName |
Gets or sets the name of the style used to draw the map. Set this value to null to use
the default map style.
| |
TilePerSuperTile |
Gets or sets the number of tiles per supertile.
| |
TileSize |
Gets or sets the size of a tile.
| |
TimeStatistics |
For internal use only.
| |
Warnings |
Gets all local Warnings associated with this map.
| |
Zoom |
Gets or sets the zoom height of the map.
| |
ZoomLevel |
This defines the current zoom level. This differs from Zoom, in that
ZoomLevel is expressed in terms of the array of Zooms; ZoomLevel is an index into the array.
| |
Zooms |
Defines the set of zoom levels to use.
|
Name | Description | |
---|---|---|
CancelAsync |
Cancels a pending asynchronous map request, if there is one.
| |
Contains |
Check whether the map contains the given LatLon.
| |
Dispose |
Disposes of this Map.
| |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
GetBoundingBox |
Gets the BoundingBox of the Map.
| |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetMap | ||
GetMap(Boolean, MapProgress, Boolean) | ||
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
LatLontoXY |
Convert from a LatLon to an X,Y location on the map.
| |
SetProperty |
Sets internal map parameters.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
XYtoBoundingBox |
Gets the BoundingBox of two pixel locations, x1,y1 and x2,y2
| |
XYtoLatLon |
Convert from map X,Y co-ordinates to a LatLon.
| |
ZoomToBoundingBox(BoundingBox, Int32) |
Zooms and centers the map to the given BoundingBox.
| |
ZoomToBoundingBox(BoundingBox, MapBuffer) |
Zooms and centers the map to the given BoundingBox.
|
Name | Description | |
---|---|---|
CenterChanged |
This event handler is called when the map is panned so that the center point changes.
| |
PropertyChanged |
This event handler is called when a map property is changed.
| |
SizeChanged |
This event handler is called when the size of the map (in pixels) changes.
| |
ZoomChanged |
This event handler is called when the zoom level of the map changes.
|
Map classes can also be used to translate from X, Y points to LatLon for panning and zooming operations.
A Map object is not a lightweight object. Operations on the map are swift but the object has a memory footprint proportional to the size of the image to be generated. Therefore, we recommend that you use the pattern below when dealing with maps in a transient fashion.
Also note that the Image returned by GetMap will be disposed when the Map object is disposed. To work around this, copy the Bitmap object as demonstrated in the snippet below.
Related articles: Map Concept.
Image toKeep; using (Map map = new Map(center, width, height, zoom)) { toKeep = new Bitmap(map.GetMap()); // toKeep is a copy, so will not be disposed. ... Image transient = map.GetMap(); // This image will be disposed when this block exits. }
// -- Create a map and adjust the zoom level with a mouse scroll wheel // Create a 400px x 300px Map object in California with a zoom value of 3 Telogis.GeoBase.Map myMap = new Telogis.GeoBase.Map(new LatLon(33.694165, -117.956236), 400, 300, 3); // Create a PictureBox to display the map on the Form PictureBox myPictureBox = new PictureBox(); public Form1() { InitializeComponent(); // Set the PictureBox size myPictureBox.Size = new System.Drawing.Size(400, 300); // Set the PictureBox image to the Map image myPictureBox.Image = myMap.GetMap(); // Add the PictureBox to the form Controls.Add(myPictureBox); myPictureBox.Select(); // Create a mouse wheel event myPictureBox.MouseWheel += new MouseEventHandler(_MouseWheel); } void _MouseWheel(object sender, MouseEventArgs e) { if (e.Delta != 0) { double zoomVal = myMap.Zoom; if (e.Delta <= 0) { // Zoom map out myMap.Zoom = zoomVal + 1; } else { // Zoom map in myMap.Zoom = zoomVal - 1; } // Update the picturebox image myPictureBox.Image = myMap.GetMap(); } }