Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update azure-maps-control version #4

Merged
merged 10 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

strategy:
matrix:
node-version: [14.x, 16.x, 18.x, 20.x]
node-version: [16.x, 18.x, 20.x, 22.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
Expand All @@ -30,3 +30,5 @@ jobs:
cache: 'npm'
- run: npm ci --force
- run: npm run build --if-present
- run: python -m pip install linkcheckmd
- run: python -m linkcheckmd README.md
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Azure Maps Gridded Data Source module Changelog

<a name="0.0.3"></a>
## 0.0.3 (Unreleased)

- Update dependencies versions.
- Update readme links.

<a name="0.0.2"></a>
## 0.0.2 (2021-10-1)

Expand Down
31 changes: 14 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,17 @@ A couple of the key features of this module:

| Name | Image | Description |
|-------|------|-------------|
| Hexagon | ![hexagon grid](https://github.com/Azure-Samples/azure-maps-gridded-data-source/blob/main/docs/images/hexagon.png) | A haxagon grid where the top of the hexagon is flat. |
| Pointy hexagon | ![pointy hexagon grid](https://github.com/Azure-Samples/azure-maps-gridded-data-source/blob/main/docs/images/pointyhexagon.png) | A haxagon grid where the top of the hexagon is pointy. |
| Square | ![square grid](https://github.com/Azure-Samples/azure-maps-gridded-data-source/blob/main/docs/images/square.png) | A sguare grid. |
| Triangle | ![triangle grid](https://github.com/Azure-Samples/azure-maps-gridded-data-source/blob/main/docs/images/triangle.png) | A triangular grid. |
| Circle | ![circle grid](https://github.com/Azure-Samples/azure-maps-gridded-data-source/blob/main/docs/images/circle.png) | A square grid where cells are converted into circles. The circle does not cover the entire area the cell represents, but does include all points that would fall within the specified grid cell. |
| Hexagon circle | ![hexagon circle grid](https://github.com/Azure-Samples/azure-maps-gridded-data-source/blob/main/docs/images/hexcircle.png) | A haxagon grid where cells are converted into circles. The circle does not cover the entire area the cell represents, but does include all points that would fall within the specified grid cell. |
| Hexagon | ![hexagon grid](https://github.com/Azure-Samples/azure-maps-gridded-data-source/raw/main/docs/images/hexagon.png) | A haxagon grid where the top of the hexagon is flat. |
| Pointy hexagon | ![pointy hexagon grid](https://github.com/Azure-Samples/azure-maps-gridded-data-source/raw/main/docs/images/pointyhexagon.png) | A haxagon grid where the top of the hexagon is pointy. |
| Square | ![square grid](https://github.com/Azure-Samples/azure-maps-gridded-data-source/raw/main/docs/images/square.png) | A sguare grid. |
| Triangle | ![triangle grid](https://github.com/Azure-Samples/azure-maps-gridded-data-source/raw/main/docs/images/triangle.png) | A triangular grid. |
| Circle | ![circle grid](https://github.com/Azure-Samples/azure-maps-gridded-data-source/raw/main/docs/images/circle.png) | A square grid where cells are converted into circles. The circle does not cover the entire area the cell represents, but does include all points that would fall within the specified grid cell. |
| Hexagon circle | ![hexagon circle grid](https://github.com/Azure-Samples/azure-maps-gridded-data-source/raw/main/docs/images/hexcircle.png) | A haxagon grid where cells are converted into circles. The circle does not cover the entire area the cell represents, but does include all points that would fall within the specified grid cell. |

**Credit**

A lot of the hexagon grid based algorithms came from this [awesome site](https://www.redblobgames.com/grids/hexagons/).

Triangle grid calculations are based on this [blog post](http://csharphelper.com/blog/2015/10/draw-a-triangular-grid-in-c/)

## Getting started

Download the project and copy the `azure-maps-gridded-data-source` JavaScript file from the `dist` folder into your project.
Expand All @@ -46,14 +44,14 @@ See the [documentation](https://github.com/Azure-Samples/azure-maps-gridded-data

## Samples

[Extruded gridded data source](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Extruded%20gridded%20data%20source)
<br/>[<img src="https://github.com/Azure-Samples/AzureMapsCodeSamples/raw/master/AzureMapsCodeSamples/SiteResources/screenshots/Extruded-gridded-data-source.jpg" height="200px">](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Extruded%20gridded%20data%20source)
[Extruded gridded data source](https://samples.azuremaps.com/?search=gridded&sample=extruded-gridded-data-source)
<br/>[<img src="https://samples.azuremaps.com/polygons/extruded-gridded-data-source/screenshot.jpg" height="200px">](https://samples.azuremaps.com/?search=gridded&sample=extruded-gridded-data-source)

[Show points of gridded data source](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Show%20points%20of%20gridded%20data%20source)
<br/>[<img src="https://github.com/Azure-Samples/AzureMapsCodeSamples/raw/master/AzureMapsCodeSamples/SiteResources/screenshots/Show-points-of-gridded-data-source.jpg" height="200px">](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Show%20points%20of%20gridded%20data%20source)
[Show points of gridded data source](https://samples.azuremaps.com/?search=gridded&sample=show-points-of-gridded-data-source)
<br/>[<img src="https://samples.azuremaps.com/polygons/show-points-of-gridded-data-source/screenshot.jpg" height="200px">](https://samples.azuremaps.com/?search=gridded&sample=show-points-of-gridded-data-source)

[Gridded data source options](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Gridded%20data%20source%20options)
<br/>[<img src="https://github.com/Azure-Samples/AzureMapsCodeSamples/raw/master/AzureMapsCodeSamples/SiteResources/screenshots/Gridded-data-source-options.jpg" height="200px">](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Gridded%20data%20source%20options)
[Gridded data source options](https://samples.azuremaps.com/?search=gridded&sample=gridded-data-source-options)
<br/>[<img src="https://samples.azuremaps.com/polygons/gridded-data-source-options/screenshot.jpg" height="200px">](https://samples.azuremaps.com/?search=gridded&sample=gridded-data-source-options)

## Ideas for enhancements

Expand All @@ -76,15 +74,14 @@ See the [documentation](https://github.com/Azure-Samples/azure-maps-gridded-data
**Additional projects**

* [Azure Maps Web SDK Samples](https://github.com/Azure-Samples/AzureMapsCodeSamples)
* [Azure Maps Gov Cloud Web SDK Samples](https://github.com/Azure-Samples/AzureMapsGovCloudCodeSamples)
* [Azure Maps & Azure Active Directory Samples](https://github.com/Azure-Samples/Azure-Maps-AzureAD-Samples)
* [List of open-source Azure Maps projects](https://github.com/microsoft/Maps/blob/master/AzureMaps.md)

## Additional Resources

* [Azure Maps (main site)](https://azure.com/maps)
* [Azure Maps (main site)](https://azure.microsoft.com/en-us/products/azure-maps/)
* [Azure Maps Documentation](https://docs.microsoft.com/azure/azure-maps/index)
* [Azure Maps Blog](https://azure.microsoft.com/blog/topics/azure-maps/)
* [Azure Maps Blog](https://azure.microsoft.com/en-us/blog/product/azure-maps/)
* [Microsoft Q&A](https://docs.microsoft.com/answers/topics/azure-maps.html)
* [Azure Maps feedback](https://feedback.azure.com/forums/909172-azure-maps)

Expand Down
36 changes: 18 additions & 18 deletions dist/azure-maps-gridded-data-source.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@ MIT License
'use strict';

/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
Copyright (c) Microsoft Corporation.

THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/* global Reflect, Promise */

Expand Down Expand Up @@ -216,7 +216,7 @@ MIT License
if (exp.length >= 3) {
return new ComparisonExp(exp[0], Expression.parse(exp[1]), Expression.parse(exp[2]));
}
throw "Invalid '" + exp[1] + "' expression.";
throw "Invalid '".concat(exp[1], "' expression.");
};
ComparisonExp.prototype.eval = function (val) {
var self = this;
Expand Down Expand Up @@ -260,7 +260,7 @@ MIT License
}
return new MathExp(exp[0], conditions);
}
throw "Invalid '" + exp[0] + "' expression.";
throw "Invalid '".concat(exp[0], "' expression.");
};
MathExp.prototype.eval = function (val) {
var self = this;
Expand Down Expand Up @@ -317,7 +317,7 @@ MIT License
case 'tan':
return math.tan(v1);
}
throw "Invalid '" + self._o + "' expression.";
throw "Invalid '".concat(self._o, "' expression.");
};
MathExp.prototype._evalArray = function (val) {
var self = this;
Expand Down Expand Up @@ -922,7 +922,7 @@ MIT License
//Parse the map expressions for aggregates.
var mapExpressions = (hasAggregates) ? self._parseMapExpressions(options.aggregateProperties) : {};
//Parse the scale expression.
var scaleExpression = Expression.parse(options.scaleExpression || self.LinearPointCountScaleExpression);
var scaleExpression = Expression.parse((options.scaleExpression || self.LinearPointCountScaleExpression));
//Precalculate arc angle values for cell polygon generation.
var arcAngles = self._getArcAngles(options.gridType);
var sqrt3 = Math.sqrt(3);
Expand Down Expand Up @@ -960,7 +960,7 @@ MIT License
//Calculate the cubic coordinate for the data bin that contains the points pixel coordinate.
self._getCellCoord(pixel, width, height, options.gridType, coord, sqrt3);
//Create a unique id for the bin using the x, y and z, parameters of the cubic coordinate.
var cellId = "x" + coord.col + "y" + coord.row + "z" + coord.z;
var cellId = "x".concat(coord.col, "y").concat(coord.row, "z").concat(coord.z);
var cell = self._getGridCell(cellId, coord, i, gridInfo, width, height, options.gridType, hasAggregates);
//Calculate aggregates and metrics for cell.
self._incrementCellInfo(cell.properties, points[i], options.aggregateProperties, mapExpressions);
Expand All @@ -979,7 +979,7 @@ MIT License
GridMath.recalculateCoords = function (gridInfo, options) {
var self = this;
//Parse the scale expression.
var scaleExpression = Expression.parse(options.scaleExpression || self.LinearPointCountScaleExpression);
var scaleExpression = Expression.parse((options.scaleExpression || self.LinearPointCountScaleExpression));
var minCellWidth = azmaps.math.convertDistance(Math.min(options.minCellWidth, options.cellWidth), options.distanceUnits, 'meters') / self._getGroundResolutionZ22(options.centerLatitude);
for (var i = 0, len = gridInfo.cells.length; i < len; i++) {
gridInfo.cells[i].geometry.coordinates = self.createGridPolygon(gridInfo.cells[i].properties, options, gridInfo.width, gridInfo.height, self._getArcAngles(options.gridType), minCellWidth, scaleExpression, gridInfo.scaleMetrics);
Expand Down Expand Up @@ -1381,10 +1381,10 @@ MIT License
//Generate an abbreviated version of the point count.
var abbrv = count.toString();
if (count >= 1000000) {
abbrv = Math.round(count / 1000000) + "M";
abbrv = "".concat(Math.round(count / 1000000), "M");
}
else if (count >= 1000) {
abbrv = Math.round(count / 1000) + "k";
abbrv = "".concat(Math.round(count / 1000), "k");
}
cellInfo.point_count_abbreviated = abbrv;
var scaleVal = count;
Expand Down
2 changes: 1 addition & 1 deletion dist/azure-maps-gridded-data-source.min.js

Large diffs are not rendered by default.

Loading