Getting tiles for plugin usage
Jiri Vlasak
jiri.hubacek at gmail.com
Fri Nov 1 14:51:25 UTC 2019
On Sun, Oct 20, 2019 at 12:54:40PM +0200, Dirk Stöcker wrote:
> On Thu, 17 Oct 2019, Jiri Vlasak wrote:
>
> > there was Missing Maps hackathon this weekend in Pilsen, Czech Republic. One of
> > the tasks we were working on was click building feature [1] -- building plot
> > based on mouse click to the middle of the building.
> >
> > I am interested in getting background imagery in effective way. Currently, the
> > following steps are used:
> > 1. Mouse listener knows the coordinates.
> > 2. Coordinates are recomputed to TileXY.
> > 3. New tiles around the mouse click are created in array (9 of them).
> > 4. Based on Tile URL, Images are downloaded and used for algorithm.
> >
> > I feel like downloading Tiles multiple times is not effective.
>
> I'd recommend the meachnism already included in JOSM, e.g. the Tile loader
> classes which also do caching.
That's good point. I would like to use that, but I am lost in how does it work.
Can you point me to the right direction, please?
I feel like I miss something basic. I am able to get the current ImageryLayer
but not the image. And the methods I think could work for me (like
`getVisibleTileSet()`) are usually private.
Thanks,
jiri
More information about the josm-dev
mailing list