Page 1 of 1

Setting the background color of map.

Posted: Tue Jan 10, 2017 5:12 am
by webdirekt
- We have specific polygon colored in the light blue color.( ColoredRegion.png )
- We have collection of points in database for that colored region.
- We want to color the whole region outside the colored polygon as gray.

Re: Setting the background color of map.

Posted: Wed May 17, 2017 12:23 pm
by Oliver Heilig
Hello webdirekt,

sorry for the late answer, but this is a tricky one. Of course you can set the opacity of the basemap layers to reduce the background, or you can draw a semi-opaque rectangle on-top of the basemap-layers.

But if you really want to highlight a distinct polygon against the background, you have to draw the "inverted polygon" in a different colour. This a bit complex, as you need to use topology operations, together with a custom canvas for the mapControl, as the standard MapPolygon of the Control cannot render this inverted polyon.

Here are the lines that show this practice.

https://github.com/ptv-logistics/xserve ... #L100-L117

You can download the code at the repository https://github.com/ptv-logistics/xservernet-bin

Regards
Oliver

Re: Setting the background color of map.

Posted: Wed May 17, 2017 3:40 pm
by Bernd Welter
Proposal from my side:
How about describing the use case requirement so Oliver could give a technical approach? E.g. "we want to create a map where a user can recognize the reachable customers".
Your request is already focused on a specific technical approach...