Skip to content
This repository has been archived by the owner on Dec 9, 2021. It is now read-only.

Commit

Permalink
chore: standardize repos (#269)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpoehnelt committed Sep 17, 2021
1 parent 3bc61b8 commit 19365b9
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 51 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2020 Google LLC
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright 2021 Google LLC
#
# 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
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Docs
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
npm i
npm run docs
- uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
user_name: 'googlemaps-bot'
user_email: 'googlemaps-bot@users.noreply.github.com'
commit_message: ${{ github.event.head_commit.message }}
31 changes: 11 additions & 20 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2020 Google LLC
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -12,11 +12,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.

name: "Release"
name: Release
on:
push:
branches:
- main
concurrency: release
jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -25,29 +26,19 @@ jobs:
- name: Test
run: |
npm i
npm run lint
npm test
- name: Release
uses: cycjimmy/semantic-release-action@v2
with:
extra_plugins: |
"@semantic-release/commit-analyzer"
"@semantic-release/release-notes-generator"
"@semantic-release/git
"@semantic-release/github
"@semantic-release/npm
@semantic-release/commit-analyzer
semantic-release-interval
@semantic-release/release-notes-generator
@semantic-release/git
@semantic-release/github
@semantic-release/npm
@googlemaps/semantic-release-config
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_WOMBAT_TOKEN }}
- run: |
npm i
npm run docs
cp -r dist docs/dist
cp -r examples docs/examples
cp -r images docs/images
- uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
user_name: 'googlemaps-bot'
user_email: 'googlemaps-bot@users.noreply.github.com'
commit_message: ${{ github.event.head_commit.message }}
5 changes: 1 addition & 4 deletions examples/advanced_example.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,7 @@

<script src="https://maps.googleapis.com/maps/api/js?v=3&amp;sensor=false"></script>
<script src="data.js" type="text/javascript"></script>
<script
src="../dist/index.min.js"
type="text/javascript"
></script>
<script src="../dist/index.min.js" type="text/javascript"></script>

<script type="text/javascript">
var styles = [
Expand Down
9 changes: 3 additions & 6 deletions examples/dynamic_icon_url_example.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@

<script src="https://maps.googleapis.com/maps/api/js?v=3&amp;sensor=false"></script>
<script type="text/javascript" src="data.js"></script>
<script
type="text/javascript"
src="../dist/index.min.js"
></script>
<script type="text/javascript" src="../dist/index.min.js"></script>

<script type="text/javascript">
const styleCluster = [
Expand Down Expand Up @@ -94,7 +91,7 @@
index++;
}

const iconUrl = `https://chart.googleapis.com/chart?chs=150x150&chd=t:${count},${markers.length}&cht=p3&chf=bg,s,FFFFFF00`
const iconUrl = `https://chart.googleapis.com/chart?chs=150x150&chd=t:${count},${markers.length}&cht=p3&chf=bg,s,FFFFFF00`;

index = Math.min(index, numStyles);
return {
Expand All @@ -103,7 +100,7 @@
index: index,
title: "",
};
}
},
});
}
google.maps.event.addDomListener(window, "load", initialize);
Expand Down
19 changes: 10 additions & 9 deletions examples/events_example.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@

<script src="https://maps.googleapis.com/maps/api/js?v=3&amp;sensor=false"></script>
<script type="text/javascript" src="data.js"></script>
<script
type="text/javascript"
src="../dist/index.min.js"
></script>
<script type="text/javascript" src="../dist/index.min.js"></script>

<script type="text/javascript">
function initialize() {
Expand Down Expand Up @@ -73,11 +70,15 @@
}
log("&mdash;Locations of managed markers: " + p.join(", "));
});
google.maps.event.addListener(markerCluster, "contextmenu", function (c) {
log("contextmenu: ");
log("&mdash;Center of cluster: " + c.getCenter());
log("&mdash;Number of managed markers in cluster: " + c.getSize());
});
google.maps.event.addListener(
markerCluster,
"contextmenu",
function (c) {
log("contextmenu: ");
log("&mdash;Center of cluster: " + c.getCenter());
log("&mdash;Number of managed markers in cluster: " + c.getSize());
}
);
google.maps.event.addListener(markerCluster, "mouseover", function (c) {
log("mouseover: ");
log("&mdash;Center of cluster: " + c.getCenter());
Expand Down
5 changes: 1 addition & 4 deletions examples/simple_example.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@

<script src="https://maps.googleapis.com/maps/api/js?v=3&amp;sensor=false"></script>
<script type="text/javascript" src="data.js"></script>
<script
type="text/javascript"
src="../dist/index.min.js"
></script>
<script type="text/javascript" src="../dist/index.min.js"></script>

<script type="text/javascript">
function initialize() {
Expand Down
5 changes: 1 addition & 4 deletions examples/speed_test_example.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,7 @@

<script src="https://maps.googleapis.com/maps/api/js?v=3&amp;sensor=false"></script>
<script src="data.js" type="text/javascript"></script>
<script
type="text/javascript"
src="../dist/index.min.js"
></script>
<script type="text/javascript" src="../dist/index.min.js"></script>

<script type="text/javascript" src="speed_test.js"></script>

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
"module": "dist/index.esm.js",
"types": "dist/index.d.ts",
"scripts": {
"docs": "typedoc src/index.ts",
"docs": "typedoc src/index.ts && cp -r dist docs/dist && cp -r examples docs/examples",
"format": "prettier *.json *.js e2e/* examples/* --write && eslint src/* --fix",
"lint": "eslint src/*",
"prepare": "rollup -c",
"prepare": "rm -rf dist && rollup -c",
"test": "jest --passWithNoTests src/*",
"test:e2e": "jest --passWithNoTests e2e/*"
},
Expand Down
3 changes: 2 additions & 1 deletion src/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ import { ClusterIcon } from "./cluster-icon";
*/
export class Cluster {
private map_ = this.markerClusterer_.getMap() as google.maps.Map;
private minClusterSize_: number = this.markerClusterer_.getMinimumClusterSize();
private minClusterSize_: number =
this.markerClusterer_.getMinimumClusterSize();
private averageCenter_: boolean = this.markerClusterer_.getAverageCenter();
private markers_: ClusterAugmentedMarker[] = []; // TODO: type;
private center_: google.maps.LatLng = null;
Expand Down

0 comments on commit 19365b9

Please sign in to comment.