-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
src/components/MapControlButton.js
(#329)
* Add `src/components/MapControlButton.js` * Update imports within `control.js` * Export `MapControlButton.js` component * update @SInCE tag --------- Co-authored-by: volterra79 <[email protected]>
- Loading branch information
1 parent
efe9d94
commit 2b2023c
Showing
3 changed files
with
48 additions
and
36 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/** | ||
* @file | ||
* @since v3.9 | ||
*/ | ||
|
||
export default function ({ className, customClass, tipLabel, label }) { | ||
return { | ||
functional: true, | ||
render(h) { | ||
return h('div', { | ||
class: { | ||
[className]: !!className, | ||
'ol-unselectable': true, | ||
'ol-control': true | ||
} | ||
}, [ | ||
h('button', { | ||
attrs: { | ||
type: 'button', | ||
}, | ||
directives: [{ | ||
name: 't-tooltip', | ||
value: tipLabel | ||
}] | ||
}, [ | ||
label, | ||
h('i', { | ||
class: { | ||
[customClass]: !!customClass | ||
} | ||
}) | ||
]) | ||
] | ||
) | ||
} | ||
}; | ||
}; |
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