Marker causes change in view
balachanthiran opened this issue · 3 comments
balachanthiran commented
I have the code below that runs once i onCreate()
tileView = findViewById(R.id.tileview);
new TileView.Builder(tileView)
.setSize(5000, 20000)
.defineZoomLevel("tiles/tile-%d-%d.jpg")
.defineZoomLevel(1, "tileszoom1/tile-%d-%d.jpg")
.defineZoomLevel(2, "tileszoom2/tile-%d-%d.jpg")
.installPlugin(new MarkerPlugin(getApplicationContext()))
.build();
markerPlugin = (MarkerPlugin) tileView.getPlugin(MarkerPlugin.class);
marker = new ImageView(getApplicationContext());
marker.setImageResource(R.drawable.marker);
I then a have a method that runs every second and gives me a new x,y coordinate. In this method remove the existing marker and then add a new marker:
markerPlugin.removeViewInLayout(marker);
markerPlugin.addMarker(marker, x, y, 0, 0, 0, 0);
But each time a new marker is added the view changes to the upper left corner. Do you have any idea why?
moagrius commented
What you have looks fine at first glance. Can you post your project somewhere public and I'll try to take a look?
thib-rdr commented
Hi ! I'm having the same exact problem, would it be possible to know if this has been fixed ?
@balachanthiran
Thanks
balachanthiran commented
Hi,
I could not fix it. I ended up using another library:
https://github.com/davemorrissey/subsampling-scale-image-view
This works much easier.