添加自定义标记地图 - 机器人 [英] Adding a custom marker to map - Android

查看:336
本文介绍了添加自定义标记地图 - 机器人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我有一个应用程序使用图形页面可显示谷歌地图给用户。

I currently have an app which displays google maps to the user using MapView.

我一直在试图把一个标记使用此code在地图上,

I have been trying to place a marker on the map using this code,

public boolean onTouchEvent(MotionEvent event, MapView mapView) {
        if (event.getAction() == 1) {
            GeoPoint p = mapView.getProjection().fromPixels((int) event.getX(),
                    (int) event.getY());
            DemoOverlay demoOverlay = new DemoOverlay(); 
            mapView.getOverlays().add(demoOverlay);

            mapView.invalidate();
        }
        return false;
    }

我有一个演示叠加设立这使标记在地图上,但是当我触摸屏的标志永远不会出现。

I have a Demo Overlay set up which puts a marker on the map, however when I touch the screen the marker never appears.

任何帮助将是AP preciated!

Any help would be appreciated !!!

推荐答案

感谢您的建议,但我已经决定了,因为它们涵盖正是我需要遵循这些教程,   http://thenewboston.org/watch.php?cat=6&number=133

Thanks for suggestions but I have decided to follow these tutorials as they cover exactly what I need, http://thenewboston.org/watch.php?cat=6&number=133

特别这部影片是一个涵盖我的问题,

This video in particular is the one which covers my question,

http://thenewboston.org/watch.php?cat=6&数= 141

这篇关于添加自定义标记地图 - 机器人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆