geojson2svg
Advanced tools
Comparing version 1.3.4 to 1.3.5
{ | ||
"name": "geojson2svg", | ||
"version": "1.3.4", | ||
"version": "1.3.5", | ||
"description": "Converts geojson to svg/path string given svg viewport size and maps extent.", | ||
@@ -13,5 +13,5 @@ "main": "src/main.js", | ||
"changelog": "auto-changelog --commit-limit=false && git add ./CHANGELOG.md && git commit --amend", | ||
"release:minor": "standard-version --release-as minor && changelog", | ||
"release:patch": "standard-version --release-as patch && changelog", | ||
"release:major": "standard-version --release-as major && changelog", | ||
"release:patch": "npm version patch && changelog", | ||
"release:minor": "npm version minor && changelog", | ||
"release:major": "npm version major && changelog", | ||
"watch": "mocha -w" | ||
@@ -18,0 +18,0 @@ }, |
@@ -1,53 +0,89 @@ | ||
/** | ||
/*** | ||
* https://github.com/gagan-bansal/geojson2svg | ||
*/ | ||
declare module 'geojson2svg' { | ||
import { GeoJsonObject } from 'geojson'; | ||
import { GeoJSON } from 'geojson' | ||
export interface ScreenDims { | ||
width: number; | ||
height: number; | ||
width: number | ||
height: number | ||
} | ||
export interface Origin { | ||
x: number | ||
y: number | ||
} | ||
export interface Extent { | ||
left: number; | ||
right: number; | ||
bottom: number; | ||
top: number; | ||
left: number | ||
right: number | ||
bottom: number | ||
top: number | ||
} | ||
export interface StaticAttribute { | ||
type: 'static'; | ||
property: string; | ||
value: string; | ||
type: 'static' | ||
/** The output attribute name */ | ||
property: string | ||
/** The output attribute value */ | ||
value: string | ||
} | ||
export interface DynamicAttribute { | ||
type: 'dynamic'; | ||
property: string; | ||
key?: string; | ||
type: 'dynamic' | ||
/** The geojson source property name holding the output attribute value | ||
* ... also used as the output attribute name | ||
*/ | ||
property: string | ||
/** Override the output attribute name */ | ||
key?: string | ||
} | ||
export interface ObjectAttributes { | ||
[key: string]: string; | ||
[key: string]: string | ||
} | ||
export interface Options { | ||
viewportSize?: ScreenDims; | ||
mapExtent?: Extent; | ||
output?: 'svg' | 'path'; | ||
fitTo?: 'width' | 'height'; | ||
precision?: number; | ||
explode?: boolean; | ||
attributes?: (StaticAttribute | DynamicAttribute | ObjectAttributes)[] | ObjectAttributes; | ||
pointAsCircle?: boolean; | ||
r?: number; | ||
callback?: (svgString: string) => void; | ||
/** viewportSize is object containing width and height in pixels */ | ||
viewportSize?: ScreenDims | ||
/** Coordinates should be in same projection as of geojson. Default maps extent are of Web Mercator projection (EPSG:3857). */ | ||
mapExtent?: Extent | ||
/** Output format | ||
* 'svg' - svg element string is returned like '<path d="M0,0 20,10 106,40"/>' | ||
* 'path' - path 'd' value is returned 'M0,0 20,10 106,40' a linestring | ||
*/ | ||
output?: 'svg' | 'path' | ||
/** Fit ouput svg map to width or height. */ | ||
fitTo?: 'width' | 'height' | ||
/** a number, precision of output svg coordinates. */ | ||
precision?: number | ||
/** Should multigeojson be exploded to many svg elements or not. default is false. */ | ||
explode?: boolean | ||
/** Attributes which are required to attach as SVG attributes from features can be passed here as list of path in feature or json object for static attributes */ | ||
attributes?: (StaticAttribute | DynamicAttribute | ObjectAttributes)[] | ObjectAttributes | ||
/** Return geojson point objects as SVG circle elements. default is false. */ | ||
pointAsCircle?: boolean | ||
/** radius of point svg element */ | ||
r?: number | ||
/** function that will be called on every geojson conversion with output string as one input variable */ | ||
callback?: (svgString: string) => void | ||
} | ||
export default class GeoJSON2SVG { | ||
constructor(options?: Options); | ||
convert(geojson: GeoJsonObject, options?: Options): string[]; | ||
export default class g2svg { | ||
public constructor(options?: Options) | ||
public convert(geojson: GeoJSON, options?: Options): string | ||
} | ||
} | ||
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
470662
4019