Skip to content

Commit

Permalink
更新mapv依赖
Browse files Browse the repository at this point in the history
  • Loading branch information
Junior2Ran committed Dec 30, 2019
1 parent 028e627 commit c92c48b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docs/dist/react-bmap.min.js

Large diffs are not rendered by default.

19 changes: 12 additions & 7 deletions docs/examples/build/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2144,7 +2144,7 @@ function getPooledWarningPropertyDefinition(propName, getVal) {
(factory((global.mapv = global.mapv || {})));
}(this, (function (exports) { 'use strict';

var version = "2.0.44";
var version = "2.0.47";

/**
* @author kyle / http://nikai.us/
Expand Down Expand Up @@ -3314,7 +3314,7 @@ var drawGrid = {

var size = options._size || options.size || 50;

// 后端传入数据为网格数据时,传入enableCluster为false,前端不进行删格化操作,直接画方格
// 后端传入数据为网格数据时,传入enableCluster为false,前端不进行删格化操作,直接画方格
var enableCluster = 'enableCluster' in options ? options.enableCluster : true;

var offset = options.offset || {
Expand All @@ -3335,7 +3335,7 @@ var drawGrid = {
grids[gridKey] = ~~(data[i].count || 1);
}
for (var _gridKey in grids) {
_gridKey = _gridKey.split(",");
_gridKey = _gridKey.split(',');

context.beginPath();
context.rect(+_gridKey[0] - size / 2, +_gridKey[1] - size / 2, size, size);
Expand All @@ -3348,15 +3348,16 @@ var drawGrid = {
} else {
for (var _i = 0; _i < data.length; _i++) {
var coordinates = data[_i].geometry._coordinates || data[_i].geometry.coordinates;
var gridKey = Math.floor((coordinates[0] - offset.x) / size) + "," + Math.floor((coordinates[1] - offset.y) / size);
var gridKey = Math.floor((coordinates[0] - offset.x) / size) + ',' + Math.floor((coordinates[1] - offset.y) / size);
if (!grids[gridKey]) {
grids[gridKey] = 0;
}

grids[gridKey] += ~~(data[_i].count || 1);
}

for (var _gridKey2 in grids) {
_gridKey2 = _gridKey2.split(",");
_gridKey2 = _gridKey2.split(',');

context.beginPath();
context.rect(_gridKey2[0] * size + .5 + offset.x, _gridKey2[1] * size + .5 + offset.y, size, size);
Expand Down Expand Up @@ -3385,10 +3386,14 @@ var drawGrid = {
}

for (var gridKey in grids) {
gridKey = gridKey.split(",");
gridKey = gridKey.split(',');
var text = grids[gridKey];
var textWidth = context.measureText(text).width;
context.fillText(text, gridKey[0] * size + .5 + offset.x + size / 2 - textWidth / 2, gridKey[1] * size + .5 + offset.y + size / 2 + 5);
if (!enableCluster) {
context.fillText(text, +gridKey[0] - textWidth / 2, +gridKey[1] + 5);
} else {
context.fillText(text, gridKey[0] * size + .5 + offset.x + size / 2 - textWidth / 2, gridKey[1] * size + .5 + offset.y + size / 2 + 5);
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-bmap",
"version": "1.0.110",
"version": "1.0.111",
"description": "react-bmap",
"main": "lib/index.js",
"contributors": [
Expand Down Expand Up @@ -47,7 +47,7 @@
},
"dependencies": {
"kits-js": "^0.0.7",
"mapv": "^2.0.44"
"mapv": "^2.0.47"
},
"config": {
"commitizen": {
Expand Down

0 comments on commit c92c48b

Please sign in to comment.