Android 通过谷歌地图校准PNG
我有一个谷歌地图活动,有轨迹、POI、邻近警报等,我想在当前谷歌地图的同一位置(按纬度和经度校准)上放置一个新的PNG地图(新图层)。我怎么能这么做Android 通过谷歌地图校准PNG,android,google-maps,png,tiles,layer,Android,Google Maps,Png,Tiles,Layer,我有一个谷歌地图活动,有轨迹、POI、邻近警报等,我想在当前谷歌地图的同一位置(按纬度和经度校准)上放置一个新的PNG地图(新图层)。我怎么能这么做 致以最诚挚的问候您是否尝试将两个视图都添加到框架布局中?不过,我建议您将顶部的透明化 使用谷歌地图功能。以下是需要做的工作的大致轮廓 public class PNGOverlay extends Overlay { Bitmap mImage; // Allocate once and reuse private final Pain
致以最诚挚的问候您是否尝试将两个视图都添加到框架布局中?不过,我建议您将顶部的透明化 使用谷歌地图功能。以下是需要做的工作的大致轮廓
public class PNGOverlay extends Overlay {
Bitmap mImage;
// Allocate once and reuse
private final Paint mPaint = new Paint();
PNGOverlay(Bitmap image) {
mImage=image;
// Configure paint so image is transparent
}
/**
* Draw the overlay over the map.
*
* @see com.google.android.maps.Overlay#draw(Canvas, MapView, boolean)
*/
@Override
public void draw(Canvas canvas, MapView mapv, boolean shadow) {
// Use projection to figure out where to draw
Point center = new Point();
Projection projection = mapv.getProjection();
projection.toPixels(new GeoPoint(lat,lon), p);
// Transform image to fill the correct area
Matrix matrix = new Matrix;
// Do stuff
// Draw the image
canvas.drawBitmap(mImage, matrix, mPaint);
}
}
谷歌地图的功能(缩放、标记等)又如何呢?一切都会好起来的?也许你应该向我们展示你尝试过的代码,我们可以从那里提供帮助