简体   繁体   English

如何在Android的Google地图中显示显示地址的弹出文本

[英]how to display pop up text showing address in google map of android

class MapOverlay extends com.google.android.maps.Overlay { MapOverlay类扩展了com.google.android.maps.Overlay {

    @Override
    public boolean draw(Canvas canvas, MapView mapView, 
    boolean shadow, long when) 
    {
        super.draw(canvas, mapView, shadow);                   

        Point screenPts = new Point();

// scree.openInfoWindowHtml("Hello, World! " ); // scree.openInfoWindowHtml(“ Hello, World! ”);

        mapView.getProjection().toPixels(g, screenPts);

        Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.flag);            
        canvas.drawBitmap(bmp, screenPts.x, screenPts.y-50, null);  

        //TextView bubble=
        return true;
    }
}

Maybe you should check this: https://github.com/jgilfelt/android-mapviewballoons 也许您应该检查一下: https : //github.com/jgilfelt/android-mapviewballoons

It's really good and easy to use, much faster than rolling your own. 它非常好用,比滚动自己的速度快得多。 If you want to learn you can always study the source. 如果您想学习,可以随时研究资料。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM