@impargo/react-here-maps
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -8,9 +8,11 @@ /// <reference types="heremaps" /> | ||
} | ||
export interface mapStyles { | ||
style?: object; | ||
arrows?: object; | ||
} | ||
export interface RoutesProps { | ||
points?: Coordinates[]; | ||
fillColor?: string; | ||
strokeColor?: string; | ||
lineWidth?: number; | ||
data?: object; | ||
zIndex?: number; | ||
mapStyles?: mapStyles; | ||
} | ||
@@ -30,5 +32,9 @@ export interface RoutesContext { | ||
static defaultProps: { | ||
lineWidth: number; | ||
fillColor: string; | ||
strokeColor: string; | ||
mapStyles: { | ||
style: { | ||
strokeColor: string; | ||
fillColor: string; | ||
lineWidth: number; | ||
}; | ||
}; | ||
}; | ||
@@ -35,0 +41,0 @@ componentWillReceiveProps(nextProps: RoutesProps): void; |
@@ -48,3 +48,3 @@ "use strict"; | ||
var _a = this.context, map = _a.map, routesGroup = _a.routesGroup; | ||
var _b = this.props, lineWidth = _b.lineWidth, fillColor = _b.fillColor, strokeColor = _b.strokeColor, data = _b.data, zIndex = _b.zIndex; | ||
var _b = this.props, mapStyles = _b.mapStyles, data = _b.data, zIndex = _b.zIndex; | ||
if (routesGroup) { | ||
@@ -58,3 +58,3 @@ var route_1; | ||
}); | ||
routeLine = new H.map.Polyline(route_1, { style: { lineWidth: lineWidth, fillColor: fillColor, strokeColor: strokeColor }, zIndex: zIndex, data: data }); | ||
routeLine = new H.map.Polyline(route_1, { style: mapStyles.style, arrows: mapStyles.arrows, zIndex: zIndex, data: data }); | ||
routesGroup.addObject(routeLine); | ||
@@ -70,3 +70,11 @@ this.route = route_1; | ||
}; | ||
Route.defaultProps = { lineWidth: 4, fillColor: 'blue', strokeColor: 'blue' }; | ||
Route.defaultProps = { | ||
mapStyles: { | ||
style: { | ||
strokeColor: 'blue', | ||
fillColor: 'blue', | ||
lineWidth: 4 | ||
} | ||
} | ||
}; | ||
return Route; | ||
@@ -73,0 +81,0 @@ }(React.Component)); |
{ | ||
"name": "@impargo/react-here-maps", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "React.js HERE Maps component", | ||
@@ -5,0 +5,0 @@ "main": "dist/main.js", |
1073
62478
33