levels in Shapefiles

Stephen Woodbridge woodbri at SWOODBRIDGE.COM
Tue Apr 19 17:36:47 PDT 2005


The way you would accomplish this is have the user click on the map and
have mapserver do a query based on the click. You can Query multiple
layers so if yo query the state layer then you will know about which
state was clicked on and if you query the city layer you will know what
city was clicked on or if NO city was clicked on.

You can then get the extents of the city shape that was returned in the
query and use that information to zoom the map to that city.

1) setup your mapfile to support queries
2) get the click coordinates
3) query the layer(s)
4) get the extents of the city
5) set the extents of the map to the city extents
6) redraw your map

-Steve W.
  http://imaptools.com

Giridhar Manepalli wrote:
> Hello,
> Anyone there to answer my question? :-(
>
> I am currently trying few options with php/mapscript to embed in my
> application later on.
>
> Say that I have a shapefile for a state with the geometry being
> polygon. The polygons inside this shapefile each represent a city
> (say). I have also got the shapefiles for each of the city. Now, if I
> click on any part of the region inside a city on the main shapefile,
> how can I load the shapefile corresponding to the city on which I
> clicked.
>
> Is there any standard way to achieve this? Did anyone have an idea
> which they think is the standard way?
>
> I appreciate any help in this regard.
>
> Thanks and Regards,
> Giridhar
> p.s Currenly I am using ESRI shapefiles. Is any other geometrical
> data( for eg Tiger Dataset) more appropriate to do this. What is
> google doing for this?(Just curious)
>



More information about the MapServer-users mailing list