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

[Qt] Add docs for QMapboxGL - #7571

Merged
tmpsantos merged 6 commits into
masterfrom
tmpsantos-qt_docs
Jan 3, 2017
Merged

tmpsantos merged 6 commits into
masterfrom
tmpsantos-qt_docs

Conversation

@tmpsantos

Copy link
Copy Markdown
Contributor

Document the low level API.

@mention-bot

Copy link
Copy Markdown

@tmpsantos, thanks for your PR! By analyzing this pull request, we identified @1ec5 and @jfirebaugh to be potential reviewers.

@tmpsantos tmpsantos self-assigned this Jan 2, 2017
@tmpsantos
tmpsantos force-pushed the tmpsantos-qt_docs branch 2 times, most recently from 5a5507e to 4dc9b3f Compare January 2, 2017 16:36

/*!
\property QMapboxGL::bearing
\brief the map bearing in degrees.

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.

Clockwise or counterclockwise?

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.

counter, gonna add that 👍

/*!
\property QMapboxGL::pitch
\brief the map pitch in radians.

@1ec5 1ec5 Jan 2, 2017 •

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.

0.60 radians? I think the property is actually in degrees.

d_ptr->mapObj->setGestureInProgress(inProgress);
}

/*!

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.

It might be worth mentioning core support for classes are deprecated, as per comments in the specification.

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.

Nice catch. I also add the tag /deprecated on the docs.

@lyzidiamond lyzidiamond left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This looks good! I'm not super familiar with the library, so the edits here are mostly for grammar and clarity.

Comment thread platform/qt/src/qmapboxgl.cpp Outdated
\enum QMapboxGLSettings::GLContextMode

This enum set the expectations towards the GL state.
This enum sets the expectations towards the GL state.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can we assume users know what an enum is? I assume yes, but just wanna make sure.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Another option: change it to Sets the expectations for the GL state.

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.

@lyzidiamond yes, enum is what the developers expect. 👍


/*!
\enum QMapboxGLSettings::ConstrainMode

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Unsure about the language here: what do you mean by "sets"? Does it set itself or does the user have to set it? Like above, can change to Determines if the map wraps or similar.


This enum sets whenever a map should wrap.

\value NoConstrain The map will wrap on the horizontal axis. Since it doesn't

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

a Mercator projection --> the Web Mercator projection

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

remove "simply"

make sense to wrap on the vertical axis in a Mercator projection, the map will simply scroll
and show some empty space.

\value ConstrainHeightOnly The map will wrap around the horizontal axis, like a spinning

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is usually what you want --> (recommended)


\value ConstrainHeightOnly The map will wrap around the horizontal axis, like a spinning
globe. This is usually what you want.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

restrict --> restricted


/*!
\property QMapboxGL::zoom
\brief the map zoom factor.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Zooms the map.

@@ -471,26 +668,52 @@ void QMapboxGL::setGestureInProgress(bool inProgress)
d_ptr->mapObj->setGestureInProgress(inProgress);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remove "classes are like filters"

}

void QMapboxGL::addAnnotationIcon(const QString &name, const QImage &sprite)
/*!

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

some drawing --> any drawing

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

the name --> its name

Comment thread platform/qt/src/qmapboxgl.cpp Outdated
void QMapboxGL::addAnnotationIcon(const QString &name, const QImage &sprite)
/*!
Adds an \a icon to the annotation icon pool. This can be later used by the annotation
functions to shown some drawing on the map by referencing the \a name.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Unlike using addIcon() for runtime styling, annotations added with addPointAnnotation() will survive style changes.


/*!
\property QMapboxGL::margins
\brief the map margins in pixels from the corners of the map.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sets a new reference center for the map.

@tmpsantos

Copy link
Copy Markdown
Contributor Author

@1ec5 @lyzidiamond thanks a lot for reviewing!

@brunoabinader brunoabinader left a comment

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.

🎉

@tmpsantos
tmpsantos merged commit 5ac72ce into master Jan 3, 2017
@tmpsantos
tmpsantos deleted the tmpsantos-qt_docs branch January 3, 2017 18:52

/*!
\property QMapboxGL::longitude
\brief the map current longitude in degrees.

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.

What happens if the map rejects the longitude? Does it move to a constrained longitude, or to a wrapped longitude, or does the map refuse to move?

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.

@1ec5 it gets constrained, I will clarify that. 👍

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.

s/constrained/wrapped

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.

Fixed on #7594, thanks for reviewing!

@tmpsantos tmpsantos added the Qt Mapbox Maps SDK for Qt, aka Qt Location Mapbox GL label Jan 4, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Qt Mapbox Maps SDK for Qt, aka Qt Location Mapbox GL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants