Have questions? Call us toll-free at 1-866-847-7510 (outside North America, call 1-785-727-4133)

Map Suite Services Edition Zooming Panning Moving Samples

From ThinkGeo Wiki

Jump to: navigation, search

Contents

Center Map Based On Lat/Long

Screenshot Sample Product Description
Map Suite Services Edition Sample Center Map Based On LatLong.jpg C# Download

Need it in another language?
Web

Applies To: Desktop
Web
Silverlight
Services
Wpf
In today’s web project, we show how to have the map centered and zoomed in according to some maximum and minimum longitude and latitude values. Doing this on a map using decimal degrees is a pretty straightforward operation but if you want to do this on a map displaying Google Map or other providers such as Virtual Earth, it requires some handling of projection. In this project, we show a concrete case, where Google Map is set to an extent corresponding to Florida according to the maximum and minimum longitude and latitude values.

Centering and Rotating

Screenshot Sample Product Description
Map Suite Services Edition Sample Centering and Rotating.jpg C# Download

Need it in another language?
Services

Applies To: Desktop
Web
Silverlight
Services
Wpf
In the project “Centering On Moving Vehicle”, we learned how to have the map always centered on a moving vehicle. In this project, we go one step further and show how to have the map also rotating according to the direction of the moving vehicle. In this project, you will also see how to use the CompassAdornmentLayer that always indicates the north as the map rotates.

Centering Map with Tolerance

Screenshot Sample Product Description
Map Suite Services Edition Sample Centering Map with Tolerance.jpg C# Download

Need it in another language?
Desktop

Applies To: Desktop
Web
Silverlight
Services
Wpf
In the previous project, we showed how to center the map on a moving vehicle. While this is great, it has the disadvantage of having to refresh the map each time the vehicle changes position. In this project, we respond to this inconvenience by using a set tolerance used for determining if the map needs to be refreshed or not. If the vehicle moves within a rectangle of a certain size located in the center of the current extent of the map, the map will not refresh and only the moving vehicle will. If it moves outside the tolerance area, the entire map will be refreshed and the tolerance recalculated.

Centering On Moving Vehicle

Screenshot Sample Product Description
Map Suite Services Edition Sample Centering On Moving Vehicle.jpg C# Download

Need it in another language?
Services

Applies To: Desktop
Web
Silverlight
Services
Wpf
A commonly requested feature when tracking a vehicle for GPS application is to have the map centered on a vehicle as it moves. Implementing this is fairly easy with Map suite using the CenterAt API. In this project, you will see this feature in action with a vehicle represented by a vehicle icon being always the center of the extent of the map. You can also take advantage of this project to learn some other techniques related to GPS such as reading GPS data from a text file and applying a rotation angle to show the direction.

Custom Zoom Levels

Screenshot Sample Product Description
No screenshot.jpg C# Download

Need it in another language?
Services

Applies To: Desktop
Web
Silverlight
Services
Wpf
In the project, “Zoom Levels Partitioning”, we showed how to partition the existing predefined zoom levels to have a finer level of control on how to display layers based on scale. In today’s project, we show how to set your own ten zoom levels based on a reference scale, each zoom level being half in scale of the previous one. So, in this case, we limit the number of zoom levels to ten instead of the twenty predefined ones.

GetZoomLevel

Screenshot Sample Product Description
Map Suite Services Edition Sample Get ZoomLevel.jpg C# Download

Need it in another language?
Desktop

Applies To: Desktop
Web
Silverlight
Services
Wpf
In today’s project, we are going to show how to get the zoom level of the map each time we change its extent. Using custom zoom levels, you will see how to get the zoom level with its characteristics such as the upper and lower scale defining it. You can read the comments inside the project to better understand the relationship of scales with zoom levels.

Map Scales

Screenshot Sample Product Description
Map Suite Services Edition Sample Map Scales.jpg C# Download

Need it in another language?
Desktop

Applies To: Desktop
Web
Silverlight
Services
Wpf
With Map Suite, you can both set and get the scale of your map. In this project, we show some tricks on how to manipulate a scroll bar that allows setting the map at a scale from 1:1,000 to 1:40,000,000. We also show how to use a text box to set the map to the exact desired scale.

This project is also an opportunity to review the very basic concept of scale in GIS. The easiest way to think about scale is to think about a ratio between what you see on the screen and the real world. So, if the scale is 1: 10,000 it basically means that one centimeter (you can use any unit) on the screen represents 10,000 centimeters (or 100 meters) in the real world. Of course, there are some intricacies related to calculating the scale for a map according to the projection etc. But, if you think in that very simple way, you will have at least an idea what the scale represents for your maps.

Raster Layer with extent

Screenshot Sample Product Description
Picture Map Suite Samples Raster Layer With Extent.jpg C# Download

Need it in another language?
Desktop

Applies To: Desktop
Web
Silverlight
Services
Wpf
The purpose of this project is to show the alternate way to load a regular image layer such as tiff if you don’t have a world file but know the extent of the image in world coordinate. To accomplish that, you can use a RectangleShape. In this project, you will also find more info on the world file and what the different parameters mean.

Restricting Extent

Screenshot Sample Product Description
Map Suite Desktop Edtion Sample Restricting Extent.jpg C# Download

Need it in another language?
Desktop

Applies To: Desktop
Web
Silverlight
Services
Wpf
In this sample, we show some technique for restricting the users from navigating the map beyond a certain area of the map. For this type of behavior of the map, two types of restricted extents are combined, one for panning and another larger one for zooming out. You want to handle two restricted extents to allow the users to pan and still zoom out within the restricted area. Notice that all the logic for restricting zooming out or panning is handled in the CurrentExtentChanging event.

Zoom In To Feature

Screenshot Sample Product Description
Map Suite Services Edition Sample Zoom In To Feature.jpg C# Download

Need it in another language?
Web

Applies To: Desktop
Web
Silverlight
Services
Wpf
This sample is similar to the sample “Find The Feature The User Clicked On” of the How Do I apps of the Web Edition. Here instead of showing information of the selected feature, we have the feature highlighted and the extent of the map set to the bounding box of that feature. Just click on a country and the map will zoom in to it.

Zoom In To Point

Screenshot Sample Product Description
Map Suite Services Edition Sample Zoom In To Point.jpg C# Download

Need it in another language?
Desktop

Applies To: Desktop
Web
Silverlight
Services
Wpf
This project is for DesktopEdition users. As for the project TrackZoomInWithoutShiftKey, we show how to create a new class from InteractiveOverlay. InteractiveOverlay is a powerful way to interact with the map but it currently lacks documentation. While this project does not substitute a good documentation, it shows some techniques for using that class. You can take a look at the overriding method MouseDownCore to see how in a few lines of code, you can allow the users to have the map zoomed in and centered to the location the map was clicked on.

In the next major public release of Desktop Map Suite, we will present a more complete documentation on InteractiveOverlay.

Zoom Levels Partitioning

Screenshot Sample Product Description
No screenshot.jpg C# Download

Need it in another language?
Desktop

Applies To: Desktop
Web
Silverlight
Services
Wpf
Map Suite API conveniently offers 20 predefined zoom levels to set the different styles. With those 20 predefined zoom levels, at any change of extent, the map will snap to the nearest zoom level. While this is appropriate in most cases, you may want a more granular control on the zoom levels. This project shows how to set intermediate zoom levels between the existing predefined ones for more granularity. Since the zoom levels are based on scales, you can still use the predefined zoom levels to set the styles and have the additional custom zoom levels for more refined control on zoom level snapping. In this project, we have the WorldMapKit WMS as a layer and a regular point based shapefile. You can see how the intermediate custom zoom levels have the effect of stretching the WMS image to better fit.

This is a Desktop project and you will need the full or evaluation references to MapSuiteCore.dll, DesktopEdition.dll and WorldMapKitWms.dll.

Zoom to Full extent

Screenshot Sample Product Description
Map Suite Services Edition Sample Zoom To FullExtent WPF.jpg C# Download

Need it in another language?
Wpf

Applies To: Desktop
Web
Silverlight
Services
Wpf
Today we have the first project in the Map Suite WPF Desktop version. This is a simple project that shows how to set the current extent based on a collection of layers. You can use this technique for the common task of having the map set to the full extent. Instead of having to manually set the full extent, you can pass all the layers you want the full extent to be based on.

This project will be followed by many other WPF projects due to the increasing popularity of that Map Suite version.

Zoom to Full extent

Screenshot Sample Product Description
Map Suite Services Edition Sample Zoom To FullExtent Service.jpg C# Download

Need it in another language?
Services

Applies To: Desktop
Web
Silverlight
Services
Wpf
This project shows you how to set the current extent based on a collection of layers. You can use this technique for the common task of having the map set to the full extent. Instead of having to manually set the full extent, now you can pass all the layers you want the full extent to be based on.
Personal tools
Namespaces
Variants
Actions
Products
Data
Add Ons
Navigation
Toolbox
Learn More About Map Suite, Download a Free Trial, or Buy Now

GIS Developer Components for .NET
Map Suite Extensions & Add-Ons
Map Data Sets & Icons

Try Map Suite Free

Map Suite Online Store
sales@thinkgeo.com
1-866-847-7510 (Toll-Free)
1-785-727-4133 (Outside North America)

ThinkGeo LLC
2801 Network Blvd. Suite 215
Frisco, TX 75034
Map Suite Support Center