Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example labels #1785

Merged
merged 6 commits into from Mar 10, 2014
Merged

Example labels #1785

merged 6 commits into from Mar 10, 2014

Conversation

adube
Copy link
Contributor

@adube adube commented Feb 28, 2014

Add a new example demonstrating what's possible to do with labels in OL3. It includes 3 geojson dataset samples of points, lines and polygons. In addition, 3 forms allow the user to change text label styling on the-fly and see the result.

See the demo in action . See also an OpenLayers 2.12 equivalent demo.

Comments would be quite welcome.

@twpayne
Copy link
Contributor

twpayne commented Feb 28, 2014

Please can you rebase on the latest master to remove the merge commits. Thanks!

@adube
Copy link
Contributor Author

adube commented Feb 28, 2014

Sure.

@twpayne
Copy link
Contributor

twpayne commented Feb 28, 2014

Very nice example by the way!

@adube
Copy link
Contributor Author

adube commented Feb 28, 2014

Thank you.

Would you please give me a pointer: how do I remove the merge commits ?

@twpayne
Copy link
Contributor

twpayne commented Feb 28, 2014

git rebase origin/master

should do it - git is normally clever enough to strip out merge commits.

@adube
Copy link
Contributor Author

adube commented Feb 28, 2014

Sorry it's taking long, I think I messed up something. My git-fu sucks :)

@twpayne
Copy link
Contributor

twpayne commented Feb 28, 2014

It looks like you've added another merge commit.

Run

git rebase -i official-master

and delete every line that is a merge commit.

Add forms to let the user change the labels as they want.
Text 'Wrap' doesn't work properly. '\n' are supposed to allow
line to break.
Add note about the 'Text/Wrap' option currently not working.
@adube
Copy link
Contributor Author

adube commented Feb 28, 2014

git status
# On branch example-labels
# Your branch and 'origin/example-labels' have diverged,
# and have 5 and 14 different commits each, respectively.
#   (use "git pull" to merge the remote branch into yours)
#
nothing to commit, working directory clean

What do I need to do now ?

Thank you very much for your help.

@twpayne
Copy link
Contributor

twpayne commented Feb 28, 2014

git push --force <my-remote> example-labels
where <my-remote> is whatever remote represents your repository (github.com/adube/ol3.git).

@adube
Copy link
Contributor Author

adube commented Feb 28, 2014

Thank you.

@adube
Copy link
Contributor Author

adube commented Feb 28, 2014

Oh, I forgot to mention: the 'Text/Wrap' option in the example didn't work as I expected. If you compare with the OL2 example, you'll see what I mean.

In the ol3 example, the '\n' do not break the labels into multiple lines, it looks interpreted as a space character.

Typo fixes, add 1 more font
@marcjansen
Copy link
Member

+1 from me for merging this. Good work.

@twpayne
Copy link
Contributor

twpayne commented Mar 10, 2014

Oh, I forgot to mention: the 'Text/Wrap' option in the example didn't work as I expected. If you compare with the OL2 example, you'll see what I mean.

In the ol3 example, the '\n' do not break the labels into multiple lines, it looks interpreted as a space character.

This is because ol3 uses Canvas's strokeText and fillText functions that do not support text wrapping.

twpayne added a commit that referenced this pull request Mar 10, 2014
@twpayne twpayne merged commit 6cadc2b into openlayers:master Mar 10, 2014
@twpayne
Copy link
Contributor

twpayne commented Mar 10, 2014

Thanks @adube!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants