-
Notifications
You must be signed in to change notification settings - Fork 53
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
Add opacity option #28
base: master
Are you sure you want to change the base?
Conversation
@@ -31,7 +32,7 @@ export default class Icon extends Leaflet.Icon { | |||
const options = this.options | |||
const pin_path = options.map_pin || mapPin | |||
|
|||
div.innerHTML = `<svg width="${options.iconSize[0]}px" height="${options.iconSize[1]}px" viewBox="${options.viewBox}" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="${pin_path}" fill="${options.markerColor}"></path></svg>` | |||
div.innerHTML = `<svg width="${options.iconSize[0]}px" height="${options.iconSize[1]}px" viewBox="${options.viewBox}" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="${pin_path}" fill="${options.markerColor}" opacity="${options.opacity}"></path></svg>` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long.
'template literal syntax' is only available in ES6 (use 'esversion: 6').
Identifier 'pin_path' is not in camel case.
Missing semicolon.
@@ -57,7 +58,7 @@ var Icon = function (_Leaflet$Icon) { | |||
var options = this.options; | |||
var pin_path = options.map_pin || mapPin; | |||
|
|||
div.innerHTML = '<svg width="' + options.iconSize[0] + 'px" height="' + options.iconSize[1] + 'px" viewBox="' + options.viewBox + '" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="' + pin_path + '" fill="' + options.markerColor + '"></path></svg>'; | |||
div.innerHTML = '<svg width="' + options.iconSize[0] + 'px" height="' + options.iconSize[1] + 'px" viewBox="' + options.viewBox + '" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="' + pin_path + '" fill="' + options.markerColor + '" opacity="' + options.opacity + '"></path></svg>'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long.
Identifier 'pin_path' is not in camel case.
@@ -43,7 +44,7 @@ var Icon = function (_Leaflet$Icon) { | |||
function Icon(options) { | |||
_classCallCheck(this, Icon); | |||
|
|||
var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(Icon).call(this, options)); | |||
var _this = _possibleConstructorReturn(this, (Icon.__proto__ || Object.getPrototypeOf(Icon)).call(this, options)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long.
The 'proto' property is deprecated.
@@ -176,7 +177,7 @@ return /******/ (function(modules) { // webpackBootstrap | |||
var options = this.options; | |||
var pin_path = options.map_pin || mapPin; | |||
|
|||
div.innerHTML = '<svg width="' + options.iconSize[0] + 'px" height="' + options.iconSize[1] + 'px" viewBox="' + options.viewBox + '" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="' + pin_path + '" fill="' + options.markerColor + '"></path></svg>'; | |||
div.innerHTML = '<svg width="' + options.iconSize[0] + 'px" height="' + options.iconSize[1] + 'px" viewBox="' + options.viewBox + '" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="' + pin_path + '" fill="' + options.markerColor + '" opacity="' + options.opacity + '"></path></svg>'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long.
@@ -162,7 +163,7 @@ return /******/ (function(modules) { // webpackBootstrap | |||
function Icon(options) { | |||
_classCallCheck(this, Icon); | |||
|
|||
var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(Icon).call(this, options)); | |||
var _this = _possibleConstructorReturn(this, (Icon.__proto__ || Object.getPrototypeOf(Icon)).call(this, options)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long.
This pull request allows giving opacity to the marker. Leaflet API allows giving opacity to markers, so it should be possible to implement opacity with this library.