Skip to content

Commit

Permalink
v0.10.1
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulLeCam committed Feb 22, 2016
1 parent 17f8d12 commit f02e9d6
Show file tree
Hide file tree
Showing 35 changed files with 1,013 additions and 745 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
"react/jsx-max-props-per-line": 0,
"react/jsx-no-duplicate-props": 2,
"react/jsx-no-undef": 2,
"react/jsx-sort-prop-types": 1,
"react/jsx-sort-props": 1,
"react/jsx-uses-react": 1,
"react/jsx-uses-vars": 1,
Expand All @@ -94,6 +93,7 @@
"react/require-extension": 1,
"react/self-closing-comp": 1,
"react/sort-comp": 1,
"react/sort-prop-types": 1,
"react/wrap-multilines": 1
}
}
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## HEAD (unreleased)
## v0.10.1 (22/02/16)

- Added the popup container as source layer to `Popup` creation, fixes [#113](https://github.com/PaulLeCam/react-leaflet/issues/113) ([PR #112](https://github.com/PaulLeCam/react-leaflet/pull/112) by *amarant*).
- [internal] Updated Lodash to v4.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2015 Paul Le Cam
Copyright (c) 2016 Paul Le Cam

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
140 changes: 93 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Check Leaflet documentation for the events associated to each component.

### Components

The properties documented for each component are the ones aimed to be supported (tested and made dynamic when possible) by React-Leaflet.
The properties documented as **dynamic properties** are updated using the relevant Leaflet setter, other properties will *not* update the component when they are changed after the component is mounted.
All other properties are passed as the `options` argument to their corresponding Leaflet element and should work fine for static maps, it is however unlikely that they would updated if you change them afterwards.

You can directly access the Leaflet element created by a component using the `getLeafletElement()` method on this component. This leaflet element is usually created in `componentWillMount()`, except for the `Map` component where it can only be created after the `<div>` container is rendered.
Expand All @@ -120,66 +120,77 @@ It exposes a `getLeafletElement()` method to access the `Leaflet` object created

##### MapLayer

Base class extending `MapComponent` using the provided `map` prop to add its element and passing it down to its children.
Base class extending [`MapComponent`](#mapcomponent) using the provided `map` prop to add its element and passing it down to its children.
It exposes the following methods:
- `getClonedChildrenWithMap(object extra): object`: returns the cloned children of the component, adding the `map` and the `extra` props provided to them.
- `renderChildrenWithProps(object props): object`: returns the cloned children of the component using `getClonedChildrenWithMap()`, wrapped in a `<div>` with `display: none` style.

##### BaseTileLayer

Base class extending `MapLayer` with a `render()` method and handling a TitleLayer `opacity` and `zIndex` props.
Base class extending [`MapLayer`](#maplayer) with a `render()` method and handling a TitleLayer `opacity` and `zIndex` props.

##### Path

Base class extending `MapLayer` with the following methods:
Base class extending [`MapLayer`](#maplayer) with the following methods:
- `getPathOptions(object props): object`: filters the input `props` and return a new object of [Path options](http://leafletjs.com/reference.html#path-options) properties.
- `setStyle(object options = {}): void`: alias to the Leaflet element [`setStyle()`](http://leafletjs.com/reference.html#path-setstyle).
- `setStyleIfChanged(object fromProps, object toProps): void`: extracts the Path options of the two arguments, and calls `setStyle()` with the new options if different from the previous ones.

#### Map

This is the top-level component that must be mounted for children ones to be rendered. Refer to Leaflet documentation for more information about the properties.
This is the top-level component that must be mounted for children ones to be rendered. Refer to [Leaflet documentation](http://leafletjs.com/reference.html#map-options) for more information about the properties.

**Properties**
- `bounds: bounds` (optional, dynamic): A rectangle for the map to contain. It will be centered, and the map will zoom in as close as it can while still showing the full bounds. This property is dynamic, if you change it it will be reflected on the map.
- `boundsOptions: object` (optional, dynamic): Options passed to the `fitBounds()` method.
- `center: latLng` (optional, dynamic): Center of the map. This property is dynamic, if you change it it will be reflected in the map.
- `className: string` (optional, dynamic): className property of the `<div>` container for the map.
**Dynamic properties**
- `bounds: bounds` (optional): A rectangle for the map to contain. It will be centered, and the map will zoom in as close as it can while still showing the full bounds. This property is dynamic, if you change it it will be reflected on the map.
- `boundsOptions: object` (optional): Options passed to the `fitBounds()` method.
- `center: latLng` (optional): Center of the map. This property is dynamic, if you change it it will be reflected in the map.
- `className: string` (optional): className property of the `<div>` container for the map.
- `maxBounds: bounds` (optional)
- `style: object` (optional): style property of the `<div>` container for the map.
- `zoom: number` (optional)

**Other properties**
- `id: string` (optional): The ID of the `<div>` container for the map. If you don't provide it, a unique one will be created.
- `maxBounds: bounds` (optional, dynamic)
- `maxZoom: number` (optional)
- `minZoom: number` (optional)
- `style: object` (optional, dynamic): style property of the `<div>` container for the map.
- `zoom: number` (optional, dynamic)

#### UI Layers

##### Marker

- `position: latLng` (required, dynamic)
- `icon: Leaflet.Icon` (optional, dynamic)
- `zIndexOffset: number` (optional, dynamic)
- `opacity: number` (optional, dynamic)
[Leaflet reference](http://leafletjs.com/reference.html#marker)

**Dynamic properties**
- `position: latLng` (required)
- `icon: Leaflet.Icon` (optional)
- `zIndexOffset: number` (optional)
- `opacity: number` (optional)

##### Popup

[Leaflet reference](http://leafletjs.com/reference.html#popup)

The Popup children will be rendered using `ReactDOM.render()`, they must be valid React elements.

- `position: latLng` (optional, dynamic)
**Dynamic properties**
- `position: latLng` (optional)

#### Raster Layers

##### TileLayer

- `url: string` (required, dynamic)
- `opacity: number` (optional, dynamic)
- `zIndex: number` (optional, dynamic)
[Leaflet reference](http://leafletjs.com/reference.html#tilelayer)

**Dynamic properties**
- `url: string` (required)
- `opacity: number` (optional)
- `zIndex: number` (optional)

##### ImageOverlay

- `url: string` (required, dynamic)
- `opacity: number` (optional, dynamic)
- `attribution: string` (optional)
[Leaflet reference](http://leafletjs.com/reference.html#imageoverlay)

**Dynamic properties**
- `url: string` (required)
- `opacity: number` (optional)

##### Implemented but needing testing and documentation

Expand All @@ -192,32 +203,53 @@ All vector layers extend the **Path** component and therefore accept dynamic [Pa

##### Circle

- `center: latLng` (required, dynamic)
- `radius: number` (required, dynamic)
[Leaflet reference](http://leafletjs.com/reference.html#circle)

**Dynamic properties**
- `center: latLng` (required)
- `radius: number` (required)

##### CircleMarker

- `center: latLng` (required, dynamic)
- `radius: number` (optional, dynamic)
[Leaflet reference](http://leafletjs.com/reference.html#circlemarker)

**Dynamic properties**
- `center: latLng` (required)
- `radius: number` (optional)

##### Polyline

- `positions: latLngList` (required, dynamic)
[Leaflet reference](http://leafletjs.com/reference.html#polyline)

**Dynamic properties**
- `positions: latLngList` (required)

##### MultiPolyline

- `polylines: array<latLngList>` (required, dynamic)
[Leaflet reference](http://leafletjs.com/reference.html#multipolyline)

**Dynamic properties**
- `polylines: array<latLngList>` (required)

##### Polygon

- `positions: latLngList | Array<latLngList>` (required, dynamic)
[Leaflet reference](http://leafletjs.com/reference.html#polygon)

**Dynamic properties**
- `positions: latLngList | Array<latLngList>` (required)

##### MultiPolygon

- `polygons: array<latLngList>` (required, dynamic)
[Leaflet reference](http://leafletjs.com/reference.html#multipolygon)

**Dynamic properties**
- `polygons: array<latLngList>` (required)

##### Rectangle

[Leaflet reference](http://leafletjs.com/reference.html#rectangle)

**Dynamic properties**
- `bounds: bounds` (required, dynamic)

#### Other Layers
Expand All @@ -232,30 +264,44 @@ Extended `LayerGroup` supporting a `Popup` child.

##### GeoJson

- `data: GeoJSON` (required)
[Leaflet reference](http://leafletjs.com/reference.html#geojson)

**Properties**
- `data: GeoJSON` (required). This property will *not* be updated if it is changed after the component is mounted.

#### Controls

##### AttributionControl

- `position: controlPosition` (optional, dynamic)
- `prefix: string` (optional)
[Leaflet reference](http://leafletjs.com/reference.html#control-attribution)

**Dynamic properties**
- `position: controlPosition` (optional)

##### LayersControl

[Leaflet reference](http://leafletjs.com/reference.html#control-layers)

**Dynamic properties**
- `position: controlPosition` (optional)

**Other properties**
- `baseLayers: object` (optional)
- `overlays: object` (optional)

##### ScaleControl

- `imperial: bool` (optional)
- `position: controlPosition` (optional, dynamic)
- `maxWidth: number` (optional)
- `metric: bool` (optional)
- `updateWhenIdle: bool` (optional)
[Leaflet reference](http://leafletjs.com/reference.html#control-scale)

**Dynamic properties**
- `position: controlPosition` (optional)

##### ZoomControl

- `position: controlPosition` (optional, dynamic)
- `zoomInText: string` (optional)
- `zoomInTitle: string` (optional)
- `zoomOutText: string` (optional)
- `zoomOutTitle: string` (optional)
[Leaflet reference](http://leafletjs.com/reference.html#control-zoom)

**Dynamic properties**
- `position: controlPosition` (optional)

## Creating custom components

Expand Down
4 changes: 2 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "react-leaflet",
"version": "0.10.0",
"version": "0.10.1",
"homepage": "https://github.com/PaulLeCam/react-leaflet",
"authors": [
"Paul Le Cam <[email protected]>"
],
"description": "React components for Leaflet maps",
"main": "lib/index.js",
"dependencies": {
"lodash": "~3.0.0",
"lodash": "~4.0.0",
"leaflet": "~0.7.0",
"react": "~0.14.0"
},
Expand Down
Loading

0 comments on commit f02e9d6

Please sign in to comment.