Very
interested in the implementation ofanimateTo(point) like google maps.
I'll try, but first I need to install the Android SDK 2.3!What's with Thilo, he will take over your work?
I have just uploaded an improved version of Rewrite to my repository
clone at
http://code.google.com/r/ludwigbrinckmann-mapsforge/source/browse?name=rescue
(note that this is the 'rescue' branch).
Numerous changes to the Rewrite code base have been flattened to a
single commit, it is simply too much work to separate all the fixes
out into individual commits that would still be internally consistent.
On the top-level is a RESCUE-README.txt which details some of the
changes. This is what it says right now:
-------
* The Android bitmaps are the biggest memory problem. I have ported
the old master solution (with reference counting) and made some
important other changes.
* Bitmap handling is now broken up into different bitmap types
* TileBitmap is the class that handles the same-size bitmaps that
are used for drawing and downloading. This makes it easy to reuse them
on Android 3.x+
* ResourceBitmap handles icons. The main improvement here is that
they can be retrieved from an internal cache when the same file is
loaded again.
* Bitmap: what is left over are the bitmaps for the drawing of the
FrameBuffer (the biggest bitmaps) and internally created bitmaps for
things like the scalebar. The bitmaps used for the FrameBuffer
continue to be the biggest problems when rotating and changing
MapViews as somehow they seem to be held in memory (I assume
internally something holds a reference to them). I have been
experimenting with different strategies, such as allocating a bigger
square bitmap for the FrameBuffer, so that it does not have to be
reallocated on device rotation.
SVG Support
-----------
* SVG icon support is provided via the svg-android library.
* This was originally developed by larvalabs at
https://code.google.com/p/svg-android/ under the Apache License. It
incorporates code under a BSD license. If you do not agree with these
licenses, do not use the code.
* The SVG library provides limited support for SVG based icons for
better scaling. The SVG spec is so complicated that there will
probably never be a full support for Android.
* A set of SVG icons that almost covers all of the icons used in the
standard rendertheme is provided. For the missing icons I did not have
the original code.
Device Scaling Support
----------------------
* One of the main issues for production has been support for higher
DPI devices. Just adjusting the the font size has its limitation.
* I have taken the approach of simply increasing the TILE_SIZE on
higher DPI devices. This has the effect that everything is simply
drawn bigger (including streets, buildings etc).
* I have not changed the name TILE_SIZE at the moment as it affects so
many files.
* The scaling factor for the device is determined at start-up and now
the AndroidGraphicFactory needs to be instantiated explicitly at
startup (see Samples for how to safely do this).
Extended Rendertheme Support
----------------------------
* I put a mechanism in place so that renderthemes and icons can be
safely loaded from Android asset files. This allows easier packaging.
* I have not yet changed the rendertheme version back to 2 (should
happen though)
I have a Problem on Galaxy S3!
My ‘metrics.scaledDensity’ is 2.0 and Tile.TILE_SIZE is changed to 512!
But with Open a Map it comes to an "unsupported tile pixel size: 512" !
Put a static final DEFAULT_TILE_SIZE=256 to Tile and use this for Scaling on
AndroidGraphicFactory.setTileSize(){
Tile.TILE_SIZE = (int) (Tile. DEFAULT_TILE_SIZE * this.scaleFactor * this.userScaleFactor);
}
and use this default Size for
RequiredFields. readTilePixelSize(… , ..){
…
if (tilePixelSize != Tile.DEFAULT_TILE_SIZE)
…
Respect, with implement this changes, I can see the very nice representation on High-DPI devices
Andre
So, yes on a G3 the tile size should be 512 as it has a very high
density. If you can read any mapsforge map without this sort of
scaling then you are not as old as me ;-)
But in our App we scale the Tiles over DPI.
We don’t use the AndroidMapViewer, only create the MapTiles and drawing this over OpenGL scaled with DPI value.
So I can read this, without glasses! ;-)
Andre
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.19 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
FATAL EXCEPTION: MapWorker
java.lang.OutOfMemoryError: bitmap size exceeds VM budget
at android.graphics.Bitmap.nativeCreate(Native Method)
at android.graphics.Bitmap.createBitmap(Bitmap.java:477)
at org.mapsforge.map.android.graphics.AndroidBitmap.createAndroidBitmap(AndroidBitmap.java:60)
at org.mapsforge.map.android.graphics.AndroidTileBitmap.<init>(AndroidTileBitmap.java:89)
at org.mapsforge.map.android.graphics.AndroidGraphicFactory.createTileBitmap(AndroidGraphicFactory.java:202)
at org.mapsforge.map.layer.renderer.DatabaseRenderer.executeJob(DatabaseRenderer.java:174)
at org.mapsforge.map.layer.renderer.MapWorker.renderTile(MapWorker.java:71)
at org.mapsforge.map.layer.renderer.MapWorker.doWork(MapWorker.java:52)
at org.mapsforge.map.util.PausableThread.run(PausableThread.java:140)
--To view this discussion on the web visit https://groups.google.com/d/msgid/mapsforge-dev/d4fcf08d-5c7a-4ee6-92b6-526e6686a42e%40googlegroups.com.
You received this message because you are subscribed to the Google Groups "mapsforge-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapsforge-de...@googlegroups.com.
- Besides the layer Tap event, I think there is really need
also for layer Long Press event.
- The map scale bar size (lines and label) does not change with the device DPI.
So at devices with high DPI is very small.
I had posted this issue (for the master branch also) at:
http://code.google.com/p/mapsforge/issues/detail?id=456
- May I ask why the change of map background to black at rewrite branch?
I think the old gray was more appealing to the eyes.
- Could you make AndroidGraphicFactory's method getPaint(Paint paint) as public?
It really helps in using android paint methods which do not exist at mapsforge paint.
Or you could add the method measureText to class AndroidPaint.
- Another request is that could you add the classes Projection and MapViewProjection
from mapsforge master branch?
They're really needed for various calculations.
- At Android 2.3 and strangely at a Samsung Galaxy S2 (4.1.2) the labels
at rendered downloaded Mapnik tiles have really bad quality.
At Jelly Bean 4.2 they are "clean" as their web edition.
- A serious issue is that also at Android 2.3 I see out of memory issues
FATAL EXCEPTION: MapWorker
java.lang.OutOfMemoryError: bitmap size exceeds VM budget
at android.graphics.Bitmap.nativeCreate(Native Method)
at android.graphics.Bitmap.createBitmap(Bitmap.java:477)
at org.mapsforge.map.android.graphics.AndroidBitmap.createAndroidBitmap(AndroidBitmap.java:60)
at org.mapsforge.map.android.graphics.AndroidTileBitmap.<init>(AndroidTileBitmap.java:89)
at org.mapsforge.map.android.graphics.AndroidGraphicFactory.createTileBitmap(AndroidGraphicFactory.java:202)
at org.mapsforge.map.layer.renderer.DatabaseRenderer.executeJob(DatabaseRenderer.java:174)
at org.mapsforge.map.layer.renderer.MapWorker.renderTile(MapWorker.java:71)
at org.mapsforge.map.layer.renderer.MapWorker.doWork(MapWorker.java:52)
at org.mapsforge.map.util.PausableThread.run(PausableThread.java:140)
- Besides the layer Tap event, I think there is really need
also for layer Long Press event.Yes, that was the next thing I was planning to do.
/**
* Handles a long press event. A long press event is only triggered if the map was not moved. A return value of true
* indicates that the long press event has been handled by this overlay and stops its propagation to other overlays.
* <p>
* The default implementation of this method does nothing and returns false.
*
* @return true if the long press event was handled, false otherwise.
*/
public boolean onLongPress() {
return false;
}
/**
* Handles a tap event. A tap event is only triggered if the map was not moved and no long press event was handled
* within the same gesture. A return value of true indicates that the tap event has been handled by this overlay and
* stops its propagation to other overlays.
* <p>
* The default implementation of this method does nothing and returns false.
*
* @return true if the tap event was handled, false otherwise.
*/
public boolean onTap() {
return false;
}
Rectangle r = new Rectangle(p.x - b.getWidth() / 2, p.y - b.getHeight() / 2, p.x + b.getWidth() / 2, p.y + b.getHeight() / 2);
if (!r.contains(this.lastPosition)) {
- Could you make AndroidGraphicFactory's method getPaint(Paint paint) as public?
It really helps in using android paint methods which do not exist at mapsforge paint.
Or you could add the method measureText to class AndroidPaint.I am open to this (I guess Thilo would disagree). Could you send me exactly the API you want?
public float measureText(String text) {
return this.paint.measureText(text);
}
- Another request is that could you add the classes Projection and MapViewProjection
from mapsforge master branch?
They're really needed for various calculations.I will look into this as I am not really aware what the differences are now.
- At Android 2.3 and strangely at a Samsung Galaxy S2 (4.1.2) the labels
at rendered downloaded Mapnik tiles have really bad quality.
At Jelly Bean 4.2 they are "clean" as their web edition.Hmm, can you send a screenshot. I could imagine this an effect of the automatic scaling, as the tiles downloaded are probably really 256x256 and are on higher DPI devices scaled up to 512x512, which would make labels look fuzzy. If this is the case I do not have a good answer to this: the alternative is having tiles much too small to read them.
(Is this error happening on a real device with a human user? or a test harness? To me it seems much more difficult to trigger OOM conditions 'by hand', the test harnesses are really hammering the devices/emulators).
--
You received this message because you are subscribed to the Google Groups "mapsforge-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapsforge-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapsforge-dev/c58f6e05-de49-42cc-9ecb-38ad0d726760%40googlegroups.com.
My mistake for suggesting to add the method measureText in AndroidPaint,
as it is not public class and the method measureText is not at interface Paint.
So I think it can be removed, as it cannot be used.
--
You received this message because you are subscribed to the Google Groups "mapsforge-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapsforge-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapsforge-dev/4ba49418-75c8-4688-b329-57ec1e8f34dd%40googlegroups.com.
I think zoomAnimator has to use the "this.zoomLevel" after the verification of min/max restrictions.
I attach a patch.
--
You received this message because you are subscribed to the Google Groups "mapsforge-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapsforge-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapsforge-dev/d5b375a4-f6a3-4acb-8a63-b683439afd75%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "mapsforge-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapsforge-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapsforge-dev/3398dc0a-89cf-4058-b494-f05f88005821%40googlegroups.com.
I have actually no idea, this method was posted here somewhere on the mailing list and it somehow seemed to do the trick, but an explanation would of course be helpful.On 19 December 2013 19:10, emux <deve...@gmail.com> wrote:Hi Ludwig,
I study the ZoomToBounds example at the Samples app.
More specifically the Utils.zoomForBounds method.
Can you explain the meaning of fixed value 3.8 at calculation of zoomX, zoomY ?
From where does this value is derived?
----To view this discussion on the web visit https://groups.google.com/d/msgid/mapsforge-dev/3398dc0a-89cf-4058-b494-f05f88005821%40googlegroups.com.
You received this message because you are subscribed to the Google Groups "mapsforge-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapsforge-de...@googlegroups.com.
You received this message because you are subscribed to the Google Groups "mapsforge-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapsforge-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapsforge-dev/CAAvpVPAXs74YFAekJC4qeYTD-x9yzAJtyvn2si4Wr-sVxnnyOA%40mail.gmail.com.