Is there a way to just show one country

3 posts, 0 answers
  1. Erich
    Erich avatar
    10 posts
    Member since:
    Dec 2014

    Posted 15 Jul 2015 Link to this post



    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


  2. Martin
    Martin avatar
    1048 posts

    Posted 20 Jul 2015 Link to this post

    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.

    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
  3. DevCraft banner
  4. Erich
    Erich avatar
    10 posts
    Member since:
    Dec 2014

    Posted 22 Jul 2015 in reply to Martin Link to this post

    Thanks for the answer!


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




Back to Top