0

我正在 j2me 中开发基于 GPS 的位置提醒。我对我使用的地图有点困惑??.....谷歌地图和诺基亚地图。哪一个可以让我很好地工作......我的应用程序的工作如下: -

- 用户将向应用程序提供一个字符串以搜索他/她想要的地方。

- 然后根据给定的字符串应用程序将通过在地图上指向标记在地图上显示一个地方。

-用户可以保存那个地方,或者他/她可以通过点击地图或任何其他方式选择一个附近的地方而不是搜索的地方。

- 应用程序将保存搜索到的地点坐标并在到达该地点附近时提醒。

- 当应用程序提醒用户已经存储的地方......那个地方应该通过指向一个标记以及他离目的地的距离来显示在地图上。

4

1 回答 1

1

The real choice here lies in whether to use a RESTful API like the Google Static Maps (or Nokia's RESTful Maps) or to use a native Java ME mapping library plugin such as the Nokia Maps API for Java ME. The latter has several major advantages:

  • Static mapping services such as the Google Static Maps API or Nokia's RESTful Map API do not cache or tile the images when requested, therefore each request involves a round trip to the server. If the map on a mobile application needs to be refreshed at any time, using a caching library will result in a reduction in network traffic after around three maps have been displayed. An explanation of this can be found here
  • As the name implies, Google's Static Maps API can only retrieve over http static images for a requested coordinate point, image size, image type and zoom level. Newer libraries offer additional functionality out of the box offering dynamic Map content and touch support, where the user can move around his/her current position, zoom in, zoom out, modify the view mode to satellite or translate an address to a coordinate point and show that on the map, among others. This abstraction of the underlying functionality is hidden from the developer so much less coding is needed in order to achieve the same result .
  • Terms and Conditions for Nokia Maps are easier to fulfil than Google - No legal restrictions of using the API outside a web browser application or need to provide a link to the native Google Maps App (if there is one), or to Google Maps (if there isn't one).
  • Nokia currently offer higher free daily request limits. Nokia Maps API for Java ME supports up to 50,000 render requests per day and per unique IP address (as of January 2012), for Nokia Developer registered users (free of charge) while the limit for Google's Static Maps API is currently 1000 unique (different) image requests per viewer per day.

A couple of years ago there wouldn't be a choice, only RESTful solutions existed, but these days I would say a static http solution should only be used if you want a simple single image

As an abstraction of the underlying services, there are already a full set of examples to cover most of your use cases:

-User will provide a string to app to search a place of his/her desire. -Then according to given string app will show a place on map by pointing marker on map.

-User can save that place or he/she can select a near by place rather than searched place by clicking on map or any other way.

Maybe you need to use a draggable marker:

Or react to the touch and find a Geocoordinate:

-app will save that searched place coordinates & remind when it reached to near that place.

This is known as geofencing and is covered by the Location API: - http://www.developer.nokia.com/Resou...ty-events.html

-When app remind to user about already stored place... that place should show on map by pointing an marker along with the how far he is from his destination.

Showing a Map with a Marker

For distance calculations, I guess you'd be after the ROUTING example

Now you could re-write and all these services from scratch using RESTful APIs (and then go about debugging your code) , but I'm sure you'll agree it would be much easier to use an existing, working and tested framework for the low level plumbing and then just write your code on top using the services.

It is possible to encapsulate RESTful service in Java ME. As an example, added below is a screenshot from an app encapsulating the suggestion service

Places Search

It is just a lot easier when someone else has already done this work for you and placed it in a library.

于 2013-01-21T10:22:14.057 回答