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

refs #893 #992: point annotations API - #1018

Closed
incanus wants to merge 17 commits into
masterfrom
point-annotations
Closed

incanus wants to merge 17 commits into
masterfrom
point-annotations

Conversation

@incanus

@incanus incanus commented Mar 17, 2015

Copy link
Copy Markdown
Contributor

This is Phase One of the point annotations API — adding, removing, querying, and setting sprite-based symbology for point annotations.

@jfirebaugh If you have some time would you mind sharing some 👀 — especially since this relates to the GeometryTile refactor.

Two things I want to do to this next, but input is welcome:

  • Get rid of the pointer casts per fbd5511#commitcomment-10224463.
  • See about getting rid of LiveTileParser entirely and defaulting to TileParser. This was created in order to get a createBucket() and address troubles with the getLayer() API, but I think that's obsolete now.

@incanus incanus added this to the iOS Beta 1 milestone Mar 17, 2015
@incanus incanus mentioned this pull request Mar 17, 2015
6 of 7 tasks
Comment thread src/mbgl/map/live_tile.hpp Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These classes are derived from util::noncopyable already so you don't need to re-inherit it here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread src/mbgl/map/annotation.cpp Outdated

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting this one now.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread src/mbgl/map/tile_parser.hpp Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const GeometryTile&

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread include/mbgl/map/map.hpp Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't appear to be used by this header; should move to annotation.hpp.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reasoning here is because the shapes API will have it; you pass vectors of AnnotationSegment objects to represent lines in a shape.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread include/mbgl/map/annotation.hpp Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be a forward declaration instead of an include?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This leads to not seeing AnnotationSegment, and that can't be forward declared because it is used in getPoint(). That method can't be moved inside of annotation.cpp because then you get a redefinition error between the forward declaration of AnnotationSegment and the one brought into annotation.cpp with #include <mbgl/map/map.hpp>. This went really deep and doing it like this seemed the only way to keep things happy.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The underlying problem is the cyclic dependency between AnnotationManager and Map. It looks like you can break the cycle by removing Map& map from AnnotationManager and passing the max zoom to AnnotationManager::getAnnotationsInBounds and AnnotationManager::addPointAnnotations.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is weird from an API point of view — clients like Cocoa would have to query, then pass the max zoom, when it doesn't appear to need to be an argument of querying bounds for annotations (they are independent of zoom and an implementation detail).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought clients would use the API provided by Map?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ohhhh, got it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants