Open Native Maps App From A Rhodes Application

April 06, 2012

Recently I tried Rhodes MapView in a sample application. While using rhodes we have situations to use native Maps application that is installed in Android/iPhone Mobile. To use the pre installed Maps application from Rhodes application, we can specify the map_params as follows:

    map_params = {
         :provider => 'Google',
         :settings => {:map_type => "hybrid",:region => [@params['latitude'], @params['longitude'], 0.2, 0.2],
                       :zoom_enabled => true,:scroll_enabled => true,
                       :api_key => 'Your api key'},
         :annotations => [{:latitude => '13.04708', :longitude => '80.198243', :title => "Click to see the direction", :subtitle => "", :url => "http://maps.google.com/maps?saddr=Chennai&daddr=Madurai"}]
          }
    MapView.create map_params
    

When we click on the marker it opens the Google Maps application with the specified source and destination parameters with suggested routes between start address and end address.
      

This works fine for iPhone/iPad as well.

pixelstats trackingpixel

Tags:

No comments

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>