From: alwynn <alw...@ep...> - 2009-03-10 13:56:56
|
Michael, thanks for your quick reply and moving my question to this forum. Is this implementation of JMapPane applicable if I'm using a 'country' map and not a world map? I did have a look at the code in trunk and I can't see no reason why not. To get the latest jmappane library, does that mean I need to update my pom.xml to reference the gt-mappane 2.6-SNAPSHOT or do I download the source and recompile it [hope not]. Currently I'm using 2.5-RC1 which obviously does have the newest jmappane code. I'm new to maven...might be a stupid question though. It took me a while to rid some oracle nosuchmethoderrors after messing around with my pom.xml library versions so I'm just a bit cautious here :). Most of my library dependancies are gt xxx 2.5.2 Thank you alwynn mbedward wrote: > > Hi Alwynn, > > I'm moving your question across to the users list. > > Take a look at the new JMapPane code on trunk. Specifically the > JMapPaneMouseEvent class... > http://svn.osgeo.org/geotools/trunk/modules/unsupported/mappane/src/main/java/org/geotools/gui/swing/event/JMapPaneMouseEvent.java > > ...which gets an AffineTransform from the > JMapPane.getScreenToWorldTransform() method to do the coord > conversion. > http://svn.osgeo.org/geotools/trunk/modules/unsupported/mappane/src/main/java/org/geotools/gui/swing/JMapPane.java > > Hope this helps, > Michael > > 2009/3/10 alwynn <alw...@ep...>: >> >> Hi >> >> I'm building and displaying a map in a JMapPane from data retreived from >> oracle spatial(country boundaries). >> The map contains a feature collection (layer) of coordinates [points]. >> The >> feature collection was created not from spatial data but a plain jdbc >> query >> to oracle to retrieve the long/lats and then adding it to a Feature >> Collection. This works and looks very cool. >> >> I've added a mouse listener on the jmappane that should do the following >> on >> click: >> determine which feature was clicked. Does anyone know how to convert the >> x,y >> point clicked relative to frame (The result of MouseEvent e .... >> e.getPoint) >> to a coordinate contained in my Feature collection? >> Any ideas? >> >> Thank you >> -- >> View this message in context: >> http://n2.nabble.com/pixel-to-coordinate-conversion-tp2454400p2454400.html >> Sent from the geotools-devel mailing list archive at Nabble.com. >> >> >> ------------------------------------------------------------------------------ >> _______________________________________________ >> Geotools-devel mailing list >> Geo...@li... >> https://lists.sourceforge.net/lists/listinfo/geotools-devel >> > > ------------------------------------------------------------------------------ > _______________________________________________ > Geotools-gt2-users mailing list > Geo...@li... > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users > > -- View this message in context: http://n2.nabble.com/Re%3A--Geotools-devel--pixel-to-coordinate-conversion-tp2454855p2455210.html Sent from the geotools-gt2-users mailing list archive at Nabble.com. |