-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
674 additions
and
416 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
{ | ||
"extends": "google", | ||
"extends": ["eslint:recommended", "google"], | ||
"env": { | ||
"browser": true, | ||
"commonjs": true | ||
}, | ||
"parserOptions": { | ||
"ecmaVersion": 6, | ||
"sourceType": "module" | ||
}, | ||
"rules": { | ||
"max-len": ["error", {"code": 120, "ignoreStrings": true}], | ||
"require-jsdoc": "off", | ||
"comma-dangle": ["error", "never"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
.idea | ||
node_modules | ||
bundle.* | ||
node_modules/ | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
language: node_js | ||
node_js: | ||
- "5" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,176 @@ | ||
<!-- Generated by documentation.js. Update this documentation by updating the source code. --> | ||
|
||
### Table of Contents | ||
|
||
- [MapboxCircle](#mapboxcircle) | ||
- [map](#map) | ||
- [map](#map-1) | ||
- [center](#center) | ||
- [center](#center-1) | ||
- [radius](#radius) | ||
- [radius](#radius-1) | ||
- [zoom](#zoom) | ||
- [constructor](#constructor) | ||
- [\_center](#_center) | ||
- [\_radius](#_radius) | ||
- [options](#options) | ||
- [\_map](#_map) | ||
- [\_zoom](#_zoom) | ||
- [\_circle](#_circle) | ||
- [\_handles](#_handles) | ||
- [getBounds](#getbounds) | ||
- [onZoomEnd](#onzoomend) | ||
- [onCenterHandleMouseDown](#oncenterhandlemousedown) | ||
- [onCenterHandleMouseMove](#oncenterhandlemousemove) | ||
- [onCenterHandleMouseUp](#oncenterhandlemouseup) | ||
- [onRadiusHandleMouseDown](#onradiushandlemousedown) | ||
- [onRadiusHandleMouseMove](#onradiushandlemousemove) | ||
- [onRadiusHandleMouseUp](#onradiushandlemouseup) | ||
- [onMouseMove](#onmousemove) | ||
- [addTo](#addto) | ||
|
||
## MapboxCircle | ||
|
||
A `google.maps.Circle` replacement for Mapbox GL JS, rendering a "spherical cap" on top of the world. | ||
|
||
**Parameters** | ||
|
||
- `center` | ||
- `radius` | ||
- `options` | ||
|
||
### map | ||
|
||
**Parameters** | ||
|
||
- `map` **mapboxgl.Map** Target map. | ||
|
||
### map | ||
|
||
Returns **mapboxgl.Map** Mapbox map. | ||
|
||
### center | ||
|
||
**Parameters** | ||
|
||
- `newCenter` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)>** Center `[lng, lat]` coordinates. | ||
|
||
### center | ||
|
||
Returns **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)>** Center `[lng, lat]` coordinates. | ||
|
||
### radius | ||
|
||
**Parameters** | ||
|
||
- `newRadius` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Meter radius. | ||
|
||
### radius | ||
|
||
Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Circle radius. | ||
|
||
### zoom | ||
|
||
**Parameters** | ||
|
||
- `newZoom` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** New zoom level. | ||
|
||
### constructor | ||
|
||
**Parameters** | ||
|
||
- `center` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)>** Center `[lng, lat]` coordinates. | ||
- `radius` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Meter radius. | ||
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** | ||
- `options.strokeColor` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Stroke color. (optional, default `'#000000'`) | ||
- `options.fillColor` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Fill color. (optional, default `'#FB6A4A'`) | ||
- `options.fillOpacity` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Fill opacity. (optional, default `0.5`) | ||
- `options.properties` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Property metadata for Mapbox GL JS circle object. (optional, default `{}`) | ||
- `options.statusEl` **[HTMLElement](https://developer.mozilla.org/en-US/docs/Web/HTML/Element)??** HTML element for emitting debug info. | ||
|
||
### \_center | ||
|
||
### \_radius | ||
|
||
Type: [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number) | ||
|
||
### options | ||
|
||
Type: [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) | ||
|
||
### \_map | ||
|
||
Type: mapboxgl.Map | ||
|
||
### \_zoom | ||
|
||
Type: [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number) | ||
|
||
### \_circle | ||
|
||
Type: Polygon | ||
|
||
### \_handles | ||
|
||
Type: [Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<Point> | ||
|
||
### getBounds | ||
|
||
Get geodesic bounds for the circle. | ||
|
||
Returns **\[[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number), [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number), [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number), [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)]** | ||
|
||
### onZoomEnd | ||
|
||
Adjust circle precision (steps used to draw the polygon). | ||
|
||
### onCenterHandleMouseDown | ||
|
||
Disable panning, set color of center handle, add onCenterHandleMouseMove (drag) listener and wait for mouse-up. | ||
|
||
### onCenterHandleMouseMove | ||
|
||
Mouse-move listener, emulating a drag listener in conjunction with onCenterHandleMouseDown/onCenterHandleMouseUp. | ||
|
||
**Parameters** | ||
|
||
- `event` **MapMouseEvent** | ||
|
||
### onCenterHandleMouseUp | ||
|
||
Restore center handle color, re-enable panning and remove onCenterHandleMouseMove (drag) listener. | ||
|
||
### onRadiusHandleMouseDown | ||
|
||
Disable panning, set color of radius handles, add mouse-move listener and wait for mouse-up (emulating drag). | ||
|
||
### onRadiusHandleMouseMove | ||
|
||
Mouse-move listener for the radius handles, emulating a drag event with | ||
onRadiusHandleMouseDown/onRadiusHandleMouseUp. | ||
|
||
**Parameters** | ||
|
||
- `event` **MapMouseEvent** | ||
|
||
### onRadiusHandleMouseUp | ||
|
||
Restore color of radius handles, re-enable panning and deactivate existing mouse-move listener. | ||
|
||
### onMouseMove | ||
|
||
Deactivate existing mouse-down listeners, check position and add new ones for map or handle as appropriate. | ||
|
||
**Parameters** | ||
|
||
- `event` **MapMouseEvent** | ||
|
||
### addTo | ||
|
||
Set map and initialize it with Mapbox GL layers for circle artifacts. | ||
|
||
**Parameters** | ||
|
||
- `map` **mapboxgl.Map** | ||
|
||
Returns **[MapboxCircle](#mapboxcircle)** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.