Setting the background color of map.

Within this forum we want to offer discussions all around our .NET based Map control including all .Net-language specific questions concerning calls of the xServer-API. Attention: xServer-relevant concepts can be found in further forums such as xRoute or xTour.
Post Reply
User avatar
webdirekt
Posts: 28
Joined: Wed Jul 15, 2015 10:18 am

Setting the background color of map.

Post 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.
Attachments
Image of colored region polygon on map.
Image of colored region polygon on map.
User avatar
Oliver Heilig
Posts: 160
Joined: Tue May 13, 2014 12:10 pm
Location: Karlsruhe, Germany
Contact:

Re: Setting the background color of map.

Post 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
Attachments
InvertedDonut.png
Oliver Heilig
Chief Developer Logistic Services
PTV GROUP - Germany

https://github.com/oliverheilig/
User avatar
Bernd Welter
Site Admin
Posts: 2703
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: Setting the background color of map.

Post 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...
Bernd Welter
Technical Partner Manager Developer Components
PTV Logistics - Germany

Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning... :twisted:
Post Reply