Hi,
I need to know regarding Drill Down Feature, by drilling down I mean, user can dig into map starting from country to states and then to city and from city to county. If so, how do I do that?
Any help will be truly apprciated.
Hi,
I need to know regarding Drill Down Feature, by drilling down I mean, user can dig into map starting from country to states and then to city and from city to county. If so, how do I do that?
Any help will be truly apprciated.
Muhammad,
Do you mean Zooming in? It’s very simple to navigate the map. You can pan by dragging the map, zoom in by double-clicking, track zoom in by drawing a rectangle with your left mouse button mouse while holding the shift key, or zoom in and out by using the mouse wheel. Have a try!
Thanks,
Ben
Hi,
I am looking for source code having drill down enabled feature. Like in the first view all states of US are displayed, if I click on Texas. a new shape file of Texas ONLY will be loaded and will display all the counties. Similary when I click on County all cities within that County will be displayed, I want repeat that process to ZipCode Level.
Below is heirarchy that I want to achieve.
Country-->State-->County-->city-->ZipCode.
Please let me know if this is possible.
Hi Muhammand,
The following information may lead you to satisfy your scenario.
1. Zoom to feature you clicked.
We have an online sample for it, please see it at:
websamples.thinkgeo.com/webe...ature.aspx
2. Add a click event on the map.
The sample above also contains this feature.
3. Add/remove shape files on the fly.
It’s the same as adding a new ShapeFile in the event.
When I think more about your scenario, how about zoomout? If they zoomout; for example, we zoomin to a county just now then zoomout, the county will be smaller and smaller without any other counties; some times the whole map becomes blank with a spot. It’s just my suspicion though. May be you can disabled the default mouse navigation at some specific area.
If you have any questions please let me know.
Thanks,
Howard
Thanks Howard, I understand the loop hole you found in my requirment. how about displaying PIE chart on US STATES, if I click on a state and zoom it. What will happen to PIE chart for that state? actually, at that point I want to display PIE chart of each County.
your Point 3, appeals to me, but How can I change a shape file runtime by clicking on a shape?
Thanks again for the reply.
Burhan-
Muhammad,
You are welcome.
We also have an online sample for the PIE chart, please have a look at it and you may have a better understanding of it.
websamples.thinkgeo.com/webe...Style.aspx
ZedGraphStyle is implemented by a third part Dll; please see the warning box on the upper left of the sample first to make sure put the Dll to the right place.
Also, to change a shape file at runtime in an event is very simple; the only thing you need to do is remove the old one simply just like remove an item in a collection, and then add the new shape file just like you did in the PageLoad.
If you have more queries please let me know.
Thanks,
Howard
PERFECT!
Thank you, here is how I did that.
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
Map1.MapBackground.BackgroundBrush = new GeoSolidBrush(GeoColor.FromHtml("#B3C6D4"));
Map1.CurrentExtent = new RectangleShape(-140, 60, 140, -60);
Map1.MapUnit = GeographyUnit.DecimalDegree;
Map1.MapTools.OverlaySwitcher.Enabled = true;
ShapeFileFeatureLayer worldLayer = new ShapeFileFeatureLayer(MapPath("~/SampleData/World/cntry02.shp"));
worldLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.CreateSimpleAreaStyle(GeoColor.FromArgb(255, 243, 239, 228), GeoColor.FromArgb(255, 218, 193, 163), 1);
worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
Map1.StaticOverlay.Layers.Add("WorldLayer", worldLayer);
InMemoryFeatureLayer highLithLayer = new InMemoryFeatureLayer();
highLithLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.CreateSimpleAreaStyle(GeoColor.FromArgb(100, 60, 180, 60), GeoColor.GeographicColors.DeepOcean);
highLithLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
Map1.DynamicOverlay.Layers.Add("HighLightLayer", highLithLayer);
}
}
protected void Map1_Click(object sender, MapClickedEventArgs e)
{
Map1.StaticOverlay.Layers.Remove("WorldLayer");
ShapeFileFeatureLayer worldLayer = new ShapeFileFeatureLayer(MapPath("~/SampleData/World/zt02_d00.shp"));
worldLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.CreateSimpleAreaStyle(GeoColor.FromArgb(255, 243, 239, 228), GeoColor.FromArgb(255, 218, 193, 163), 1);
worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
Map1.StaticOverlay.Layers.Add("WorldLayer", worldLayer);
Map1.StaticOverlay.Redraw();
}
Hi Muhammad,
Thanks for sharing your code.
Please feel free to let me know if you need any assistance.
Thanks,
Howard