How to use MapTrackView ?

Former Member
Former Member

Hi,

I try to understand how to use MapTrackView and custom marker display.

I following this page ; https://developer.garmin.com/connect-iq/programmers-guide/user-interface but I have always this message :

Error: Unexpected Type Error
Details: Failed to start CIQ Application

What does it mean ?

Thank you.

  • Have you looked at the MapSample in the SDK?

    It does both MapView as well as MapTrackView.

  • Former Member
    Former Member over 5 years ago in reply to jim_m_58

    Hi,

    thank you for answer. 
    yes, I based my app in this example but, same error, again. 

    I’ll try to reconfigure eclipse. 

  • So the mapsample works for you?  That's the first thing to try.

    Are you using a target that has maps with your app?

  • Former Member
    Former Member over 5 years ago in reply to jim_m_58

    Hi,

    yes mapSample works but only in watch app. 
    when I use MapView class in widget , it doesn’t works. 

  • From the lines you posted it's unclear what's wrong, but I know it works in widgets - I have some that use maps. 

    Put some println calls in your app base for things like initialize(), onStart() and getInitialView() and see how far you get.

  • Former Member
    Former Member over 5 years ago in reply to jim_m_58

    Thank you for your answer.

    Ok, i'll try to be clearer, (sry for my english)

    I would like to use mapview as datafield in order to display map with marker during activity.

    To do that, I extend WatchUi.MapTrackView.

    class iqmapView extends WatchUi.MapTrackView {

    initialize() running without error :

    function initialize() {
            MapTrackView.initialize();
            setMapMode(WatchUi.MAP_MODE_PREVIEW);
            
            var top_left = new Position.Location({:latitude => 38.85695, :longitude =>-94.80051, :format => :degrees});
            var bottom_right = new Position.Location({:latitude => 38.85391, :longitude =>-94.7963, :format => :degrees});
            MapTrackView.setMapVisibleArea(top_left, bottom_right);
    		 
            
            MapTrackView.setScreenVisibleArea(0, System.getDeviceSettings().screenHeight / 2, System.getDeviceSettings().screenWidth, System.getDeviceSettings().screenHeight);
        	System.print("inited");
        }

    but, after last 'print', nothing and faild message "Failed to start CIQ Application" appears in console

  • You can't use a MapTrackView in a data field.  Only in a widget or device app and it's always full screen (it's it's own view).

  • Former Member
    Former Member over 5 years ago in reply to jim_m_58

    That would explain my disappointment.

    Can't I use the map in a view during an activity?

  • You can write a full device app for an activity and have a map in that, but no, not in a native activity like "run" or "bike"

  • Former Member
    Former Member over 5 years ago in reply to jim_m_58

    Ok, Thank you Slight smile