Open Native Maps App From A Rhodes Application

Rajeswari K

30 sec read

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:

    [source language=”ruby”]
    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
    [/source]

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.

Related posts:

Leave a Reply

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