- 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.
Setting the background color of map.
- Oliver Heilig
- Posts: 160
- Joined: Tue May 13, 2014 12:10 pm
- Location: Karlsruhe, Germany
- Contact:
Re: Setting the background color of map.
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
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
Oliver Heilig
Chief Developer Logistic Services
PTV GROUP - Germany
https://github.com/oliverheilig/
Chief Developer Logistic Services
PTV GROUP - Germany
https://github.com/oliverheilig/
- Bernd Welter
- Site Admin
- Posts: 2703
- Joined: Mon Apr 14, 2014 10:28 am
- Contact:
Re: Setting the background color of map.
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...
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...
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...