react-mad-map
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -1341,3 +1341,3 @@ 'use strict'; | ||
overflow: 'hidden', | ||
background: backgroundColor || '#fff', | ||
background: backgroundColor || '#000', | ||
touchAction: touchEvents ? twoFingerDrag ? 'pan-x pan-y' : 'none' : 'auto' | ||
@@ -1375,3 +1375,4 @@ }; | ||
provider: function provider(x, y, z) { | ||
return 'https://maps.basemaps.cartocdn.com/light_all/' + z + '/' + x + '/' + y + '.png'; | ||
var s = String.fromCharCode(97 + (x + y + z) % 3); | ||
return 'https://' + s + '.basemaps.cartocdn.com/dark_all/' + z + '/' + x + '/' + y + '.png'; | ||
}, | ||
@@ -1467,3 +1468,5 @@ limitBounds: 'center', | ||
_this4.state = { | ||
hover: false | ||
hover: false, | ||
width: 20, | ||
height: 29 | ||
}; | ||
@@ -1495,2 +1498,4 @@ return _this4; | ||
var _props4 = this.props, | ||
width = _props4.width, | ||
height = _props4.height, | ||
left = _props4.left, | ||
@@ -1516,3 +1521,8 @@ top = _props4.top, | ||
}, | ||
React__default.createElement('img', { src: this.props.icon, width: 29, height: 34, alt: '' }) | ||
this.props.icon && React__default.createElement('img', { src: this.props.icon, width: width || this.state.width, height: height || this.props.height, alt: 'Marker' }), | ||
!this.props.icon && React__default.createElement( | ||
'svg', | ||
{ width: width || this.state.width, height: height || this.props.height, viewBox: '0 0 13 18', fill: 'none', xmlns: 'http://www.w3.org/2000/svg' }, | ||
React__default.createElement('path', { d: 'M6.5 0C2.91014 0 0 2.90163 0 6.48098C0 10.1529 4.08943 15.5729 5.78129 17.657C6.15271 18.1143 6.84729 18.1143 7.21871 17.657C8.91057 15.5729 13 10.1529 13 6.48098C13 2.90163 10.0899 0 6.5 0ZM6.5 8.79562C5.21764 8.79562 4.17857 7.75959 4.17857 6.48098C4.17857 5.20238 5.21764 4.16635 6.5 4.16635C7.78236 4.16635 8.82143 5.20238 8.82143 6.48098C8.82143 7.75959 7.78236 8.79562 6.5 8.79562Z', fill: '#CA2227' }) | ||
) | ||
); | ||
@@ -1525,2 +1535,5 @@ }; | ||
process.env.NODE_ENV !== "production" ? Marker.propTypes = { | ||
width: PropTypes.number, | ||
height: PropTypes.number, | ||
// input, passed to events | ||
@@ -1527,0 +1540,0 @@ anchor: PropTypes.array.isRequired, |
{ | ||
"name": "react-mad-map", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "React Mad Map", | ||
@@ -5,0 +5,0 @@ "author": "Denisoed", |
# Mad Map - Light React Map | ||
[![Developed by Mad Devs](https://maddevs.io/badge-dark.svg)](https://maddevs.io) | ||
| ||
![](MadMap.jpg) | ||
@@ -17,6 +20,2 @@ | ||
zoom: 7, | ||
provider: (x, y, z) => { | ||
const s = String.fromCharCode(97 + (x + y + z) % 3) | ||
return `https://${s}.basemaps.cartocdn.com/dark_all/${z}/${x}/${y}.png` | ||
}, | ||
metaWheelZoom: false, | ||
@@ -45,3 +44,7 @@ twoFingerDrag: false, | ||
zoom={this.state.zoom} | ||
provider={this.state.provider} | ||
// provider={(x, y, z) => { | ||
// const s = String.fromCharCode(97 + (x + y + z) % 3) | ||
// return `https://${s}.basemaps.cartocdn.com/dark_all/${z}/${x}/${y}.png` // List providers https://leaflet-extras.github.io/leaflet-providers/preview | ||
// }} | ||
// backgroundColor={'#fff'} | ||
dprs={[1, 2]} | ||
@@ -56,3 +59,2 @@ animate={this.state.animate} | ||
maxZoom={this.state.maxZoom} | ||
backgroundColor={'#000'} | ||
boxClassname="mad-map" | ||
@@ -68,3 +70,2 @@ > | ||
> More examples can be found in the demo/demo.js file | ||
## Options: | ||
@@ -158,2 +159,6 @@ | ||
**payload** - Coordinates `[[lat, lng], zoom]` marker | ||
**payload** - Coordinates `[[lat, lng], zoom]` marker | ||
**width** - Width custom marker. Default `20` | ||
**height** - Height custom marker. Default `29` |
@@ -129,3 +129,4 @@ import React, { Component } from 'react' | ||
provider: (x, y, z) => { | ||
return `https://maps.basemaps.cartocdn.com/light_all/${z}/${x}/${y}.png` | ||
const s = String.fromCharCode(97 + (x + y + z) % 3) | ||
return `https://${s}.basemaps.cartocdn.com/dark_all/${z}/${x}/${y}.png` | ||
}, | ||
@@ -1283,3 +1284,3 @@ limitBounds: 'center', | ||
overflow: 'hidden', | ||
background: backgroundColor || '#fff', | ||
background: backgroundColor || '#000', | ||
touchAction: touchEvents ? (twoFingerDrag ? 'pan-x pan-y' : 'none') : 'auto' | ||
@@ -1308,2 +1309,5 @@ } | ||
static propTypes = { | ||
width: PropTypes.number, | ||
height: PropTypes.number, | ||
// input, passed to events | ||
@@ -1337,3 +1341,5 @@ anchor: PropTypes.array.isRequired, | ||
this.state = { | ||
hover: false | ||
hover: false, | ||
width: 20, | ||
height: 29 | ||
} | ||
@@ -1381,3 +1387,3 @@ } | ||
render () { | ||
const { left, top, onClick } = this.props | ||
const { width, height, left, top, onClick } = this.props | ||
@@ -1398,3 +1404,8 @@ const style = { | ||
> | ||
<img src={this.props.icon} width={29} height={34} alt='' /> | ||
{this.props.icon && <img src={this.props.icon} width={width || this.state.width} height={height || this.props.height} alt='Marker' />} | ||
{!this.props.icon && | ||
<svg width={width || this.state.width} height={height || this.props.height} viewBox="0 0 13 18" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||
<path d="M6.5 0C2.91014 0 0 2.90163 0 6.48098C0 10.1529 4.08943 15.5729 5.78129 17.657C6.15271 18.1143 6.84729 18.1143 7.21871 17.657C8.91057 15.5729 13 10.1529 13 6.48098C13 2.90163 10.0899 0 6.5 0ZM6.5 8.79562C5.21764 8.79562 4.17857 7.75959 4.17857 6.48098C4.17857 5.20238 5.21764 4.16635 6.5 4.16635C7.78236 4.16635 8.82143 5.20238 8.82143 6.48098C8.82143 7.75959 7.78236 8.79562 6.5 8.79562Z" fill="#CA2227"/> | ||
</svg> | ||
} | ||
</div> | ||
@@ -1401,0 +1412,0 @@ ) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
117410
2671
159