KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I need to draw shapes just like those you would create with custom maps on Google Maps, using Android's MapView. In other words, if I draw a shape on the map, when I zoom out it should shrink, covering the same area of the map regardless of the zoom level. Example following the Android Reference: @Override public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when) { super.draw(canvas, mapView, shadow); //---translate the GeoPoint to screen pixels--- Point screenPts = new Point(); mapView.getProjection().toPixels(p, screenPts); Paint boxPaint = new Paint(); boxPaint.setColor(android.graphics.Color.WHITE); boxPaint.setStyle(Paint.Style.FILL); boxPaint.setAlpha(140); canvas.drawCircle(screenPts.x, screenPts.y, 20, boxPaint); return true; } This shows a white circle on the map, but if you zoom out, the circle is the same size. Perhaps using canvas is not right approach? I need something like how Google Maps highlights neighborhoods or cities: Any ideas? Thanks in advance!
Tags (comma-separated)
Save Edits
Cancel