Map and polyline

11 posts, 1 answers
  1. Stefania
    Stefania avatar
    107 posts
    Member since:
    May 2013

    Posted 22 Feb Link to this post

    Hi,

    is it possible to create a map on a report and connect the points with a line?

    As the attached file

    Thank you
  2. Ivan Hristov
    Admin
    Ivan Hristov avatar
    85 posts

    Posted 23 Feb Link to this post

    Hi Stefania,

    The purpose of the map and choropleth items is to visualize the provided data over a map extent. However, you can use the choropleth item to draw some custom polygons on the map surface without providing data for the polygon coloring. All you need to do is to provide the data for your polygons in WKT/WKB format and use it to create a ShapeMapSeries.

    You can take a look at the following documentation articles for more information:

        How to: Setup a Choropleth Using the Map Wizard
        How to: Add ShapeMapSeries to the Map Item

    We also created a sample .trdx report, based on the example image you've provided. We hope you will find it useful.

    Regards,
    Ivan Hristov
    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
  3. DevCraft banner
  4. Stefania
    Stefania avatar
    107 posts
    Member since:
    May 2013

    Posted 23 Feb in reply to Ivan Hristov Link to this post

    Thank you!

    One more question. I did just like in your demo and now i'm trying to populate the csv dinamically

    I have a main objectdatasource on my report with a string field populated like this:

    "LocationName;ColorValue;WKT
    Karabatan;1;POLYGON((52.273595 47.279598, 52.291427 47.258292, 52.320688 47.266826, 52.332296 47.265185, 52.344629 47.268467, 52.393479 47.267318, 52.445715 47.248279, 52.456839 47.250084, 52.462401 47.242861, 52.506618 47.247257, 52.518665 47.214493))"

    On the Bindings Property map I added DataSource and into the expression I put my field =Fields.MapPoints

    On DataSource I put the CsvDataSource

     

    I have the following error

    An error has occurred while processing Map 'map2':
    The expression contains object 'WKT' that is not defined in the current context

  5. Answer
    Ivan Hristov
    Admin
    Ivan Hristov avatar
    85 posts

    Posted 24 Feb Link to this post

    Hi Stefania,

    Since you're setting the map's data source using Bindings, there is no use to set the map's DataSource, because it wont be taken into consideration. That's why the approach you are using - passing a CSV string as a data source - won't work.

    We don't have enough information about your scenario, but it makes sense to use Bindings to set the nested item's data source if you provide more than one value to be bound. In this case you should create a new class (i.e. WKTData), which consists of three properties: LocationName, ColorValue and WKT and replace the string field you are using with a populated instance of that class. Then you could use this WKTData instance as a data source for your map.

    However, if your scenario includes only one polygon per row, you can add the WKT data as a string field in your main data source and bind the ShapeMapSeries to that field.

    We have prepared another example that shows how to implement the solution suggested above. We hope that it will point you in the right direction.

    Regards,
    Ivan Hristov
    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
  6. Stefania
    Stefania avatar
    107 posts
    Member since:
    May 2013

    Posted 24 Feb Link to this post

    Thank you, it works perfectly!

    Is it also possible to mark the first and the last point on the map, as the image that I posted before?

    Thank you

  7. Stefania
    Stefania avatar
    107 posts
    Member since:
    May 2013

    Posted 24 Feb Link to this post

    When I try to publish the website I have the following error

    An error has occurred while processing Map 'map1':
    Access to the path 'C:\ProgramData\Telerik\Reporting' is denied

    Why is it trying to find Telerik.Reporting.GenericTileProvider.cache on my pc?
  8. Ivan Hristov
    Admin
    Ivan Hristov avatar
    85 posts

    Posted 25 Feb Link to this post

    Hi Stefania,

    We're glad that the proposed solutions work for you. To your additional questions:

    - You can use the PointMapSeries class if you want to draw markers on the same map surface. You should include the coordinates of the points in your data source as additional fields, because the PointMapSeries won't work with the WKT string used to draw the polygons.

    - In the "ProgramData\Telerik'Reporting" folder we store map related information for faster access. You need to give the appropriate rights to the user that runs the website. Depending on the IIS version you're using this might be the NETWORK SERVICE or IUSR account.

    Hope it helps.

    Regards,
    Ivan Hristov
    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
  9. Stefania
    Stefania avatar
    107 posts
    Member since:
    May 2013

    Posted 25 Feb Link to this post

    In the "ProgramData\Telerik'Reporting" folder we store map related information for faster access. You need to give the appropriate rights to the user that runs the website. Depending on the IIS version you're using this might be the NETWORK SERVICE or IUSR account.

    Can I change it on the web.config? I can't access to the IIS on the hosting panel

    Thank you

  10. Ivan Hristov
    Admin
    Ivan Hristov avatar
    85 posts

    Posted 26 Feb Link to this post

    Hello Stefania,

    Currently the folder location cannot be changed. We will consider making the location path configurable for a future release of our product, but for now your solution would be to provide the necessary permissions to the IIS user.

    Regards,
    Ivan Hristov
    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
  11. Stefania
    Stefania avatar
    107 posts
    Member since:
    May 2013

    Posted 29 Feb Link to this post

    Ok thank you.

    So I need a different approach.. How about google map inside a report? Maybe in a HtmlTextBox?

    If so can you post an example? Thank you

  12. Ivan Hristov
    Admin
    Ivan Hristov avatar
    85 posts

    Posted 01 Mar Link to this post

    Hello Stefania,

    If you are unable to give the IIS user the required permissions to access the ProgramData\Telerik\Reporting folder, then you can render the map using an application of your choice and show the image using a PictureBox item.

    Hope it helps.

    Regards,
    Ivan Hristov
    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
Back to Top
DevCraft banner