Map Suite Desktop Edition Layers & FeatureSources Samples
From ThinkGeo Wiki
| Rate This Article | |
|---|---|
| Current rating: 0% (0 votes)
You need to enable Javascript to vote
|
Build Custom Shapefile Indexes
| Screenshot | Sample | Product | Description |
|---|---|---|---|
| C# Download Need it in another language? | Services Applies To: Desktop Web Silverlight Services Wpf | This sample shows how you can display a subset of a shapefile without splitting the physical shapefile. For example, you may have a single shapefile that contains both highways and local roads. To improve display speed, you may be temped to split it into two separate shapefiles so you can quickly display local roads with one style and highways with another style (and avoid using a value style, which can be slow). But at this project demonstrates, rather than split your shapefile you can simply build two custom indexes, one for each road type. Then, when you create your ShapeFileFeatureLayer, you'll simply use your original shapefile and specify a custom index. Each custom index will limit the records that can be seen by the Layer, making it very fast and efficient. For more information and a real-world example, please see the Map Suite discussion forum post at: Forum Post |
Combining Overlays
| Screenshot | Sample | Product | Description |
|---|---|---|---|
| C# Download Need it in another language? | Wpf Applies To: Desktop Web Silverlight Wpf | In today’s Wpf project, we show a technique of using a common FeatureSource for two different Overlays. From a physical shapefile representing cities, a regular LayerOverlay is used for the higher zoom levels while a FeatureSourceMarkerOverlay is used for the lower zoom levels. FeatureSourceMarkerOverlay is a Wpf specific overlay offering features for a better user experience such a Tooltips and ImageSource. |
Compass
| Screenshot | Sample | Product | Description |
|---|---|---|---|
| C# Download Need it in another language? | Services Applies To: Desktop Web Silverlight Services Wpf | In the project “North Arrow”, you saw how to extend AdornmentLayer to create a North Arrow AdormentLayer. In this project, we expand on that idea and create a more sophisticated class. You will see how you can combine two images to create a compass. Compare to “North Arrow” project, we also added some other handy properties such as a Position property. Also, the compass can be of varied sizes thanks to the SizePercentage property. Finally, if you pass just one image, the compass can behave just like a regular north arrow. We also added new designs of compass in smaller version. See the attached file: Rotating Compass New Smaller Designs.zip |
Create GRID
| Screenshot | Sample | Product | Description |
|---|---|---|---|
| C# Download Need it in another language? | Desktop Applies To: Desktop Web Silverlight Services Wpf | Today’s sample shows the new feature available in this may release Map Suite 5 for creating GRID files. A GRID is a raster format that defines a geographic space as an array of equally sized squares (cells) arranged in rows and columns. Each cell stores a numeric value that represents an attribute (such as elevation, surface slope, soil pH etc.) for that unit of space. Each GRID cell is referenced by its x, y coordinate location. Typically a GRID file is created based on some sample points with known values. In today’s sample, we take the example of creating a GRID file based on a point based shapefile representing soil pH values of some sample locations in a field. Using the Inverse Weighted Distance algorithm for interpolation, we create the GRID with the pH value for the entire extent of the field. Look at the code and comments for more details on how GRID files get generated and displayed on the map. This sample is a Desktop application but GRID can be used in all the editions of Map Suite. |
Edit Attribute Of Shapefile
| Screenshot | Sample | Product | Description |
|---|---|---|---|
| C# Download Need it in another language? | Wpf Applies To: Desktop Web Silverlight Services Wpf | The purpose of this Wpf sample is to show how to edit the attribute of a feature of a shapefile. This sample is useful for anyone wanting to actualize the attribute part of its data by simply clicking on the desired feature on the map and updating its attribute in a textbox. You will find the editing part of the code in the KeyDown event of the textbox. |
Edit Geometry Of Shapefile
| Screenshot | Sample | Product | Description |
|---|---|---|---|
| C# Download Need it in another language? | Desktop Applies To: Desktop Web Silverlight Services Wpf | The purpose of this sample is to show how to update the geometry of a feature of a shapefile in one step. This sample is useful for anyone wanting to actualize the geometry part of its data. You can see how only a few lines of code are necessary for this process and that the spatial index gets automatically updated after calling the committing the change. Notice that this sample does not show all the fanciness for manipulating at user interaction the geometry to be updated. For this purpose, you can see all the samples related to TrackInteractiveOverlay and EditInteractiveOverlay. |
Get Data From Server With WCF
| Screenshot | Sample | Product | Description |
|---|---|---|---|
| C# Download Need it in another language? | Silverlight Applies To: Desktop Web Silverlight Services Wpf | In this Silverlight-based project, we are going to take a look at how to get geometry data from the server side using the WCF service with Map Suite Silverlight Edition, while keeping all map data on the server side. You can click any of the countries on the map to call a WCF service, which will require data from the server, and then a popup will appear with information about that country. |
Graphic Logo Adornment Layer
| Screenshot | Sample | Product | Description |
|---|---|---|---|
| C# Download Need it in another language? | Desktop Applies To: Desktop Services Wpf | This sample shows how you can display your logo on the map using an AdornmentLayer. The advantage of using an Adornment is that the graphic stays in place and doesn't move as you pan your map. The sample should work for various kinds of logos and allow you to change the position using the AdornmentLayer's properties. |
Heat Map
| Screenshot | Sample | Product | Description |
|---|---|---|---|
| C# Download Need it in another language? | Desktop Applies To: Desktop Web Silverlight Services Wpf | Heat maps is a technique increasingly used in various fields such in biology and other fields. See http://en.wikipedia.org/wiki/Heat_map. They are also used for displaying areas of webs page most frequently scanned by users. http://csscreme.com/heat-maps/. At ThinkGeo, we are taking this concept to GIS and applying it to geographic maps. Heat maps are a great way to give the users a visually compelling representation of the distribution and intensity of geographic phenomenon. |
Heat Map with earthquakes
| Screenshot | Sample | Product | Description |
|---|---|---|---|
| C# Download Need it in another language? | Desktop Applies To: Desktop Web Silverlight Services Wpf | After the project on displaying swine flu data using the heat map technique, here you learn how to apply parameters other than strictly spatial distribution to affect the coloring of the map. In this example, the magnitude of each earthquake (from 0 to 12) is taken into account to influence the displaying of the heat map. The result is California appearing even more intense than if only the spatial distribution were taken into account. |
Highlight at Mouse Hover
| Screenshot | Sample | Product | Description |
|---|---|---|---|
| C# Download Need it in another language? | WPF Applies To: Desktop Services Wpf | In this WPF project, we show you how to highlight a feature when the user hovers the mouse pointer over it. This effect can be realized in Map Suite by using a timer and doing some spatial querying based on the location of the mouse pointer. This sample works with area-based features but the same could be accomplished with point- or line-based features simply by using different spatial queries. |
Image Stream Loading
| Screenshot | Sample | Product | Description |
|---|---|---|---|
| C# Download Need it in another language? | Desktop Applies To: Desktop Web Silverlight Services Wpf | As an alternative to loading an Image with the image file from the file system, you can choose to pass your own stream. This project shows you how to use the event StreamLoading of GdiPlusRasterSource for this purpose. In this project, we show how to do this using a Tiff image but you can also use that event for ShapeFileFeatureSource as we show in a previous project “Shapefile Encryption”. Keep in mind that this technique only works with images besides MrSid, ECW and Jpeg2000. These types of images do not work because the providers do not support streams in their decoding SDKs. |
Isolines
| Screenshot | Sample | Product | Description |
|---|---|---|---|
| C# WPF Download C# WinForms Download Need it in another language? | Services Applies To: Desktop Web Silverlight Services Wpf | In this sample we show how you can use Map Suite to add isolines (commonly known as contour lines) to your .NET application. Isolines are a way to visualize breaks between different groups of data such as elevation levels, soil properties, or just about anything else you can imagine. This sample also shows the various steps in creating isolines, including the gathering of point data, creating a grid using interpolation, and finally, picking your isoline break levels. We also quickly dive into some more advanced options such as generating isolines on the fly.
To bring this all together, check out our Please note that you will need version 5.0.87.0 or newer of Map Suite in order to use isolines. For more information on how to upgrade, see the Map Suite Daily Builds Guide. |
KML Extension
| Screenshot | Sample | Product | Description |
|---|---|---|---|
| C# Download Need it in another language? | Desktop Applies To: Desktop Services Wpf | KML is the file format for displaying geographic data in a Google Earth browser such as Google Earth. Now, you can also display such a file on a Map Suite control. Thanks to its flexible architecture to extent to new file formats, in today’s project we wrote the logic for supporting KML. Look at the class KmlfeatureSource inheriting from FeatureSource to see how the logic for reading FML files was implemented. As well, you can see the class KmlStyle inheriting from Style for the drawing logic. And feel free to modify and improve those classes with your own implementations. |
Latitude Longitude Graticule
| Screenshot | Sample | Product | Description |
|---|---|---|---|
| C# Download Need it in another language? | Desktop Applies To: Desktop Web Silverlight Services Wpf | After the projects on North Arrow and Compass, we created another project related to Adornment Layer to have a more stylish map and give more information to the user navigating the map. In this project, we create a Graticule Adorment Layer that shows Meridians and Parallels displaying through the map. Meridians are lines of longitude and they have a North South orientation. Parallels are lines of latitude and they have an East West orientation.
Showing graticule for latitude and longitude is a standard way in cartography to give spatial references to the users. |
MapShapes
| Screenshot | Sample | Product | Description |
|---|---|---|---|
| C# Download Need it in another language? | Services Applies To: Desktop Web Silverlight Services Wpf | One of the most requested features left out of Map Suite 3.0 is MapShapes. For those who are not familiar with MapShapes, in Map Suite 2.0 they were a group of self-contained features that had their own styles, projection and column data. This meant that each one could be unique; however, this also meant you had to specify all of the attributes about each single MapShape. In working with customers using MapShapes for a number of years, we found a common pattern. First, users tried MapShapes by adding one to the screen. This was very simple and got them up and running fast. They next added a few more as they started to build more of their application. After a short amount of time they realized that it was cumbersome to set the projection, styles, zoom levels, etc. on so many MapShapes, especially since the MapShapes often represented the same kind of underlying feature, like a fire hydrant or road block. The problem was that there was no good solution with Map Suite 2.0 to handle lots of very similar dynamic features. |
Mini Map Adornment Layer
| Screenshot | Sample | Product | Description |
|---|---|---|---|
| C# Download Need it in another language? | Services Applies To: Desktop Web Silverlight Services Wpf | This project shows how to create a simple mini map to give a reference of where you are when you zoomed in. As for WaterMarkAdornmentLayer, the MiniMapAdormentLayer inherits from AdornmentLay. |
Multi Geo Raster Layer
| Screenshot | Sample | Product | Description |
|---|---|---|---|
| C# Download Need it in another language? | Services Applies To: Desktop Web Silverlight Services Wpf | MapSuite API has RasterLayer from which inherits MrSIDRasterLayer and ECWRasterLayer etc. If we have many raster files, we would need to add all the raster files as separate layer. However this has a performance issue. In this project, we show how to create a class MultiGeoRasterLayer that treats all the raster file as one layer. This class show how to do that using JPEG images with its associating JGW world file. It speeds up the loading of a large number of Raster layers by loading and drawing on demand only the files in the current extent. It loads a reference file that contains the bounding box, path and file information for all of the Raster files. We load this information into an in-memory spatial index. When the map requests to draw the layer, we find the Rasters that are in the current extent, create a layer on-the-fly, call their Draw method and then close them. In this way, we load on demand only the files that are in the current extent. |
Multi Index
| Screenshot | Sample | Product | Description |
|---|---|---|---|
| C# Download Need it in another language? | Services Applies To: Desktop Web Silverlight Services Wpf | Today our purpose is to gather into one concise project all the different knowledge we learned about multi index in various Discussion Forum posts such as:
http://gis.thinkgeo.com/Support/DiscussionForums/tabid/143/aff/21/aft/5921/afv/topic/Default.aspx |
Native TAB File Suppport
| Screenshot | Sample | Product | Description |
|---|---|---|---|
| C# Download Need it in another language? | Desktop Applies To: Desktop Web Silverlight Services Wpf | One of the most exciting new features in MapSuite 5.0 is native TAB file support. In the past, the FDO extension was used for displaying TAB files in MapSuite. Now with the new TabFeatureLayer, we have a simpler and more stable method of working with TAB files.
This Code Community project demonstrates how to load and display a TAB file using the new TabFeatureLayer. The example also allows you to add, edit and delete features from the TAB file. |
North Arrow
| Screenshot | Sample | Product | Description |
|---|---|---|---|
| C# Download Need it in another language? | Services Applies To: Destop Web Silverlight Services Wpf | This project demonstrates basically two techniques; How to rotate a map and how to have a North Arrow keeping the right north orientation.
Rotating the map: To rotate the map, you have to be aware that you have to use RotationProjection class provided by MapSuite API. All the layers need to have their projection property set to RotationProjection. Beware that if a Layer does not have that property set, it will not rotate along with the rest of the map. Displaying the North Arrow: As the map rotate, it is important to keep track of the orientation of the map and to know what the direction to the North is. Inheriting from Adornment Layer, RotatingAdornmentLayer class takes an Image representing a North Arrow and with its RotateAngle property set according to the angle property of RotationProjection, it always shows the North correctly.
|
Numbered Grid
| Screenshot | Sample | Product | Description |
|---|---|---|---|
| C# Download Need it in another language? | Desktop Applies To: Desktop Web Silverlight Services Wpf | In many atlases, you can see maps with a numbered grid to give the page reference for a more detailed map. In today’s project, we show how to construct such a grid. Based on the extent of the feature, the number of columns and rows, a grid can be created with the page number in each cell. |
Oledb Point FeatureSource
| Screenshot | Sample | Product | Description |
|---|---|---|---|
| C# Download Need it in another language? | Services Applies To: Desktop Web Silverlight Services Wpf | This project shows the power of MapSuite by giving to the developer the possibility to create its own layer based on an existing format containing spatial information. If the developer is familiar with a certain format like oledb, he can create its own FeatureSource reading the database and its own FeatureLayer wrapping the FeatureSource and providing the drawing logic. In this project, we create the class OledbPointFeatureSource inheriting from FeatureSource and OledbPointFeatureLayer inheriting from FeatureSource. |
Scale Bar
| Screenshot | Sample | Product | Description |
|---|---|---|---|
| C# Download Need it in another language? | Services Applies To: Desktop Web Silverlight Services Wpf | Map Suite already offers classes such as ScaleBarAdornmentLayer for displaying scale bars on the map but they are limited to certain common units like meters, kilometers, feet and miles. In this project, you are going to learn the basics for creating a scale bar using the unit of your choice. The class CustomUnitScaleBar displays a very simple scale bar but you will find the logic for basics of creating a scale bar. Looking at the code, you will be able to create more sophisticated stylish scale bars for your own needs. |
Shapefile Encryption
| Screenshot | Sample | Product | Description |
|---|---|---|---|
| C# Download Need it in another language? | Desktop Applies To: Desktop Web Silverlight Services Wpf | In today’s project, we are looking at a way to encrypt shapefiles to prevent them from being used outside the application. We show how to encrypt and decrypt shapefiles using streams. You will see that a very simple encryption algorithm is used but by looking at the example, you will be able to implement your own. Disclaimer: This encryption system can be used only on small shapefiles due to the amount of memory used. A typical use would be to encrypt some valuable small shapefiles you don't want your users to access. In the future, Map Suite will provide a full encryption system as an API. |
Styles with InMemoryFeatureLayer
| Screenshot | Sample | Product | Description |
|---|---|---|---|
| C# Download Need it in another language? | Services Applies To: Desktop Web Silverlight Services Wpf | In this WPF project, we show how to build an InMemoryFeatureLayer from a text file. You'll notice how the columns are set up so that styles can be used as if the InMemoryFeatureLayer were a static layer such as a Shapefile. Here, we apply a Class Breask Style and a Text Style to our InMemoryFeatureLayer. What we learn in this sample can be applied to all the different editions of Map Suite. |
Swince Flu
| Screenshot | Sample | Product | Description |
|---|---|---|---|
| C# Download Need it in another language? | Services Applies To: Desktop Web Silverlight Services Wpf | In today’s project is going to apply some of the techniques we learned in the previous projects to some swine flu data available on the web.
On the web site
http://www.mapcruzin.com/free-download-h1n1-swine-flu-arcgis-shapefile.htm, it is possible to download point based shapefiles of swine flu occurrences in the world. While this information is valuable, it is a little difficult to display it at world level. At high zoom levels, all the points are on top of each other making the map very difficult to read and get overall information of the swine flu situation at the world level as you can see in the image with the map of the upper left. |
Watermark Adornment Layer
| Screenshot | Sample | Product | Description |
|---|---|---|---|
| C# Download Need it in another language? | Services Applies To: Desktop Web Silverlight Services Wpf | This project shows how to create a WaterMarkAdornmentLayer class inheriting from AdormentLayer. Notice that in the overridden method DrawCore, the drawing is done using screen coordinates. This is a characteristic of Adornment Layer and any layer inheriting from it. In this example, the code in the DrawCore method places the water mark text at regular interval but you could easily modify the code to have the water mark text placed randomly on the map. Notice that WaterMarkAdornmentLayer is added to the StaticLayers collection of the MapEngine meaning that you can place this adornment layer on top of all the other layers or between any other layers. This class is useful for providing demos to clients. |
Zedgraph
| Screenshot | Sample | Product | Description |
|---|---|---|---|
| C# Download Need it in another language? | Services Applies To: Desktop Web Silverlight Services Wpf | In our “How Do I” apps, there is sample app that shows how to add graphs to the map using the ZedGraph library. In this project, using the same data, the US cities, we elaborate a little bit on the pie chart. You will see how to add some gradient colors to the chart, how to label the different pie slices, how to add a title etc. Zedgraph is a truly massive library for graphics and Pie chart is only one type of chart among many others. As you can add pie charts to your map, you can also add bar charts, trend charts etc. I suggest you check out this site for more info on ZedGraph http://zedgraph.org/wiki/index.php?title=Main_Page |
