Geolocation API with icenium (Native map or Google Maps API)

5 posts, 0 answers
  1. Ricardo de Assuncao Goncalves
    Ricardo de Assuncao Goncalves avatar
    13 posts
    Member since:
    Feb 2010

    Posted 26 May 2013 Link to this post

    I need to use "Geolocation" API in my mobile app. I would like to show a map with the user location and the user would be able to search a new addresses which he wants to go. When the user search a new address I would like to pick up the new latitude/longitude of this new address.

    I know how to accomplish this tasks in the web application using Google maps api but Google maps api has some daily limitation:

    "Use of the Google Geocoding API is subject to a query limit of 2,500 geolocation requests per day. (User of Google Maps API for Business may perform up to 100,000 requests per day.)"

    https://developers.google.com/maps/documentation/geocoding/#Limits

    Question 1) Most of the time I will request just the user Geo Location (latitude/longitude) but sometimes the user want to see the Map. Can I show the native map instead of using the Google Maps API to show the map (limitation of 2500 request per day)?

    Question 2) So imagine if my app has 100.000 user and 2500 users make one request in the same day, does it mean my quote of request is gone with Google Maps and my app cannot search for new addresses anymore? Or the Geolocation API can access the native maps and i can make unlimited requests for searching my new addresses? 

    Regards
    Ricardo

  2. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 27 May 2013 Link to this post

    Hi Ricardo,

    Thank you for the thorough description of your inquiry. Directly to your questions:
    • When you say the "native map", we assume you talk about iOS platform and the built-in MapKit, correct? In such case, Cordova does not have native support for it yet and you need to use a custom plug-in, which we do not support at this time. What you can do is use the Cordova Geolocation API to get the latitude/longitude and only if the user wants to, give them the ability to show the google map.
    • The Cordova Geolocation API does not make requests to Google Geocoding API and the limitation listed in Google documentation would apply for your app. If you think that it would be used frequently, you should consider getting necessary license from Google.

    Regards,
    Steve
    Telerik

    Don't miss the Icenium May Release Keynote - sign up now!
    Share feedback and vote for features on our Feedback Portal.
  3. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 05 Jul 2013 Link to this post

    Hello Ricardo,

    This is just a follow up in case you have missed the Icenium 1.6 release, where we've added the ability to add Plugman-compatible Apache Cordova plugins to your Icenium project. For more information, see Working with Custom Plugins help article.

    If it is not compatible, you would have to make the necessary modifications in order to be able to use it, see Requirements for Custom Apache Cordova Plugins and Plugman specifications.

    For the full list of shiny goodies that made it in the 1.6 release, please refer to the Icenium 1.6 Release Notes.

    Regards,
    Steve
    Telerik

    Looking for tips & tricks directly from the Icenium team? Check out our blog!
    Missed our first webinar, watch it here.
    Share feedback and vote for features on our Feedback Portal.
  4. Ali
    Ali avatar
    1 posts
    Member since:
    Jul 2013

    Posted 03 Dec 2013 Link to this post

    Hey Steve,

    I added Mapkit plugin successfully through import plugin but when i try to deploy it on android device build fails with error 

    Variable(s) missing: API_KEY N/A NativeMapTest 0 0 C# N/A

    I opened plugin.xml file and find out

      <config-file target="AndroidManifest.xml" parent="/manifest/application">
                <meta-data
                    android:name="com.google.android.maps.v2.API_KEY"
                    android:value="$API_KEY" />
            </config-file>

            <config-file target="res/xml/config.xml" parent="/widget">
               <feature name="MapKit">
                  <param name="android-package" value="com.phonegap.plugins.mapkit.MapKit"/>
                </feature>
            </config-file>

            <source-file src="src/android/MapKit.java"
                    target-dir="src/com/phonegap/plugins/mapkit" />
            <preference name="API_KEY" />

    any help how can I replace Api_Key

    thanks

    Ali Zaidi
  5. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 06 Dec 2013 Link to this post

    Hello Ali,

    The MapKit plugin is an iOS only plugin and is not included in the Android build at all. If you have used the MapKit js API in your app, then you should either check for the platform and execute it only when it is iOS or take advantage of the platform specific files functionality we have.

    Regards,
    Steve
    Telerik
    You've missed the Icenium Visual Studio Integration keynote? It has been recorded and posted here.
    Looking for tips & tricks directly from the Icenium team? Check out our blog!
    Share feedback and vote for features on our Feedback Portal.
Back to Top