如何展现我们自己的黑莓手机地图图标? [英] How to show our own icon in BlackBerry Map?

查看:203
本文介绍了如何展现我们自己的黑莓手机地图图标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何使用自己的标志,以显示BBMap的特别的地方?任何人都可以知道如何做到这一点?

I want to know how to use our own logo to show the particular place in BBMap? Can anyone knows how to do this ?

推荐答案

这是不可能的黑莓地图,以显示POI自定义图标。的结果
黑莓地图事情可以包括位置:

BlackBerry Map

It's not possible in Blackberry Map to show custom icon for POI.
Things you can include in Location on Blackberry Map:


  • 的位置* 100,000纬度。南为负。

  • 的位置* 100,000经度。西为负。

  • 要显示的位置旁边的标签。

  • 的说明时,BlackBerry智能手机用户选择结果显示
    详细信息。

  • 从0缩放级别,以便MAX_ZOOM。

  • 地址

  • 城市

  • 省或州

  • 国家

  • 邮政code

  • 电话

  • 传真

  • 网址

  • 电子邮件地址

  • 类别

  • 0和5 的
  • 评级信息
  • The latitude of the location * 100,000. South is negative.
  • The longitude of the location * 100,000. West is negative.
  • The label to be displayed beside the location.
  • The description displayed when the BlackBerry smartphone user selects
    details.
  • Zoom level from 0 to MAX_ZOOM.
  • Address
  • City
  • Province or state
  • Country
  • Postal code
  • Phone
  • Fax
  • URL
  • Email address
  • Category
  • Rating information between 0 and 5

请参阅什么是 - 黑莓地图位置文档格式

另请参阅<一个href=\"http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800703/How_To_-_Invoke_BlackBerry_Maps.html?nodeid=1366963&vernum=0\"相对=nofollow>如何 - 调用BlackBerry Maps

作为一种替代方法,您可以尝试的 MapField +经理/屏幕漆覆盖。

As an alternative you can try MapField + manager/screen paint override.

自定义扩展MapField:

Custom extension for MapField:

class CustomMapField extends MapField {
    Bitmap mIcon;
    XYRect mDest;

    public void moveTo(Coordinates coordinates) {
        super.moveTo(coordinates);
        mDest = null;
    }

    protected void paint(Graphics graphics) {
        super.paint(graphics);
        if (null != mIcon) {
            if (null == mDest) {
                XYPoint fieldOut = new XYPoint();
                convertWorldToField(getCoordinates(), fieldOut);
                int imgW = mIcon.getWidth();
                int imgH = mIcon.getHeight();
                mDest = new XYRect(fieldOut.x - imgW / 2, 
                fieldOut.y - imgH, imgW, imgH);
            }
            graphics.drawBitmap(mDest, mIcon, 0, 0);
        }
    }
}

使用的示例:

class Scr extends MainScreen {
    CustomMapField mMapField;
    Coordinates mCoordinates;
    public Scr() {
        LocationProvider provider = null;
        Location location = null;
        try {
            provider = LocationProvider.getInstance(null);
        } catch (LocationException e) {
            e.printStackTrace();
        }
        try {
            location = provider.getLocation(-1);
        } catch (LocationException e) {
            e.printStackTrace();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        mCoordinates = location.getQualifiedCoordinates();
        add(new LabelField("Latitude: "
                + String.valueOf(Coordinates.convert(
                mCoordinates.getLatitude(),
                Coordinates.DD_MM_SS))));
        add(new LabelField("Longitude: "
                + String.valueOf(Coordinates.convert(
                mCoordinates.getLongitude(), 
                Coordinates.DD_MM_SS))));
        mMapField = new CustomMapField();
        mMapField.mIcon = Bitmap.getBitmapResource("poi_icon.png");
        mMapField.moveTo(mCoordinates);
        add(mMapField);
    }
}

另请参阅结果
在黑莓
使用MapComponent
<一href=\"http://docs.blackberry.com/eng/deliverables//1181/GPS%20and%20BlackBerry%20Maps%20Development%20Guide.pdf\"相对=nofollow> GPS和黑莓地图开发指南

如果它是真实的设备,确保GPS可用且已打开。结果
如果是模拟器,然后你开始之前计划使用模拟器菜单 - >模拟 - > GPS位置设置GPS数据结果。
另一种选择是很难code你自己Coordinats并使用它们没有GPS:

If it's real device, be sure GPS is available and turned on.
If it's simulator, then before you start program use simulator menu -> simulate -> GPS Location to set GPS data.
Other option is hardcode your own Coordinats and use them without GPS:

    double latitude = 51.507778;
    double longitude = -0.128056;
    Coordinates mCoordinates = new  Coordinates(latitude, longitude, 0);

这篇关于如何展现我们自己的黑莓手机地图图标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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