-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Molly Lloyd
committed
Jan 10, 2017
1 parent
89244c7
commit 18274a3
Showing
5 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
'use strict'; | ||
|
||
const DOM = require('../../util/dom'); | ||
|
||
/** | ||
* A `LogoControl` is a control that adds the Mapbox watermark | ||
* to the map as required by the [terms of service](https://www.mapbox.com/tos/) for Mapbox | ||
* vector tiles and core styles. | ||
* | ||
* @implements {IControl} | ||
**/ | ||
|
||
class LogoControl { | ||
constructor() { | ||
} | ||
|
||
onAdd(map) { | ||
this._map = map; | ||
this._container = DOM.create('div', 'mapboxgl-ctrl'); | ||
const anchor = DOM.create('a', 'mapboxgl-ctrl-logo'); | ||
anchor.target = "_blank"; | ||
anchor.href = "https://www.mapbox.com/"; | ||
this._container.append(anchor); | ||
return this._container; | ||
} | ||
|
||
onRemove() { | ||
this._container.parentNode.removeChild(this._container); | ||
this._map = undefined; | ||
} | ||
} | ||
|
||
|
||
module.exports = LogoControl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters