xiwi1573 / osmdroid

Automatically exported from code.google.com/p/osmdroid
0 stars 0 forks source link

Add pinch to zoom detection support within mapView #468

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. pinch to zoom on a mapView with overlay items (images displayed)
2. icons are rescaled accordingly to pinch to zoom move, which is kinda uggly 
on big zoom
3.

What is the expected output? What do you see instead?
I think it's better to hide icons while zooming

What version of the product are you using? On what operating system?
I am on 3.0.11-snapshot (trunk)

Please provide any additional information below.

I attached a patch for mapView (add a simple function isPinching()), then if 
the behaviour does not suit to the needs, just add a call to isPinching in your 
custom draw method, such as :

@Override
  public synchronized void drawSafe(ISafeCanvas canvas, MapView mapView,
      boolean shadow) {
    //do not refresh as long as mapView is animating,
    //avoid marker icon to scale while zooming
    if (mapView.isAnimating() || mapView.isPinching()){
      return;
    }
    super.drawSafe(canvas, mapView, shadow);
  }

Original issue reported on code.google.com by waeselyn...@gmail.com on 21 Aug 2013 at 1:40

Attachments:

GoogleCodeExporter commented 8 years ago
Instead of hiding the icons when zooming, we want to prevent them from scaling. 
We do this already in the MyLocationNewOverlay - the "little man" icon doesn't 
change size when we pinch-to-zoom. We should make this configurable - if the 
overlay is drawing icons then you likely don't want them to scale, but if the 
overlay is drawing shapes that cover physical areas then you would want them to 
scale with the map imagery.

Original comment by kurtzm...@gmail.com on 21 Aug 2013 at 9:43

GoogleCodeExporter commented 8 years ago
Sounds like a good solution :)

Original comment by waeselyn...@gmail.com on 22 Aug 2013 at 1:06