Select Polygon per mouse click, queryByPoint? -- using C# MapScript

Zhonghai Wang zhonghaiw at GMAIL.COM
Fri Aug 25 09:34:39 EDT 2006


Hi Tamas,

thank you very much for your solution, this works well.

Cheers

Zhonghai


On 8/22/06, Tamas Szekeres <szekerest at gmail.com> wrote:
>
> Hi Zhonghai,
>
> I suggest the following steps to be implemented.
>
> 1. Obtain the bounding rectangle of the resulted shape (shapeObj.bounds)
> 2. Transform the rectangle from the layer coordinates to the map
> coordinates (shapeObj.project)
> 3. Apply a linear transformation to transform the rectangangle into
> the image coordinates.
> 4. mapObj.zoomRectangle
>
> Tamas
>
>
> 2006/8/22, Zhonghai Wang <zhonghaiw at gmail.com>:
> >
> > Hi guys,
> >
> > I have one case here to select a polygon per mouse click, I just wonder
> if
> > someone has ever done something like this. The Situation is:
> >
> > I have one layer, which contains several polygons, for example, a map
> layer
> > contains all the states of a country, if the user click one of the
> polygon
> > region, the map will be zoomed to this polygon region with a proper map
> > scale, it means that this region will be highlighted and be zoomed to
> the
> > whole map window.
> >
> > Is it possible?
> >
> > I've tried with queryByPoint, but it's not possible to set the buffer,
> since
> > the size of each polygon region differs.
> >
> > thanks for any information.
> >
> >
> > Zhonghai
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20060825/b2715e4a/attachment.html


More information about the mapserver-users mailing list