From: Jody G. <jod...@gm...> - 2011-05-09 03:42:42
|
lol; these are all very common questions :-) let me try and answer... On Monday, 9 May 2011 at 1:15 PM, mounir younes wrote: I am willing to use the ExternalGraphicsFactory to draw building icons on my map (format png) can someone help in this task and provide me with the appropriate code? I checked the user list and there is no example on how to use it ! That is because you do not need ExternalGraphicsFactory to do this work; PNG is supported out of the box: See the example here (search for png on that page): - http://docs.geotools.org/latest/userguide/library/render/style.htmlr > And I have a second question. What is the best way to simulate a car moving on a map? I need to change its position. I tell you what is not a great way; making a feature collection with your single point and then updating each second as and asking the map to redraw. We get a person here every other week trying this out; and complaining that gt-renderer is slow. There is a flyingsaucers demo you can review; but the real answer is to set up a second raster to draw your moving car into; and draw that over top of the map rendered by gt-renderer. Remember that JMapPane is just a demo showing how you can use StreamingRenderer to draw into a BufferedImage. You can do the same thing in your own code; and have one buffered image for the map and a second one for your "overlays" including the moving car. > One more question. Does anyone know a good 2D renderer ? because the gt-renderer flickers a lot, how could this be solved? It is more how you use it :-) The GeoTools renderer is doing a lot of calculation and data access; not what you want in the middle of animation. Remember gt-renderer is not loading your data into memory; just drawing from disk each time. You can experiment with loading your data into memory (specifically into a spatial index) if you want faster performance out of it. Reference: - http://docs.geotools.org/latest/userguide/library/main/collection.html#performance-options Jody |