Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Feature parity on Android with iOS #552

Closed

Description

@ljbade

Need to catch up to features in the iOS map.

  • make list of iOS features
    • make list of MGLMapView methods and properties
  • work out what is missing in Android
    • compare methods and properties
  • add missing features
    • add methods and properties

Activity

  1. added
    Android
    GL JS parity
    and removed on Nov 7, 2014
  2. ljbade commented on Nov 20, 2014

    @ljbade
    ContributorAuthor

    Add missing methods and properties here:

    • initWithFrame - style, and access token (will add to MapView constructor?)
    • initWithFrame - style, and access token (will add to MapView constructor?)
    • initWithFrame - access token only - default style (will add to MapView constructor?)
    • initWithFrame - no params - throws exception about needing api key (will add to MapView constructor?)
    • setAccessToken
    • viewControllerForLayoutGuides - dont think we need it in Android?
    • zoomEnabled/isZoomEnabled - turn into set/get is?
    • scrollEnabled/isScrollEnabled - turn into set/get is?
    • rotateEnabled/isRotateEnabled - turn into set/get is?
    • centerCoordinate - no animation setter/getter?
    • setCenterCoordinate - with coordinate and boolean animated params
    • zoomLevel - no animation setter/getter?
    • setZoomLevel - with coordinate and boolean animated params
    • setCenterCoordinate - with zoom level
    • direction - no animation setter/getter?
    • setDirection - with coordinate and boolean animated params
    • resetNorth
    • setStyleJSON - @incanus how does this work? i thought we werent allowed to directly set the JSON now? (also should validate JSON before passing to native in case it causes a crash)
    • getRawStyle - need way to map to a Java like JSON object
    • setRawStyle
    • bundledStyleNames - this requires JSON processing
    • useBundledStyleNamed
    • debugActive/isDebugActive
    • toggleDebug
    • resetPosition

    Events: @incanus how do these work?

    • regionWillChangeAnimated
    • regionDidChangeAnimated
    • mapViewWillStartLoadingMap
    • mapViewDidFinishLoadingMap
    • mapViewDidFailLoadingMap
    • mapViewWillStartRenderingMap
    • mapViewDidFinishRenderingMap
  3. added this to the Android merge milestone on Nov 21, 2014
  4. ljbade commented on Nov 22, 2014

    @ljbade
    ContributorAuthor

    I have also added extras (most of them leftover from June - may have copied from iOS back then):

    • get/setAccessToken
    • get/setStyleURL
    • toggleStyle - only TODO comment
    • set/getStyleOrderedLayerNames - only TODO comment
    • getAllStyleClasses - only TODO comment
    • getStyleDescriptionForLayer - only TODO comment
    • setStyleDescription - only TODO comment
    • set/getAppliedStyleClasses

    Also @incanus there are these files in iOS - what are they for?:

    • MGLTypes
    • MGLStyleFunctionValue
    • NSArray+MGLAdditions
    • NSDictionary+MGLAdditions
    • UIColor+MGLAdditions
  5. changed the title [-]Feature parity on android with ios[/-] [+]Feature parity on Android with iOS[/+] on Nov 22, 2014
  6. incanus commented on Nov 24, 2014

    @incanus
    Contributor

    Also @incanus there are these files in iOS - what are they for?:

    MGLTypes
    MGLStyleFunctionValue

    Styling-related; don't worry about this. This API is in flux and this was only a preview.

    NSArray+MGLAdditions
    NSDictionary+MGLAdditions
    UIColor+MGLAdditions

    These are how you extend core libraries (NS/UI prefix) with Objective-C categories. Not applicable to other platforms.

  7. incanus commented on Nov 24, 2014

    @incanus
    Contributor

    toggleStyle - only TODO comment
    set/getStyleOrderedLayerNames - only TODO comment
    getAllStyleClasses - only TODO comment
    getStyleDescriptionForLayer - only TODO comment
    setStyleDescription - only TODO comment
    set/getAppliedStyleClasses

    I also wouldn't worry about these — the styling API originally was for demo/potential purposes and will change dramatically in future. Just setting/getting a whole stylesheet is enough for now.

  8. ljbade commented on Nov 24, 2014

    @ljbade
    ContributorAuthor

    OK will remove style stuff for the moment.

  9. ljbade commented on Nov 25, 2014

    @ljbade
    ContributorAuthor

    @incanus what were the events I have listed above for?

  10. incanus commented on Nov 25, 2014

    @incanus
    Contributor

    regionWillChangeAnimated
    regionDidChangeAnimated
    mapViewWillStartLoadingMap
    mapViewDidFinishLoadingMap
    mapViewDidFailLoadingMap
    mapViewWillStartRenderingMap
    mapViewDidFinishRenderingMap

    These all come from an effort to mirror Apple's MKMapViewDelegate protocol, which lets the dev setup a listener of sorts that gets pinged on major map change events. These are only really necessary on Android if those sorts of lifecycle events are important to devs. This is the reason behind notify_map_change.

  11. ljbade commented on Nov 26, 2014

    @ljbade
    ContributorAuthor

    @incanus that will be handy I think, for developers to be able to set up event listeners for that stuff, will look into it

  12. removed this from the Android merge milestone on Nov 30, 2014
  13. ljbade commented on Nov 30, 2014

    @ljbade
    ContributorAuthor

    I already have a generic listener for notify map change, and another one for passing back FPS count.

    I will expand this into a more general listener that implements similar events to the delegate stuff.

  14. incanus commented on Dec 1, 2014

    @incanus
    Contributor

    When you get into this @ljbade keep in back of mind ideas of good tests. We have some pretty wordy testing of this on iOS already:

    https://github.com/mapbox/mapbox-gl-cocoa/blob/aa64e7d30ad3bb5e1b164762e40231053e8ce285/test/MapViewTests.m#L298-L345

    Which basically:

    1. Attaches a notification (sort of a system-wide message broadcast) to the listener callback in question.
    2. Adds another listener for that notification.
    3. Manipulates the map to cause the notification.
    4. Blocks the testing/main thread for a wait period.
    5. Makes sure the notification caused the test listener to update some state that we compare on.
  15. ljbade commented on Dec 1, 2014

    @ljbade
    ContributorAuthor

    Yeah once I get Android stable I want to add unit tests for the public API

  16. added this to the milestone on Feb 17, 2015
  17. jfirebaugh commented on Jul 2, 2015

    @jfirebaugh
    Contributor

    Closing here; this is old and should be covered in individual tickets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    AndroidGL JS parity

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions