06-25-2011 05:06 PM
I already know, that a Location Document (<lbs> ... </lbs>) has problems with some characters:
& must be escaped as & < must be escaped as < ' or " escaped as ' or "
understand this - is ok for XML
but there are problems with umlauts (per ex. üäö...) and I can imagine more....
I'm using UTF-8, so i tried to place at the beginning of the location document:
<?xml version="1.0" encoding="UTF-8"?>
but it doesn't help if invoking the Map App:
MapsArguments mapsArgs = new MapsArguments(
MapsArguments.ARG_LOCATION_DOCUMENT, "my-document-as-string");
try {
Invoke.invokeApplication(Invoke.APP_TYPE_MAPS, mapsArgs);
} catch (IllegalArgumentException e) {
// log
}
if there are locations inside the location document where umlauts are used, these locations are not displayed.
silently.
no exception.
took some time to see why this happened. my locations have addresses from (BlackBerry's service) reverse geocoding, where streets with umlauts are correctly used, but hindering the Map to display this from a Location document.
**QUESTION: any ideas how to solve this ? **
I need location documents because it's (as I know) the only way to get a Route.
using KML or Landmark[ ] umlauts are no problem - same locations are displayed well in Map App as KML or Landmark or in RichMapField as MapLocation.
my workaround:
1. invoke map with location document to get the route, but start-coordinate and destination-coordinate are only named as 'START' and 'DESTINATION'
2. Invoke map with Landmark[ ] to display the start and location with rich details
this works, but using Landmarks another problem:
I don't know how to programatically delete Landmarks. I can clear locations inside lbs-documents, but I didn't found a way to delete Landmarks.
OK - I know, if leaving the Map APP and later coming back they are gone,
but I have the need...
- to stay at the Map APP
- shake the device
- my background app detects shake from Accelerometer
- clears existing points and displays next 109 min of a tracked path
but I couldn't delete the Landmarks from the background - new Landmarks are added
** QUESTION: How to delete Landmarks from Map APP - executed from background app while Map is inforeground **
BTW:
I made a VIDEO about this functionality well working from RichMapField where I'm displaying Waypoints of a tracked path. But if you want to compare the tracked path with calculated route this has to be done using the Map APP
...will blog in detail about GPS, LBS, Geolocation and more soon
06-29-2011 10:41 AM
By default, when a String object is created on a BlackBerry Smartphone it is created in the ISO-8859-1 format. Since you are using UTF-8 characters, use a String construtor that allows you to specify the character encoding.
The same code below would be creating the String in ISO-8859-1 format.
06-29-2011 05:04 PM
thx....
but there are so many Strings: label, description, addresses etc
some of these String I got back from BlackBerry Reverse Geocoding -
works well with Landmark, MapLocation, but not inside LocationDocument
think it's easier to use LandMarks instead converting all Strings to UTF-8
- even if I cannot delete them from the Map App programmatically
do you think it's worth to enter an enhancement to support UTF-8 from lacation Document ?
06-30-2011 09:53 AM
ekke wrote:
do you think it's worth to enter an enhancement to support UTF-8 from location Document ?
Absolutely. Please log this in Issue Tracker.
07-01-2011 02:49 PM
added a feature request
https://www.blackberry.com/jira/browse/JAVAAPI-193
01-21-2012 02:15 AM
Hi,
Can we get street name of the location using apis programatically?
Please let me know. Its urgent.
Thanks.
Regards,
Shubhangi
01-21-2012 02:37 AM
you can get the address from your coordinates
take a look at the Locator
Landmark[] lma = Locator.reverseGeocode(yourCoordinate, searchType);
from the Landmark you can get Address Info
01-21-2012 03:00 AM
Thank you very much. ![]()
I have one more doubt: If we display blackberry map on screen and click on the particular location can we get coordinate of the clicked location programmatically?
Thanks ain advance.
Regards,
Shubhangi