This is a migrated thread and some comments may be shown as answers.

Is there a way to just show one country

2 Answers 201 Views
Map
This is a migrated thread and some comments may be shown as answers.
Erich
Top achievements
Rank 1
Erich asked on 15 Jul 2015, 09:34 AM

Hi!

 

I'm using openstreetmap as provider and I am currently showing a map of Europe with map items for every customer.

Now I want to provide the functionality, that the user can choose to view only a single country, for example just germany.

My current solution is, that on button click I center my location on germany and choose a zoom level to see the whole country. Furthermore I don't show the customer Items of the other countries.

But I'm not happy with that solution. Is it possible to just show the german map and hide all the other countries?

Thanks in advance

Erich

2 Answers, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 20 Jul 2015, 08:04 AM
Hi Erich,

RadMap's OpenStreetMapProvider doesn't support the described functionality. Actually, the OpenStreetMap services returns rectangle tiles with images of the map which means that you cannot get a picture with a clip of a country or an area. A possible solution for your scenario is to use a VisualizationLayer and draw the blank space around the country that you want to display. You can take a look at the City Demographics demo which demonstrates such visualization. You can use similar approach as the one in the example.
  • You can use a tool to create shape files with the countries that you wan't to display. Or you can get and modify the files demonstrated in the Shapefile Maps Gallery section in the RadMap demos. Then you can set a solid color shape that covers the entire map and set a clip to the shape with the boundaries of the country.
  • Or, you can search if the OpenStreetMap developer API expose a service that returns the boundaries of an area and use it to get the bounds, and draw them using map shapes.

Please let me know if this information is useful.

Regards,
Martin
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Erich
Top achievements
Rank 1
answered on 22 Jul 2015, 08:36 AM

Thanks for the answer!

 

This solution is too time-consuming. I guess I will just stay with my current solution.

 

Regards,

Erich

Tags
Map
Asked by
Erich
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Erich
Top achievements
Rank 1
Share this question
or