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

Map and polyline

10 Answers 123 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Stefania
Top achievements
Rank 2
Stefania asked on 22 Feb 2016, 01:28 PM

Hi,

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

As the attached file

Thank you

10 Answers, 1 is accepted

Sort by
0
Ivan Hristov
Telerik team
answered on 23 Feb 2016, 09:11 AM
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
0
Stefania
Top achievements
Rank 2
answered on 23 Feb 2016, 05:25 PM

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

0
Accepted
Ivan Hristov
Telerik team
answered on 24 Feb 2016, 10:20 AM
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
0
Stefania
Top achievements
Rank 2
answered on 24 Feb 2016, 01:39 PM

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

0
Stefania
Top achievements
Rank 2
answered on 24 Feb 2016, 03:38 PM

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?
0
Ivan Hristov
Telerik team
answered on 25 Feb 2016, 09:59 AM
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
0
Stefania
Top achievements
Rank 2
answered on 25 Feb 2016, 02:24 PM

[quote]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.[/quote]

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

Thank you

0
Ivan Hristov
Telerik team
answered on 26 Feb 2016, 09:18 AM
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
0
Stefania
Top achievements
Rank 2
answered on 29 Feb 2016, 12:16 PM

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

0
Ivan Hristov
Telerik team
answered on 01 Mar 2016, 08:22 AM
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
Tags
General Discussions
Asked by
Stefania
Top achievements
Rank 2
Answers by
Ivan Hristov
Telerik team
Stefania
Top achievements
Rank 2
Share this question
or