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

Discuss how to re-factor TileOverlay layers #61

Closed

Description

Issue #36 was about whether we should re-factor MBXMapViewTileOverlay and how TileJSON is loaded. It seems like there is some general agreement that we should in fact do that, so this ticket is for discussing how to re-factor. I want to start experimenting with some re-factored code in a new branch, and I need an issue number for it, so that's why I'm making this issue (and for comments, patches, etc once the code is written).

@incanus, I'm expecting for this experiment to be on the quick and dirty side, and that it won't get merged, so I'm going to be a little sloppy about api doc comments in header files and such. If the ideas seem good, I expect to break the work out into issues and smaller commits.

Activity

  1. ghost added this to the 0.3.0 milestone on Mar 3, 2014
  2. incanus commented on Mar 3, 2014

    @incanus
    Contributor

    Sounds great.

  3. incanus commented on Mar 3, 2014

    @incanus
    Contributor

    That's the whole point though -- you don't know whether the layer has full-world coverage or not until you get the TileJSON. That affects the toggling of canReplaceMapContent and reloading as fallout of that.

  4. incanus commented on Mar 3, 2014

    @incanus
    Contributor

    Cool, that works for me.

  5. incanus commented on Mar 3, 2014

    @incanus
    Contributor

    Per chat: maybe we just assume full coverage, let the user override with the BOOL argument we have now, but get loading without waiting for TileJSON in the default case by piecing together tile URLs. There are two cases that I want to avoid:

    • Adding an alpha transparent and/or regional overlay as above does not show Apple's map underneath, losing context, and
    • Adding a full coverage map loads Apple's maps underneath, making for a poor-looking experience and increased overhead

    The solutions don't have to be automatic, necessarily.

  6. incanus commented on Mar 3, 2014

    @incanus
    Contributor

    Third thing we don't want:

    • A regional coverage map not knowing its proper bounds and the overlay system constantly requesting tiles which will never exist on the server.
  7. incanus commented on Mar 3, 2014

    @incanus
    Contributor

    Per chat, outlining every scenario that I can think of and that the current version covers in some way. These are all various uses of mapID on our hosting and should be covered, but perhaps automatic detection of each isn't the best route.

    By Constraints below, I mean that the app developer could wish for a layer only to be used in a region or zoom range and disallow panning and/or zooming, or they could allow free use, depending upon app design.

    • OSM basemap: examples.map-pgygbwdm
      • Coverage: global
      • Transparency: no
      • Apple basemap: never
      • Constraints: N/A
      • Notes: A full-world map that should never load Apple underneath.
    • OSM overlay: justin.map-9tlo4knw
      • Coverage: global
      • Transparency: yes
      • Apple basemap: always (example: satellite)
      • Constraints: N/A
      • Notes: A full-world labels map that should always load Apple underneath for context.
    • OSM basemap: justin.map-mf07hryq
      • Coverage: global
      • Transparency: no
      • Apple basemap: always (example: labels)
      • Constraints: N/A
      • Notes: A full-world terrain map that should go at MKOverlayLevelAboveRoads and use Apple's labeling.
    • TileMill basemap (constrained): justin.NACIS2012
      • Coverage: regional
      • Transparency: no
      • Apple basemap: never
      • Constraints: regional
      • Notes: Dev constrains the app to the basemap's coverage range. Apple should never be loaded since this is the app's basemap.
    • TileMill basemap (unconstrained): justin.clp-2011-11-03-1200
      • Coverage: regional
      • Transparency: no
      • Apple basemap: always
      • Constraints: none
      • Notes: Dev does not constrain the basemap, so Apple should always load underneath so that areas of out bounds/zoom of this basemap still show a map.
    • TileMill overlay: justin.pdx_meters
      • Coverage: regional
      • Transparency: yes
      • Apple basemap: always
      • Constraints: N/A
      • Notes: Point overlay always needs Apple for context. Note that in this project, I have added an OSM basemap in the online version for context, but the tiles that come down for the overlay have transparency and no basemap.
  8. incanus commented on Mar 4, 2014

    @incanus
    Contributor

    as far as I can tell there aren't any properties related to imposing limits on scrolling and zooming other than totally turning them off.

    I think you're right here -- sorry to not clarify. I meant to say that suppose the user wants to show a view of exactly that size with panning disabled? Constrained by way of not allowing interaction.

    which reduces (but doesn't eliminate) 404's

    Why doesn't it eliminate? That seems odd. Even in the case of #35 the map view should know that the tiles won't be there.

  9. incanus commented on Mar 4, 2014

    @incanus
    Contributor

    Apple basically gives you on/off switches for pan and zoom, but that's it.

    And that's what I mean. Say you are showing a non-interactive map view at the top of a view controller that programmatically changes its center as you scroll through a table view below. The map is always at the top of the screen. In all cases, the points that you are iterating through are in your regional coverage, but in no case do you want Apple maps to load underneath. You always cover your regional area and there is no chance of the user panning outside of that region.

    Basically my take is that a few handfuls of 404's are way better than overlays failing to render consistently, crashes, or other flakey stuff of the sort I've been seeing in my experiments this afternoon.

    Ok, if that's what it looks like, 👍

  10. ghost added a commit that references this issue on Mar 5, 2014
  11. ghost added a commit that references this issue on Mar 6, 2014
  12. ghost added a commit that references this issue on Mar 6, 2014
  13. ghost added a commit that references this issue on Mar 7, 2014
  14. ghost added a commit that references this issue on Mar 7, 2014
  15. incanus commented on Mar 7, 2014

    @incanus
    Contributor

    Specific to the issue61 branch, I just opened #71 above so we have a place to discuss those particulars.

  16. ghost closed this as completedon Mar 11, 2014
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

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions