I know what you mean - it is a problem I have not solved yet for uDig. We need to kind of consider what rules were used to render the image; in order to get the resulting hit area. My own approach that I think would be needed is to handle it in a similar manner to the label cache; run all graphics through a data structure (in order to prevent collisions) and use the same data structure to do the click lookup.
If your graphics are all the same size (this is usual) create your query using the correct size when looking for the feature that was clicked on. Example - rendering points with 16x16 graphics. When the user clicks use screen2world on a pixel at (x-7,y-7) to (x+7,y+7). This would give you the bounds used to query your data set ... taking into account the size of the graphics. Jody On 24/09/2009, at 4:47 AM, iceDice wrote: > > Thanks Michael, > > What about SLD and his way of styling data. Is it somehow possible > to get width and height of graphic symbol in pixels on map? > Say that we have .png image and that we define <sld:Size>100</ > sld:Size> > to that image. Is it possible to know graphic height and width in > pixels > from > that information? > I need that because i want to catch mouse events when user enters > and exits > that graphic symbol and show some pop-up window with informations on > mouse > entered. > > Best regards. > > > > That helps me much. > What i need to know in every moment are SCREEN coordinates of external > graphic (which is used in SLD), depending on current map scale. I > need to > get bounding box around external graphic in screen coordinates > depending on > map scale. This is because external graphic object is of different > size for > different > map scales. > What i have are world coordinates of center for every point. I am > curious is > it > possible to get screen coordinates from world coordinates and > current map > scale? > Also when we specify size of external graphic in SLD with > <sld:Size></sld:Size> is > it possible to get graphic height and width in pixels from it? > > mbedward wrote: >> >>> What i have are world coordinates of center for every point. I am >>> curious >>> is >>> it >>> possible to get screen coordinates from world coordinates and >>> current map >>> scale? >> >> mapFrame.getMapPane().getWorldToScreenTransform() is your friend >> >> Michael >> >> ------------------------------------------------------------------------------ >> Come build with us! The BlackBerry® Developer Conference in SF, >> CA >> is the only developer event you need to attend this year. Jumpstart >> your >> developing skills, take BlackBerry mobile applications to market >> and stay >> ahead of the curve. Join us from November 9-12, 2009. Register >> now! >> http://p.sf.net/sfu/devconf >> _______________________________________________ >> Geotools-gt2-users mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users >> >> > > -- > View this message in context: > http://n2.nabble.com/ExternalGraphic-GetBoundingBox-tp3698425p3701620.html > Sent from the geotools-gt2-users mailing list archive at Nabble.com. > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry® Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart > your > developing skills, take BlackBerry mobile applications to market and > stay > ahead of the curve. Join us from November 9-12, 2009. Register > now! > http://p.sf.net/sfu/devconf > _______________________________________________ > Geotools-gt2-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users ------------------------------------------------------------------------------ Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ Geotools-gt2-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
