10 Answers, 1 is accepted
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
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
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
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
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
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
[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
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
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
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