|
How to Build Map Enabled Applications in ASP.NET? |
Posted by angle on Aug-25-2006 10:29 |
|
How to Build Map Enabled Applications in ASP.NET? Do chartdirector support it? |
Re: How to Build Map Enabled Applications in ASP.NET? |
Posted by Peter Kwan on Aug-26-2006 03:07 |
|
Hi angle,
I assume by "Map" enabled application, you mean some sort of "geographic map", and you want to change the colors of some regions or put some numbers or charts on some positions.
Many of our customers are using ChartDirector to create charts that have geographic maps. However, ChartDirector does not automatically draw the maps. You need to prepare the maps in advance, and use it as the background image of the drawing surface.
ChartDirector can be used to:
(a) Put things (such as numbers, symbols, charts) on given locations on the map.
(b) Change the color of a region in a map (using flood fill)
If you need further help, may be you may clarify in more details what you need to do, so I may try to see if it is possible with ChartDirector.
Regards
Peter Kwan
wrote:
> How to Build Map Enabled Applications in ASP.NET? Do chartdirector support it? |
Re: How to Build Map Enabled Applications in ASP.NET? |
Posted by angle on Aug-27-2006 12:27 |
|
Yes, I mean some sort of "geographic map", and I want to change the colors of some regions, put some numbers or charts on some positions or zoom in/out the map etc.,create interactive maps likes Google map(http://www.google.com/apis/maps/).
I am new with Chartdirector, I make reports with Active Report (http://www.datadynamics.com)and Chartdirector,the two are both good, one lists datas and one draws charts.
Could you show me some codes or give me some projects of creating interactive maps with ChartDirector?Thanks advanced.
Thanks for reply! |
Re: How to Build Map Enabled Applications in ASP.NET? |
Posted by Peter Kwan on Aug-28-2006 09:16 |
|
Hi angle,
I think google map is a huge database or pre-drawn maps fragments or various magnifications, and a front-end that grabs the correct fragments and display it on the web page, together with a geographic information database that can be used to locate, label and decorate the map objects.
ChartDirector may help you in the last step - label and decorate the map objects. The other steps (display the map at various magnification level and the geographic information database, etc) may need to be achieved with your own code (if you are trying to do a simple map), or you may need to obtain any system for geographic information.
I have attached a simple example for your reference. The example uses a US map. It just colors a state, and put some text on a state.
Hope this can help.
Regards
Peter Kwan
|
Re: How to Build Map Enabled Applications in ASP.NET? |
Posted by angle on Aug-29-2006 08:56 |
|
Thanks! |
Re: How to Build Map Enabled Applications in ASP.NET? |
Posted by mbe on May-11-2011 01:35 |
|
The example given paints the given state but others do not,
For example,
c.getDrawArea().fill(56, 91, 0xff9999);
c.addText(56, 91, "Oregon").setAlignment(Chart.Center);
the above causes not only Oregon to get shaded but the entire border area and some other states.
Is there a problem with the PNG file? of the getDrawArea function? |
Re: How to Build Map Enabled Applications in ASP.NET? |
Posted by Peter Kwan on May-12-2011 01:01 |
|
Hi mbe,
The problem is due to the incorrect png. The ChartDirector fill function appears to be correct.
The "usmap.png" in this thread is just use to provide an example on how the fill function work. The "usmap.png" may or may not accurately reflect the United States or may not be correct. It is expected in your real code, you would use your own map that matches the region you want to show in the chart. If you happen want to show the US in the chart, you would still need to prepare a correct map for your usage.
When I try your code, I see the same issue. When I look at the map closely, I found that the border around Oregon is missing a pixel, and that causes the problem. (In a correct map, the border of Oregon should enclose Oregon.) The "map1.png" shows Oregon in the map magnified. You can see there is a missing pixel at the top left corner of Oregon.
If you put the pixel back, then fill code works normally for Oregon. I have attached another usmap.png with the missing pixel corrected (a also corrected a few other missing pixels), but we still have not tested the usmap.png comprehensively and verify its correctness. So I suggest you to prepare a map that you know is accurate.
Hope this can help.
Regards
Peter Kwan
|
Re: How to Build Map Enabled Applications in ASP.NET? |
Posted by mbe on May-12-2011 01:09 |
|
Hi Peter,
Great, that makes sense, and thanks for the better map.
Also, is there a way to make the states click-able? |
Re: How to Build Map Enabled Applications in ASP.NET? |
Posted by Peter Kwan on May-12-2011 02:03 |
|
Hi mbe,
Because the map is just a static image, you can make it clickable by using many common graphics editor to generate the image map (eg. google for "Photoshop image map" to see how to use Photoshop to create image maps). I believe there are also many free online tools available that can generate image maps for static images.
Hope this can help.
Regards
Peter Kwan |
|