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

Add opacity option #28

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add opacity option #28

wants to merge 1 commit into from

Conversation

olzraiti
Copy link

@olzraiti olzraiti commented Dec 8, 2016

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.

@@ -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>`
Copy link
Collaborator

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>';
Copy link
Collaborator

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));
Copy link
Collaborator

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>';
Copy link
Collaborator

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));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Line is too long.

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.

2 participants