Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
ymaps-gridmap
Advanced tools
Readme
Yandex.Maps API module for data visualization.
Gridmap is a graphical representation of some spatial data, where depending on the number of entered points cell of grid (hexogon or square) are painted in different colors.
Gridmap
class allows to construct and display such representations over geographical maps.
Put module source code (gridmap.min.js) on your CDN.
Load both Yandex Maps JS API 2.1 and module source code by adding following code into <head> section of your page:
<script src="http://api-maps.yandex.ru/2.1/?lang=ru_RU" type="text/javascript"></script>
<!-- Change my.cdn.tld to your CDN host name -->
<script src="http://my.cdn.tld/gridmap.min.js" type="text/javascript"></script>
If you use GeoJSON data:
<script src="http://api-maps.yandex.ru/2.1/?lang=ru_RU&coordOrder=longlat" type="text/javascript"></script>
<!-- Change my.cdn.tld to your CDN host name -->
<script src="http://my.cdn.tld/gridmap.min.js" type="text/javascript"></script>
If you use npm:
<script src="http://api-maps.yandex.ru/2.1/?lang=ru_RU" type="text/javascript"></script>
npm i --save git+https://github.com/yandex-shri-fx-team/ymaps-gridmap.git
require('ymaps-gridmap');
// Or with babel
import 'ymaps-gridmap';
Get access to module functions by using ymaps.modules.require method:
ymaps.modules.require(['Gridmap'], function (Gridmap) {
var gridmap = new Gridmap();
});
Gridmap module.
Requires: module:Polygonmap
, module:util.bounds
Polygonmap
Map
Object
Object
Object
Object
Param | Type | Description |
---|---|---|
[data] | Object | Points, GeoJSON FeatureCollections. |
data.polygons | Object | GeoJSON FeatureCollections. |
data.points | Object | GeoJSON FeatureCollections. |
[options] | Object | Options for customization. See more options in Polygonmap. |
[options.zoom] | number | Zoom which will be used for the grid calculation. |
[options.grid] | GridOptions | Options which will be used in a grid calculation. |
[options.grid.type] | GridOptions | Type of grid. Can be "hexagon" |
[options.grid.params] | GridParamsOptions | Options which will be used in a grid render |
[options.grid.params.bigRadius] | number | Radius of hexagon. |
[options.grid.params.sideLength] | number | Side length of square. |
[options.grid.bouds] | GridBoundsOptions | Options of bound for render grid. |
[options.grid.bouds] | number | Options of bound for render grid. |
[options.grid.bouds.leftBottom] | Array | Coordinates of left bottom point of bound. |
[options.grid.bouds.topRight] | Array | Coordinates of right top point of bound. |
Polygonmap
Set Map instance to render Polygonmap object.
Kind: instance method of Gridmap
Returns: Polygonmap
- Self-reference.
Access: public
Param | Type | Description |
---|---|---|
map | Map | Map instance. |
Map
Get the Map instance.
Kind: instance method of Gridmap
Returns: Map
- Reference to Map instance.
Access: public
Object
Kind: inner typedef of Gridmap
Properties
Name | Type | Description |
---|---|---|
leftBotom | Array.<number> | Geographical coordinate of the left bottom point. |
rigthTop | Array.<number> | Geographical coordinate of the right top point. |
Object
Kind: inner typedef of Gridmap
Properties
Name | Type | Description |
---|---|---|
type | string | Type of grid. |
[bounds] | GridBounds | Bounds for grid. |
params | HexagonGripParams | SquareGripParams | Params of grid. |
Object
Kind: inner typedef of Gridmap
Properties
Name | Type | Description |
---|---|---|
bigRadius | number | Length of the big radius of a hexagon in pixels. |
Object
Kind: inner typedef of Gridmap
Properties
Name | Type | Description |
---|---|---|
sideLenght | number | Length of a side of square in pixels. |
ymaps.modules.require(['Gridmap'], function (Gridmap) {
const dataPoints = {
type: 'FeatureCollection',
features: [{
id: 'id1',
type: 'Feature',
geometry: {
type: 'Point',
coordinates: [37.782551, -122.445368]
}
}, {
id: 'id2',
type: 'Feature',
geometry: {
type: 'Point',
coordinates: [37.782745, -122.444586]
}
}]
};
const gridmap = new Gridmap(dataPoints);
gridmap.setMap(myMap);
});
FAQs
Yandex.Maps API module for data visualization.
The npm package ymaps-gridmap receives a total of 2 weekly downloads. As such, ymaps-gridmap popularity was classified as not popular.
We found that ymaps-gridmap demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.