Background color
In my application I've a requirement that user can change the color of sea and ground using a menu.
When i load ENC or GEOTIFF, loadlayer returns single layer, how can i change two different background color in single layer and how can i identify a sea part or ground part in single layer.
When i load ENC or GEOTIFF, loadlayer returns single layer, how can i change two different background color in single layer and how can i identify a sea part or ground part in single layer.
Comments
-
Since an ENC file is a vector file, you can change the color/drawing style of features with the normal vector style functions (like GM_SetAreaFeatureDrawStyle for areas). Just iterate through the features in a layer and change the fill color for the ocean/land areas as needed.
For a GeoTIFF file the situation is different. Will your GeoTIFF files be palette-based? If so there is a way in the Global Mapper application to modify the palette used for a file so you could easily change one color to another. This functionality could be added to the SDK as well without too much difficulty. If it's not palette-based, then there really isn't a way to replace one color with another. You would have to create a custom in-memory raster layer copied from the loaded GeoTIFF using the GM_CreateCustomRasterLayer function, then you could modify your in-memory copies of the colors and draw from that.
Let me know if I can be of further assistance.
Thanks,
Mike
Global Mapper Support
support@globalmapper.com -
Thanks Mike, but how can i identify that the feature is land or sea in ENC layer while iterating.
-
You can call GM_GetAreaFeature to get the feature information, including classification and attribute values, then examine that information to determine if it is a feature that you want to modify.
Let me know if I can be of further assistance.
Thanks,
Mike
Global Mapper Support
support@globalmapper.com
Categories
- 12.7K All Categories
- 5.6K Features Discussion
- 342 Downloading Imagery
- 1.3K Elevation Data
- 380 Georeferencing Imagery Discussion
- 628 GM Script Language
- 53 User Scripts
- 113 GPS Features
- 414 Projection Questions
- 819 Raster Data
- 1.3K Vector Data
- 6.6K Support
- 177 Announcement and News
- 908 Bug Report
- 558 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 562 Other Discussion
- 129 GIS Data Sources
- 27 Global Mapper Showcase
- 233 How I use Global Mapper
- 107 Global Mapper Forum Website