How to find the route between two places in BlackBerry? - blackberry

How do I find the route information between two places in BlackBerry?
I'm using MapField to show the map in my application.

As I understood, you need to get a path length between several locations.
It's not possible in MapField, you can only set that route by yourself.
Invoke BB Maps for route direction
You can always use MapField in you application for simple functionality, like present locations, and use BlackBerry Maps application for enhanced stuff like select locations and route directions presentation for user.
To invoke BB Maps for route direction use code:
Invoke.invokeApplication(Invoke.APP_TYPE_MAPS,
new MapsArguments(
MapsArguments.ARG_LOCATION_DOCUMENT,document));
With document formed like:
<location-document>
<GetRoute>
<location lon='-8030000' lat='4326000' label='Kitchener, ON' description='Kitchener, Ontario, Canada' />
<location lon='-7569792' lat='4542349' label='Ottawa, ON' description='Ottawa, Ontario, Canada' />
</GetRoute>
</location-document>
Result will be like
alt text http://www.blackberry.com/knowledgecentersupport/kmsupport/supportknowledgebase/images/DB-00599_3.jpgalt text http://www.blackberry.com/knowledgecentersupport/kmsupport/supportknowledgebase/images/DB-00599_4.jpg
Now, in BlackBerry Maps you can register your App menu item and start or update your App with selected location using MapView.
See How To - Add an ApplicationMenuItem to BlackBerry Maps
UPDATE
Use the gmap navigation service for driving directions
See J2ME/Android/BlackBerry - driving directions, route between two locations

Related

In .Net how to build filter URL set using elasticsearch?

I know this could be done by using aggregates. But I can't understand how to render the filter urls(drill down urls) to the view. So that user user can move to the down layer. Should I create them manually or does elasticsearch have built in method to achieve this?
The real problem is this. Say I click link in my category facet and now the URL of the current page looks like: http://example.com/search/cars-for-sale
Once I moved my mouse pointer over the link in location facet url should change like http://example.com/search/cars-for-sale-in-new-york
So my real concern is how to generate urls in the facets related to the current URl ?

Using MKLocalSearchRequest

MKLocalSearchRequest requires a natural language query to get local places (e.g. "Coffee").
Is there a way to get it to return a list of all places within the specified region?
Alternatively is there an API that does this?
Or will I need to make multiple requests ("coffee", "bar", etc.) and include a search function the user can use if we haven't retrieved the place they're looking for?
Try using MKLocalSearchCompleter its better and it reacts to user input rather than plain queries like coffee / bar plus it will take region to limit your search area as well.
Here is the link to documentation - https://developer.apple.com/library/ios/documentation/MapKit/Reference/MKLocalSearchCompleter_class/

Open Graph Map layout

I succesfully posted an action to open graph with the 'Item' attachment layout. However I also want to post a action with the 'Map' attachment layout. My iOS app has an array with coordinates which form a route on a map.
I looked everywhere but just cant find a good tutorial which explains how to achieve this. Does someone know how to post a action to the open graph with a route preview on the map?
When you are creating your Open Graph custom Objects, you need to define a property of that Object as a GeoPoint and then set 'Is Array', like this:
If you include this information, there should be a Map style newsfeed post automatically created when the action is published. You should also set up a Map style Aggregation. There is more info on this here.
You can see an example of how this sort of complex route is created by looking at an example, here is one from an Endomondo workout:
http://pastebin.com/VEW2GU0t

gmaps4rails: HOW TO automatically add makers for locations matching a key word

I need to add markers for locations matching a specific keyword on my map.
Such as "hotel" for instance.
I need to obtain the same result as when I search for that keyword on maps.google.com, only I want this search to be done automatically using gmaps4rails. I would add my location with a different marker on top.
cheers,
joel
the process would be:
Ajax version
you already have a map from gmaps4rails displayed
submit a form remotely to your server
create the proper query on your records in your controller, simply respond with .to_gmaps4rails
use the js replaceMarkers function to clear the map and display the markers from the server response.
use the geolocation functions of the client browser (beware, not available on all of them) + the js addMarkers function to display the user position.
I wrote the relevant documentation here
Standard version
get the proper objects from your controller
create the json from them
create your map
add a js callback to create the marker with user's position

URL for multiple markers in Google Maps

In a desktop Qt application, I have some GPS coordinates that I'd like to show on a map. My plan is to construct an URL with the coordinates and let a web browser and Google maps or a similar service do the heavy lifting.
After reading some apparently reverse-engineered documentation at
mapki.com slash wiki slash Google_Map_Parameters
I can make it work for a single point, but what's the URL syntax for multiple points?
My best shot so far is to build a string such as this:
http://maps.google.com/?ie=UTF8&q=My+First+Point#59.591,17.82&q=My+Second+Point#59.592,17.82
but that will only show "My Second Point". Is there a better description of the syntax somewhere?
Replacing q= with markers= did not work and the "static map" suggestion below only complained about an incorrect API key.
for google maps static there is this URL:
http://maps.google.com/maps/api/staticmap?center=Brooklyn+Bridge,New+York,NY&zoom=14&size=512x512&maptype=roadmap
&markers=color:blue|label:S|40.702147,-74.015794&markers=color:green|label:G|40.711614,-74.012318
&markers=color:red|label:C|40.718217,-73.998284&sensor=false&key=MAPS_API_KEY
Detailed version:
http://maps.google.com/maps/api/staticmap?
center=Brooklyn+Bridge,New+York,NY
&zoom=14
&size=512x512
&maptype=roadmap
&markers=color:blue|label:S|40.702147,-74.015794
&markers=color:green|label:G|40.711614,-74.012318
&markers=color:red|label:C|40.718217,-73.998284
&sensor=false
&key=MAPS_API_KEY
i am not sure if this syntax is also good for standard maps
http://staticmapmaker.com/ - very nice web tool for generating static map urls.
List of currently supported map services:
- Google
- Bing
- Yandex
- HERE
- Mapbox
- MapQuest
- CartoDB
p.s. I know this is an old question, but many still google for it.
Throwing parameters at maps.google.com only gets you one point.
As dusoft says, you could use Google Static maps.
Or, if you require dynamic maps, you could write your own public web page that uses Google Maps API and accepts a long list of parameters. Use your own web page in exactly the same way that you were intending to use maps.google.com web page, except that you get to design what you want the parameters to look like.
Perhaps something like this.
Several parameters (such as the markers and path parameters) take multiple locations. In those cases, the locations are separated by the pipe (|) character.
https://maps.googleapis.com/maps/api/staticmap?center=boca+raton,+fl+|+deerfied,+FL&zoom=12&scale=false&size=600x300&maptype=roadmap&sensor=false&key=API_KEY&format=png&visual_refresh=true&markers=size:mid%7Ccolor:red%7Cboca+raton,+fl+|+deerfied,+FL" alt="Google Map of boca raton, fl | deerfied, FL
I know that you specifically asked for Google Maps, however I came up with a solution using Bing Maps:
https://bing.com/maps/default.aspx?sp=point.48.858303_2.3499404_Eiffel%20Tower~point.48.8530067_2.3499404_Notre-Dame%20Cathedral~point.48.8605088_2.3376727_Louvre link
The sp parameter can define a list of points, polylines, polygons and addresses. Multiple objects are separated by ~.
The syntax for point is:
point.latitude_longitude_titleString_notesString_linkURL_photoURL
titleString is displayed in the map and notesString only when clicking on a point.
A Link with you coordinates would look like:
https://bing.com/maps/default.aspx?sp=point.59.591_17.82_P1~point.59.592_17.82_P2 link
I did some tests on how many of these points can be in a URL by generating a really long URL in the form of https://www.bing.com/maps?sp=point.10.000000_10.000000_0~point.10.000000_10.01_1~point.10.000000_10.02_2~point.10.000000_10.03_3... and it seems up to about 150 points are working.
Documentation:
Microsoft Documentation: Create a Custom Map URL

Resources