Access course data from data field

I'm frustrated by poor navigation in Instinct 2 - the user can't get information about distance to next custom course point (I'd like to put water stations for a given race on the map and see how many m/km  is left to next nearest water station). Is it possible to access course data from within data field? I'd love to make an elevation plot data field that shows only a fraction of upcoming elevation instead of having to cycle to build in elevation-plot screen (when you start a workout with navigation you can land with 6-10 screens depending on your config - not optimal and one can't change it per activity).

  • Is it possible to access course data from within data field?

    No, not directly. There's only a handful of course-related fields in Activity.Info like distanceToDestination, courseOverGround, track, etc. If you search the linked page for "course", "dest", "point", and "track", that should cover all of them.

    I don't think there's a way to plot the upcoming elevation like what you're asking for.

    If you have a mapping-enabled watch, you can implement a data field which shows the map (and optionally, the breadcrumb trail), but not elevation, afaik.

  • So mapping enabled means only devices with full map support (Fenix etc), not devices that show breadcrumb trails (Instinct etc)?

    How about PersistedContent (https://developer.garmin.com/connect-iq/api-docs/Toybox/PersistedContent.html)? Is it available from data field? It looks like I could iterate over courses and access their data. 

    EDIT: I see PersistedContent is only returing objects with metadata not real data (used to launch activity with given obj). 

  • So mapping enabled means only devices with full map support (Fenix etc), not devices that show breadcrumb trails (Instinct etc)?

    Yep. I don't have direct experience with this, but my understanding from the docs and forums discussion is that it's only for devices with mapping:

    https://developer.garmin.com/connect-iq/api-docs/Toybox/WatchUi/MapView.html

    If you have a non-mapping enabled device you can just store and draw your own breadcrumb trail anyway, although it would be of limited utility to the user since you can't access course data in a data field. There are full device apps in the store which provide navigation and/or maps as full apps, or just a map as a data field.

    e.g.

    mapField (data field: map for non-nav devices): apps.garmin.com/.../8a8ccf60-2c97-443a-9daf-abd3608f2b10

    dwMap (app: navigation w/breadcrumb trail for non-nav devices): https://apps.garmin.com/en-CA/apps/2750f280-82f4-4f21-a32c-57acc7ce4870

    routeCourse (app: nav and maps for non-map devices): https://apps.garmin.com/en-US/apps/b7efc9ca-5446-4e1c-bc53-474e97f376ac

  • Yes. MapView and MapTrackView are only for devices that have local maps.  Also, they can't be used in data field last I heard, but not tried in a while.  Just widgets/super apps/device apps.

  • Thanks for replies :) I was looking just for a structure that would hold upcoming course points so I could impelemnt 'up ahead' data field. There already is a field called 'distance to next' but it shows distance to next coruse point (which can be a simple turn in the course, not much use for this). So I thought I could parse point names and look for patterns there. Only thing that comes to mind is using https to access course data in 'onLayout' or 'calculate' method. Seems hacky and will fail when there is no gsm reception :) 

  • Yes. MapView and MapTrackView are only for devices that have local maps.  Also, they can't be used in data field last I heard, but not tried in a while.  Just widgets/super apps/device apps.

    My mistake, sorry!

    I wonder if you could push a MapView via a CIQ data field's on-device settings (which doesn't literally have to be settings, as far as I know.)

    Even if you could, it probably wouldn't be a great user experience.

  • As the developer of these three apps/fields just want to clarify that routeCourse is a route (course) download tool for map-capable devices.  The characterizations of the other two are spot on though, and thanks for the mention.

    And to the original question, my apps/field don't get their route data from the device itself, they download it from a companion website (usually ahead of starting the activity), hence no dependence on PersistedContent or other local data access APIs.

  • You are still in a DF so I doubt it. and if you could use something like MapView instead of a Menu2, etc with getSettingView, it would be popped when you leave "settings".  Plus, you wouldn't have the information as to what map to display (the "bounding box") 

  • and if you could use something like MapView instead of a Menu2, etc with getSettingView, it would be popped when you leave "settings".

    Yeah, that's true. I mentioned it wouldn't be very user-friendly, just idly wondered if it was possible. The idea is to have a 2nd "mode" for a data field app which is freed from the constraints of a regular data field - e.g. it can accept user input, push other views, etc.

    I tried it out in the sim and a real 945 LTE and it works, as I'd guessed. I tried two things:

    - Returning a MapView directly from getSettingsView()

    - Returning a class derived from Menu2 from getSettingsView(); my custom Menu2 pushes a MapViuw

    I set my MapView to browse mode and set the map visible area to a fixed location in my city. I was able to zoom and pan (although map pan controls are still pretty broken for 945 LTE.)

    Plus, you wouldn't have the information as to what map to display (the "bounding box") 

    CIQ data fields have access to the current location, no?

    Anyway, I reiterate that I don't think this is practical or user-friendly, just an interesting exercise.

    I've always been interested in the idea of having a 2nd "mode" for a data field (i.e. a 2nd set of screens and features.) I already have a full screen data field which displays 6 fields (at the time, most watches couldn't do that), and has a (user-unfriendly) way to switch to a second screen (list of laps). There's also a user-unfriendly way to scroll the second screen. (The user-unfriendly way to switch screens and scroll is to press UP, DOWN or DOWN, UP quickly.)

    I've always wanted to reimplement that "2nd screen feature" as on-device app "settings" for newer devices so there could be a more conventional way of switching to the 2nd mode and scrolling, but a few things held me back:

    - I didn't have a newer device which supports on-device app settings to test with

    - When I got a newer device (945 LTE), the first test app I wrote crashed when I triggered on-device app settings for mysterious reasons, so I kinda lost interest (I didn't want to write something that would work in the sim but crash on a real device)

    - Don't really feel like diving back into active CIQ development

    - It's a lot of button presses to activate on-device settings, so I don't know how practical it is to ask the user to do that while they're running

    EDIT: I noticed that compute() isn't called while on-device settings are active, so I guess that limits a lot of can be done as far as a "2nd mode" goes.

    EDIT2: Interestingly, it's just in the sim that compute() isn't called while on-device settings are active. On a real device, compute() is called while on-device settings are active, which is a good thing for any data fields which need to compute or record data every second. Unfortunately, onUpdate() isn't called regularly on the current view for on-device settings, and calls to WatchUi.requestUpdate() are ignored, so the only way to update the view is via user input that causes the current view to change. So looks like there isn't really a good way to implement a 2nd mode using on-device settings, unless you're only interested in viewing static data, or you require the user to press a button to update the screen.

  • I realize this is over 2 years old now... but did you ever figure out a solution for this?

    I'm looking for this exact same thing. I basically want the same info that the built in Navigation data screen 'Up Ahead' has but in Data Fields instead (for just the very next labelled Course Point).  So can have next Significant Point's name, distance remaining, estimated time remaining available in data fields.  And I too would be quite happy to just implement this myself if the info was accessible in the api. Same motivation for me as your original post: I want to know how far it is to significant points that I add to the map myself and ignore turn-by-turn points / unlabeled points.

    I really wish Data fields 'Next Waypoint' / 'Distance To Next' / 'Time to Next' already worked this way (and it seems like it previously did work that way depending on how you uploaded our map but not anymore).  I don't see value in these fields showing Turn by Turn info in there when you can use 'Alerts' > 'Turn Prompts' if you want to see that info.