Skip to content

Make changing the label of ZoomToExtent/FullScreen control consistent #3135

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

Merged
merged 3 commits into from
Jan 29, 2015

Conversation

tsauerwein
Copy link
Member

Right now the label for the controls ZoomToExtent and FullScreen is set via a :after style in CSS. To change the label, you would have to overwrite that CSS style. To be consistent with the other controls, I added a label property to the options.

Now, also the following would be possible to use the Bootstrap Glyphicons:

  new ol.control.ZoomToExtent(/** @type {olx.control.ZoomToExtentOptions} */ ({
    extent: extent,
    label: goog.dom.htmlToDocumentFragment(
        '<span class="glyphicon glyphicon-search" aria-hidden="true"></span>')
   //  or with jQuery:
   // label: $('...')
  }))

@@ -37,13 +36,33 @@ ol.control.FullScreen = function(opt_options) {
this.cssClassName_ = goog.isDef(options.className) ?
options.className : 'ol-full-screen';

var label = goog.isDef(options.label) ?
options.label : '\u2194';
Copy link
Member

Choose a reason for hiding this comment

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

Super super minor: you could probably use one line instead of two here.

@elemoine
Copy link
Member

This looks great to me. Thanks a lot for making this consistent across all the controls!

Please merge.

tsauerwein pushed a commit that referenced this pull request Jan 29, 2015
Make changing the label of ZoomToExtent/FullScreen control consistent
@tsauerwein tsauerwein merged commit aa67078 into openlayers:master Jan 29, 2015
@tsauerwein tsauerwein deleted the control-label branch January 29, 2015 14:03
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.

3 participants