gpt4 book ai didi

google-maps - BlackBerry 和基于 map 的应用程序,如 Yelp 和 Google Map

转载 作者:行者123 更新时间:2023-12-04 16:19:32 24 4
gpt4 key购买 nike

这是一个刚开始 BB 开发的人写的一个充满问题的帖子。非常感谢任何指导。

Yelp 和 Google Map 等基于 map 的 BlackBerry 应用程序是如何实现的?与基于网络的版本一样。 Yelp for the BB 允许您根据当前或指定位置搜索餐馆等。搜索结果以列表或 map View 的形式显示搜索结果的标记。 Yelp 的 map 由 Bing 提供支持。如何在 BB 代码中调用 map 以及标记?对于 ListView ,用于从数据库中检索结果列表的内容。可以使用任何数据库吗?

BB 版的 Google Map 3.2 现在支持图层。同样,如何调用 Google map ?您还可以直接在 map 上选择特定位置的标记(即 Wiki、加油站)并查看该位置的信息(即 Wiki、加油站地址)。这是如何完成的?

我在 map 技术以及BB开发方面的知识非常有限,因此欢迎基本或深入的反馈。

最佳答案

我没有为黑莓编写真实世界 GPS 应用程序的经验,以下只是我对可能的解决方法的观察和想法。

黑莓 Yelp 应用程序

事实上,如果您进行搜索,然后进入结果并查看 map 地址,Blackberry Yelp 应用程序会显示 map

alt text http://img197.imageshack.us/img197/965/13428830.jpg alt text http://img269.imageshack.us/img269/1976/92068364.jpg

另见 Yelp Launches Bing-Powered Blackberry App

如果您查看 Yelp API,您会发现只有 optionally use Google Maps 可以在您的网站 上显示搜索结果位置 的搜索功能。

Bing 似乎是 Google Maps 的 MS 模拟。还有一个 ASP Bing Map Control 几乎不能用于 BB 开发。

黑莓谷歌 map 应用程序

alt text http://img193.imageshack.us/img193/9678/39917026.jpg

您可以从代码中调用 installed Google Maps Mobile:

class Scr extends MainScreen {
public Scr() {
}
protected void makeMenu(Menu menu, int instance) {
super.makeMenu(menu, instance);
menu.add(mInvokeGMaps);
}
MenuItem mInvokeGMaps = new MenuItem("Run GMaps", 0, 0) {
public void run() {
GMLocation location
= new GMLocation(51.507778, -0.128056, "London");
invokeGMaps(location);
};
};
public void invokeGMaps(GMLocation l) {
int mh = CodeModuleManager.getModuleHandle("GoogleMaps");
if (mh == 0) {
try {
throw new ApplicationManagerException(
"GoogleMaps isn't installed");
} catch (ApplicationManagerException e) {
System.out.println(e.getMessage());
}
}
URLEncodedPostData uepd = new URLEncodedPostData(null, false);
uepd.append("action", "LOCN");
uepd.append("a", "@latlon:" + l.getLatitude()
+ "," + l.getLongitude());
uepd.append("title", l.getName());
uepd.append("description", l.getDescription());
String[] args = { "http://gmm/x?" + uepd.toString() };
ApplicationDescriptor ad = CodeModuleManager
.getApplicationDescriptors(mh)[0];
ApplicationDescriptor ad2 = new ApplicationDescriptor(ad, args);
try {
ApplicationManager.getApplicationManager()
.runApplication(ad2, true);
} catch (ApplicationManagerException e) {
System.out.println(e.getMessage());
}
}
}

使用自定义位置类:
class GMLocation {    
String mName;
String mDescription;
double mLatitude;
double mLongitude;
public GMLocation(double lat, double lon) {
mLatitude = lat;
mLongitude = lon;
}
public GMLocation(double d, double e, String name) {
this(d, e);
mName = name;
}
public GMLocation(double lat, double lon, String name, String descr) {
this(lat, lon, name);
mDescription = descr;
}
public String getName() {
return mName;
}
public String getDescription() {
return mDescription;
}
public String getLongitude() {
return String.valueOf(mLongitude);
}
public String getLatitude() {
return String.valueOf(mLatitude);
}
}

另见 How to use Google Map in Blackberry application?

结论

Blackberry 浏览器和 BrowserField 对 JavaScript 的支持有限。由于 Bing 和 GMaps 都是基于 JavaScript 的,我怀疑它们使用从服务器检索到的静态图像来显示 map 控件。这可能是可能的,但这意味着服务器端实现和所有必需的 API 开发人员 key 。

作为替代方法,您可以从 Blackberry 上的代码调用已安装的 GMap。

关于google-maps - BlackBerry 和基于 map 的应用程序,如 Yelp 和 Google Map,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1615520/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com