Hi,

The googlemaps API doc says something about Projection:

"[...]
public Projection getProjection()

    Get a projection for converting between screen-pixel coordinates
and latitude/longitude coordinates.

    Returns:
        The Projection of the map in its current state. You should not
hold on to this object for more than one draw, since the projection of
the map could change.
[...]"

I have extended ItemizedOverlay to draw a set of markers on the map.
Also, I have overriden the draw() method calling super.draw() and then
drawing a path between each point where I draw a marker. Thing is that
I exhausted the device with that method. The point is that on every
draw() I get the projection of the view and I draw the path getting
the pixel points with toPixels().

I have changed that to have an "old" projection and a "new"
projection, and If they are differents projections then draw the path.

I have a MapItem that has a GeoPoint, an OverlayItem, and some name or
descriptions about it. His OverlayItem is added to the extended class
of ItemizedOverlay. Then, the ItemizedOverlay is added to the Overlay
list from mapView.getOverlays().

Is there a better idea to do this job? I think it's consuming too much
CPU from the device (emulator). Without the
old-projection-new-projection thing I managed to hang the Activity
because it keeps drawing everytime the path. Another question, is it
ok the if ( projection != oldProjection ) conditional to draw the
path?

Thanks for the help,
-- 
If you want freedom, compile the source. Get gentoo.

Sebastián Treu
http://labombiya.com.ar

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

To unsubscribe, reply using "remove me" as the subject.

Reply via email to