├── .babelrc
├── .eslintignore
├── .eslintrc.json
├── .github
├── CODEOWNERS
├── bundlewatch.config.json
├── dependabot.yml
├── sync-repo-settings.yaml
└── workflows
│ ├── bundlewatch.yml
│ ├── codeql.yml
│ ├── dependabot.yml
│ ├── docs.yml
│ ├── e2e.yml
│ ├── package.yml
│ ├── release.yml
│ └── test.yml
├── .gitignore
├── .releaserc
├── CHANGELOG.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── SECURITY.md
├── examples
├── google_northamerica_offices.html
├── google_northamerica_offices.js
├── images
│ ├── ca.png
│ ├── flag-shadow.png
│ ├── headquarters-shadow.png
│ ├── headquarters.png
│ ├── house-shadow.png
│ ├── house.png
│ ├── rain-shadow.png
│ ├── rain.png
│ ├── snow-shadow.png
│ ├── snow.png
│ ├── storm-shadow.png
│ ├── storm.png
│ ├── sun-shadow.png
│ ├── sun.png
│ └── us.png
└── weather_map.html
├── jest.config.js
├── package-lock.json
├── package.json
├── rollup.config.js
├── src
├── gridbounds.ts
├── index.ts
├── markermanager.test.ts
├── markermanager.ts
└── utils.ts
├── tsconfig.json
└── typedoc.js
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | [
4 | "@babel/env",
5 | {
6 | "targets": {
7 | "browsers": "ie>=11, > 0.25%, not dead"
8 | },
9 | "corejs": "3.6",
10 | "useBuiltIns": "usage"
11 | }
12 | ]
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/.eslintignore:
--------------------------------------------------------------------------------
1 | bazel-*
2 | coverage/
3 | dist/
4 | docs/
5 | lib/
6 | node_modules/
7 | public/
--------------------------------------------------------------------------------
/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["eslint:recommended", "plugin:prettier/recommended"],
3 | "parserOptions": {
4 | "ecmaVersion": 12,
5 | "sourceType": "module",
6 | "ecmaFeatures": {
7 | "jsx": true
8 | }
9 | },
10 | "plugins": ["jest"],
11 | "rules": {
12 | "no-var": 2,
13 | "prefer-arrow-callback": 2
14 | },
15 | "overrides": [
16 | {
17 | "files": ["*.ts", "*.tsx"],
18 | "parser": "@typescript-eslint/parser",
19 | "plugins": ["@typescript-eslint"],
20 | "extends": ["plugin:@typescript-eslint/recommended"],
21 | "rules": {
22 | "@typescript-eslint/ban-ts-comment": 0,
23 | "@typescript-eslint/ban-types": 1,
24 | "@typescript-eslint/no-empty-function": 1,
25 | "@typescript-eslint/member-ordering": 1,
26 | "@typescript-eslint/explicit-member-accessibility": [
27 | 1,
28 | {
29 | "accessibility": "explicit",
30 | "overrides": {
31 | "accessors": "explicit",
32 | "constructors": "no-public",
33 | "methods": "explicit",
34 | "properties": "explicit",
35 | "parameterProperties": "explicit"
36 | }
37 | }
38 | ]
39 | }
40 | }
41 | ],
42 | "env": {
43 | "browser": true,
44 | "node": true,
45 | "es6": true,
46 | "jest/globals": true
47 | },
48 | "globals": { "google": "readonly" }
49 | }
50 |
--------------------------------------------------------------------------------
/.github/CODEOWNERS:
--------------------------------------------------------------------------------
1 | # Copyright 2021 Google LLC
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | # https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners
16 |
17 | .github/ @googlemaps/admin
18 |
--------------------------------------------------------------------------------
/.github/bundlewatch.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "files": [
3 | {
4 | "path": "dist/index.*.js"
5 | }
6 | ],
7 | "ci": {
8 | "trackBranches": ["main"],
9 | "repoBranchBase": "main"
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | # Copyright 2021 Google LLC
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | version: 2
16 | updates:
17 | - package-ecosystem: "npm"
18 | directory: "/"
19 | schedule:
20 | interval: "weekly"
21 |
--------------------------------------------------------------------------------
/.github/sync-repo-settings.yaml:
--------------------------------------------------------------------------------
1 | # Copyright 2022 Google LLC
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | # https://github.com/googleapis/repo-automation-bots/tree/main/packages/sync-repo-settings
16 |
17 | rebaseMergeAllowed: true
18 | squashMergeAllowed: true
19 | mergeCommitAllowed: false
20 | deleteBranchOnMerge: true
21 | branchProtectionRules:
22 | - pattern: main
23 | isAdminEnforced: false
24 | requiresStrictStatusChecks: false
25 | requiredStatusCheckContexts:
26 | - 'cla/google'
27 | - 'test'
28 | - 'snippet-bot check'
29 | - 'header-check'
30 | requiredApprovingReviewCount: 1
31 | requiresCodeOwnerReviews: true
32 | - pattern: master
33 | isAdminEnforced: false
34 | requiresStrictStatusChecks: false
35 | requiredStatusCheckContexts:
36 | - 'cla/google'
37 | - 'test'
38 | - 'snippet-bot check'
39 | - 'header-check'
40 | requiredApprovingReviewCount: 1
41 | requiresCodeOwnerReviews: true
42 | permissionRules:
43 | - team: admin
44 | permission: admin
45 |
--------------------------------------------------------------------------------
/.github/workflows/bundlewatch.yml:
--------------------------------------------------------------------------------
1 | # Copyright 2021 Google LLC
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | name: Bundlewatch
16 |
17 | on:
18 | push:
19 | branches:
20 | - main
21 | pull_request:
22 | types: [synchronize, opened]
23 |
24 | jobs:
25 | bundlewatch:
26 | runs-on: ubuntu-latest
27 | env:
28 | CI_BRANCH_BASE: main
29 | steps:
30 | - uses: actions/checkout@v2
31 | - uses: jackyef/bundlewatch-gh-action@b9753bc9b3ea458ff21069eaf6206e01e046f0b5
32 | with:
33 | build-script: npm i
34 | bundlewatch-github-token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
35 | bundlewatch-config: .github/bundlewatch.config.json
36 |
--------------------------------------------------------------------------------
/.github/workflows/codeql.yml:
--------------------------------------------------------------------------------
1 | # Copyright 2021 Google LLC
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | # For most projects, this workflow file will not need changing; you simply need
16 | # to commit it to your repository.
17 | #
18 | # You may wish to alter this file to override the set of languages analyzed,
19 | # or to provide custom queries or build logic.
20 | #
21 | # ******** NOTE ********
22 | # We have attempted to detect the languages in your repository. Please check
23 | # the `language` matrix defined below to confirm you have the correct set of
24 | # supported CodeQL languages.
25 | #
26 | name: "CodeQL"
27 |
28 | on:
29 | push:
30 | branches: [main]
31 | pull_request:
32 | # The branches below must be a subset of the branches above
33 | branches: [main]
34 | schedule:
35 | - cron: "0 13 * * *"
36 |
37 | jobs:
38 | analyze:
39 | name: Analyze
40 | runs-on: ubuntu-latest
41 | permissions:
42 | actions: read
43 | contents: read
44 | security-events: write
45 |
46 | strategy:
47 | fail-fast: false
48 | matrix:
49 | language: ["javascript"]
50 | # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
51 | # Learn more:
52 | # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
53 |
54 | steps:
55 | - name: Checkout repository
56 | uses: actions/checkout@v2
57 |
58 | # Initializes the CodeQL tools for scanning.
59 | - name: Initialize CodeQL
60 | uses: github/codeql-action/init@v1
61 | with:
62 | languages: ${{ matrix.language }}
63 | # If you wish to specify custom queries, you can do so here or in a config file.
64 | # By default, queries listed here will override any specified in a config file.
65 | # Prefix the list here with "+" to use these queries and those in the config file.
66 | # queries: ./path/to/local/query, your-org/your-repo/queries@main
67 |
68 | # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
69 | # If this step fails, then you should remove it and run the build manually (see below)
70 | - name: Autobuild
71 | uses: github/codeql-action/autobuild@v1
72 |
73 | # ℹ️ Command-line programs to run using the OS shell.
74 | # 📚 https://git.io/JvXDl
75 |
76 | # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
77 | # and modify them (or add more) to build your code if your project
78 | # uses a compiled language
79 |
80 | #- run: |
81 | # make bootstrap
82 | # make release
83 |
84 | - name: Perform CodeQL Analysis
85 | uses: github/codeql-action/analyze@v1
86 |
--------------------------------------------------------------------------------
/.github/workflows/dependabot.yml:
--------------------------------------------------------------------------------
1 | # Copyright 2022 Google LLC
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | name: Dependabot
16 | on: pull_request
17 |
18 | permissions:
19 | contents: write
20 |
21 | jobs:
22 | dependabot:
23 | runs-on: ubuntu-latest
24 | if: ${{ github.actor == 'dependabot[bot]' }}
25 | env:
26 | PR_URL: ${{github.event.pull_request.html_url}}
27 | GITHUB_TOKEN: ${{secrets.SYNCED_GITHUB_TOKEN_REPO}}
28 | steps:
29 | - name: approve
30 | run: gh pr review --approve "$PR_URL"
31 | - name: merge
32 | run: gh pr merge --auto --squash --delete-branch "$PR_URL"
33 |
--------------------------------------------------------------------------------
/.github/workflows/docs.yml:
--------------------------------------------------------------------------------
1 | # Copyright 2021 Google LLC
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | name: Docs
16 | on: [push, pull_request]
17 | jobs:
18 | test:
19 | runs-on: ubuntu-latest
20 | steps:
21 | - uses: actions/checkout@v2
22 | - uses: actions/cache@v2
23 | with:
24 | path: ~/.npm
25 | key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
26 | restore-keys: |
27 | ${{ runner.os }}-node-
28 | - run: |
29 | npm i
30 | npm run docs
31 | - uses: peaceiris/actions-gh-pages@v3
32 | if: github.ref == 'refs/heads/main'
33 | with:
34 | github_token: ${{ secrets.GITHUB_TOKEN }}
35 | publish_dir: ./docs
36 | user_name: 'googlemaps-bot'
37 | user_email: 'googlemaps-bot@users.noreply.github.com'
38 | commit_message: ${{ github.event.head_commit.message }}
39 |
--------------------------------------------------------------------------------
/.github/workflows/e2e.yml:
--------------------------------------------------------------------------------
1 | # Copyright 2021 Google LLC
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | name: e2e
16 | on:
17 | push:
18 | schedule:
19 | - cron: "0 12 * * *"
20 | jobs:
21 | chrome:
22 | runs-on: ubuntu-latest
23 | services:
24 | hub:
25 | image: selenium/standalone-chrome
26 | volumes:
27 | - ${{ github.workspace }}:${{ github.workspace }}
28 | ports:
29 | - 4444:4444
30 | steps:
31 | - uses: actions/checkout@v2
32 | - run: npm i
33 | - run: npm run test:e2e
34 | firefox:
35 | runs-on: ubuntu-latest
36 | services:
37 | hub:
38 | image: selenium/standalone-firefox
39 | volumes:
40 | - ${{ github.workspace }}:${{ github.workspace }}
41 | ports:
42 | - 4444:4444
43 | steps:
44 | - uses: actions/checkout@v2
45 | - run: npm i
46 | - run: npm run test:e2e
47 | env:
48 | BROWSER: firefox
49 |
--------------------------------------------------------------------------------
/.github/workflows/package.yml:
--------------------------------------------------------------------------------
1 | # Copyright 2021 Google LLC
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | name: Package
16 | on:
17 | - push
18 | - pull_request
19 | jobs:
20 | package:
21 | runs-on: ubuntu-latest
22 | steps:
23 | - uses: actions/checkout@v2
24 | - run: npm i
25 | - uses: jpoehnelt/verify-npm-files-action@main
26 | with:
27 | keys: |
28 | types
29 | main
30 | module
31 |
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 | # Copyright 2021 Google LLC
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | name: Release
16 | on:
17 | push:
18 | branches:
19 | - main
20 | concurrency: release
21 | jobs:
22 | build:
23 | runs-on: ubuntu-latest
24 | steps:
25 | - uses: actions/setup-node@v2
26 | with:
27 | node-version: '14'
28 | - name: Checkout
29 | uses: actions/checkout@v3
30 | with:
31 | token: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }}
32 | - uses: actions/cache@v2
33 | with:
34 | path: ~/.npm
35 | key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
36 | restore-keys: |
37 | ${{ runner.os }}-node-
38 | - name: Test
39 | run: |
40 | npm i
41 | npm run lint
42 | npm test
43 | - name: Release
44 | uses: cycjimmy/semantic-release-action@v2
45 | with:
46 | extra_plugins: |
47 | @semantic-release/commit-analyzer
48 | semantic-release-interval
49 | @semantic-release/release-notes-generator
50 | @semantic-release/git
51 | @semantic-release/github
52 | @semantic-release/npm
53 | @googlemaps/semantic-release-config
54 | semantic-release-npm-deprecate
55 | env:
56 | GH_TOKEN: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }}
57 | NPM_TOKEN: ${{ secrets.NPM_WOMBAT_TOKEN }}
58 |
--------------------------------------------------------------------------------
/.github/workflows/test.yml:
--------------------------------------------------------------------------------
1 | # Copyright 2021 Google LLC
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | name: Test
16 | on: [push, pull_request]
17 | jobs:
18 | test:
19 | runs-on: ubuntu-latest
20 | steps:
21 | - uses: actions/checkout@v2
22 | - uses: actions/cache@v2
23 | with:
24 | path: ~/.npm
25 | key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
26 | restore-keys: |
27 | ${{ runner.os }}-node-
28 | - run: npm i
29 | - run: npm run lint
30 | - run: npm test
31 | - uses: codecov/codecov-action@v1
32 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | dist/
3 | .npmrc
4 | **/docs
5 |
6 | # Logs
7 | logs
8 | *.log
9 | npm-debug.log*
10 | yarn-debug.log*
11 | yarn-error.log*
12 | lerna-debug.log*
13 |
14 | # Diagnostic reports (https://nodejs.org/api/report.html)
15 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
16 |
17 | # Runtime data
18 | pids
19 | *.pid
20 | *.seed
21 | *.pid.lock
22 |
23 | # Directory for instrumented libs generated by jscoverage/JSCover
24 | lib-cov
25 |
26 | # Coverage directory used by tools like istanbul
27 | coverage
28 | *.lcov
29 |
30 | # nyc test coverage
31 | .nyc_output
32 |
33 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
34 | .grunt
35 |
36 | # Bower dependency directory (https://bower.io/)
37 | bower_components
38 |
39 | # node-waf configuration
40 | .lock-wscript
41 |
42 | # Compiled binary addons (https://nodejs.org/api/addons.html)
43 | build/Release
44 |
45 | # Dependency directories
46 | node_modules/
47 | jspm_packages/
48 |
49 | # TypeScript v1 declaration files
50 | typings/
51 |
52 | # TypeScript cache
53 | *.tsbuildinfo
54 |
55 | # Optional npm cache directory
56 | .npm
57 |
58 | # Optional eslint cache
59 | .eslintcache
60 |
61 | # Microbundle cache
62 | .rpt2_cache/
63 | .rts2_cache_cjs/
64 | .rts2_cache_es/
65 | .rts2_cache_umd/
66 |
67 | # Optional REPL history
68 | .node_repl_history
69 |
70 | # Output of 'npm pack'
71 | *.tgz
72 |
73 | # Yarn Integrity file
74 | .yarn-integrity
75 |
76 | # dotenv environment variables file
77 | .env
78 | .env.test
79 |
80 | # parcel-bundler cache (https://parceljs.org/)
81 | .cache
82 |
83 | # next.js build output
84 | .next
85 |
86 | # nuxt.js build output
87 | .nuxt
88 |
89 | # gatsby files
90 | .cache/
91 | public
92 |
93 | # vuepress build output
94 | .vuepress/dist
95 |
96 | # Serverless directories
97 | .serverless/
98 |
99 | # FuseBox cache
100 | .fusebox/
101 |
102 | # DynamoDB Local files
103 | .dynamodb/
104 |
105 | # TernJS port file
106 | .tern-port
107 |
108 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
109 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
110 |
111 | # User-specific stuff
112 | .idea/**/workspace.xml
113 | .idea/**/tasks.xml
114 | .idea/**/usage.statistics.xml
115 | .idea/**/dictionaries
116 | .idea/**/shelf
117 |
118 | # Generated files
119 | .idea/**/contentModel.xml
120 |
121 | # Sensitive or high-churn files
122 | .idea/**/dataSources/
123 | .idea/**/dataSources.ids
124 | .idea/**/dataSources.local.xml
125 | .idea/**/sqlDataSources.xml
126 | .idea/**/dynamic.xml
127 | .idea/**/uiDesigner.xml
128 | .idea/**/dbnavigator.xml
129 |
130 | # Gradle
131 | .idea/**/gradle.xml
132 | .idea/**/libraries
133 |
134 | # Gradle and Maven with auto-import
135 | # When using Gradle or Maven with auto-import, you should exclude module files,
136 | # since they will be recreated, and may cause churn. Uncomment if using
137 | # auto-import.
138 | # .idea/modules.xml
139 | # .idea/*.iml
140 | # .idea/modules
141 | # *.iml
142 | # *.ipr
143 |
144 | # CMake
145 | cmake-build-*/
146 |
147 | # Mongo Explorer plugin
148 | .idea/**/mongoSettings.xml
149 |
150 | # File-based project format
151 | *.iws
152 |
153 | # IntelliJ
154 | out/
155 |
156 | # mpeltonen/sbt-idea plugin
157 | .idea_modules/
158 |
159 | # JIRA plugin
160 | atlassian-ide-plugin.xml
161 |
162 | # Cursive Clojure plugin
163 | .idea/replstate.xml
164 |
165 | # Crashlytics plugin (for Android Studio and IntelliJ)
166 | com_crashlytics_export_strings.xml
167 | crashlytics.properties
168 | crashlytics-build.properties
169 | fabric.properties
170 |
171 | # Editor-based Rest Client
172 | .idea/httpRequests
173 |
174 | # Android studio 3.1+ serialized cache file
175 | .idea/caches/build_file_checksums.ser
176 |
177 | # General
178 | .DS_Store
179 | .AppleDouble
180 | .LSOverride
181 |
182 | # Icon must end with two \r
183 | Icon
184 |
185 |
186 | # Thumbnails
187 | ._*
188 |
189 | # Files that might appear in the root of a volume
190 | .DocumentRevisions-V100
191 | .fseventsd
192 | .Spotlight-V100
193 | .TemporaryItems
194 | .Trashes
195 | .VolumeIcon.icns
196 | .com.apple.timemachine.donotpresent
197 |
198 | # Directories potentially created on remote AFP share
199 | .AppleDB
200 | .AppleDesktop
201 | Network Trash Folder
202 | Temporary Items
203 | .apdisk
204 |
205 | # Windows thumbnail cache files
206 | Thumbs.db
207 | Thumbs.db:encryptable
208 | ehthumbs.db
209 | ehthumbs_vista.db
210 |
211 | # Dump file
212 | *.stackdump
213 |
214 | # Folder config file
215 | [Dd]esktop.ini
216 |
217 | # Recycle Bin used on file shares
218 | $RECYCLE.BIN/
219 |
220 | # Windows Installer files
221 | *.cab
222 | *.msi
223 | *.msix
224 | *.msm
225 | *.msp
226 |
227 | # Windows shortcuts
228 | *.lnk
229 | .vscode
230 |
--------------------------------------------------------------------------------
/.releaserc:
--------------------------------------------------------------------------------
1 | extends: "@googlemaps/semantic-release-config"
2 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Change Log
2 |
3 | All notable changes to this project will be documented in this file.
4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5 |
6 | # [0.1.0](https://github.com/googlemaps/v3-utility-library/compare/@googlemaps/markermanager@0.0.8...@googlemaps/markermanager@0.1.0) (2021-06-17)
7 |
8 |
9 | ### Features
10 |
11 | * Support for @types/google.maps ([#694](https://github.com/googlemaps/v3-utility-library/issues/694)) ([e78e58c](https://github.com/googlemaps/v3-utility-library/commit/e78e58c0c5a0dcf6675e671e2d54dcc46779744d)), closes [#690](https://github.com/googlemaps/v3-utility-library/issues/690)
12 |
13 |
14 |
15 |
16 |
17 | ## [0.0.8](https://github.com/googlemaps/v3-utility-library/compare/@googlemaps/markermanager@0.0.7...@googlemaps/markermanager@0.0.8) (2021-03-08)
18 |
19 | **Note:** Version bump only for package @googlemaps/markermanager
20 |
21 |
22 |
23 |
24 |
25 | ## [0.0.7](https://github.com/googlemaps/v3-utility-library/compare/@googlemaps/markermanager@0.0.6...@googlemaps/markermanager@0.0.7) (2020-09-11)
26 |
27 | **Note:** Version bump only for package @googlemaps/markermanager
28 |
29 |
30 |
31 |
32 |
33 | ## [0.0.6](https://github.com/googlemaps/v3-utility-library/compare/@googlemaps/markermanager@0.0.5...@googlemaps/markermanager@0.0.6) (2020-03-12)
34 |
35 |
36 | ### Bug Fixes
37 |
38 | * add polyfills via core-js ([#634](https://github.com/googlemaps/v3-utility-library/issues/634)) ([4699c9a](https://github.com/googlemaps/v3-utility-library/commit/4699c9abf69307829a8782c917f1eb0108ac941b))
39 |
40 |
41 |
42 |
43 |
44 | ## [0.0.5](https://github.com/googlemaps/v3-utility-library/compare/@googlemaps/markermanager@0.0.4...@googlemaps/markermanager@0.0.5) (2020-03-12)
45 |
46 |
47 | ### Bug Fixes
48 |
49 | * set browserslist setting for babel ([#632](https://github.com/googlemaps/v3-utility-library/issues/632)) ([a57b68e](https://github.com/googlemaps/v3-utility-library/commit/a57b68e86bef5bea54e35c9fc4cd66b10ef8dafe))
50 |
51 |
52 |
53 |
54 |
55 | ## [0.0.4](https://github.com/googlemaps/v3-utility-library/compare/@googlemaps/markermanager@0.0.3...@googlemaps/markermanager@0.0.4) (2019-12-23)
56 |
57 | **Note:** Version bump only for package @googlemaps/markermanager
58 |
59 |
60 |
61 |
62 |
63 | ## [0.0.3](https://github.com/googlemaps/v3-utility-library/compare/@googlemaps/markermanager@0.0.2...@googlemaps/markermanager@0.0.3) (2019-12-09)
64 |
65 |
66 | ### Bug Fixes
67 |
68 | * remove old documentation links ([#574](https://github.com/googlemaps/v3-utility-library/issues/574)) ([0bfb640](https://github.com/googlemaps/v3-utility-library/commit/0bfb6400b555f46e2fbc4fab002673b084931c09))
69 | * transpile code for iife and umd outputs ([#586](https://github.com/googlemaps/v3-utility-library/issues/586)) ([fb9ad06](https://github.com/googlemaps/v3-utility-library/commit/fb9ad066cbf5d87cffcda2c435196ad20fed56f1))
70 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # How to become a contributor and submit your own code
2 |
3 | 1. Submit an issue describing your proposed change to the repo in question.
4 | 1. The repo owner will respond to your issue promptly.
5 | 1. Fork the desired repo, develop and test your code changes.
6 | 1. Ensure that your code adheres to the existing style in the code to which
7 | you are contributing.
8 | 1. Ensure that your code has an appropriate set of tests which all pass.
9 | 1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling.
10 | 1. Submit a pull request.
11 |
12 | ## Running the tests
13 |
14 | 1. Install dependencies:
15 |
16 | npm i
17 | 1. Run lint
18 |
19 | npm run lint
20 | npm run format # will fix some issues
21 |
22 | 1. Run the tests:
23 |
24 | # Run unit tests.
25 | npm test
26 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 |
2 | Apache License
3 | Version 2.0, January 2004
4 | http://www.apache.org/licenses/
5 |
6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7 |
8 | 1. Definitions.
9 |
10 | "License" shall mean the terms and conditions for use, reproduction,
11 | and distribution as defined by Sections 1 through 9 of this document.
12 |
13 | "Licensor" shall mean the copyright owner or entity authorized by
14 | the copyright owner that is granting the License.
15 |
16 | "Legal Entity" shall mean the union of the acting entity and all
17 | other entities that control, are controlled by, or are under common
18 | control with that entity. For the purposes of this definition,
19 | "control" means (i) the power, direct or indirect, to cause the
20 | direction or management of such entity, whether by contract or
21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
22 | outstanding shares, or (iii) beneficial ownership of such entity.
23 |
24 | "You" (or "Your") shall mean an individual or Legal Entity
25 | exercising permissions granted by this License.
26 |
27 | "Source" form shall mean the preferred form for making modifications,
28 | including but not limited to software source code, documentation
29 | source, and configuration files.
30 |
31 | "Object" form shall mean any form resulting from mechanical
32 | transformation or translation of a Source form, including but
33 | not limited to compiled object code, generated documentation,
34 | and conversions to other media types.
35 |
36 | "Work" shall mean the work of authorship, whether in Source or
37 | Object form, made available under the License, as indicated by a
38 | copyright notice that is included in or attached to the work
39 | (an example is provided in the Appendix below).
40 |
41 | "Derivative Works" shall mean any work, whether in Source or Object
42 | form, that is based on (or derived from) the Work and for which the
43 | editorial revisions, annotations, elaborations, or other modifications
44 | represent, as a whole, an original work of authorship. For the purposes
45 | of this License, Derivative Works shall not include works that remain
46 | separable from, or merely link (or bind by name) to the interfaces of,
47 | the Work and Derivative Works thereof.
48 |
49 | "Contribution" shall mean any work of authorship, including
50 | the original version of the Work and any modifications or additions
51 | to that Work or Derivative Works thereof, that is intentionally
52 | submitted to Licensor for inclusion in the Work by the copyright owner
53 | or by an individual or Legal Entity authorized to submit on behalf of
54 | the copyright owner. For the purposes of this definition, "submitted"
55 | means any form of electronic, verbal, or written communication sent
56 | to the Licensor or its representatives, including but not limited to
57 | communication on electronic mailing lists, source code control systems,
58 | and issue tracking systems that are managed by, or on behalf of, the
59 | Licensor for the purpose of discussing and improving the Work, but
60 | excluding communication that is conspicuously marked or otherwise
61 | designated in writing by the copyright owner as "Not a Contribution."
62 |
63 | "Contributor" shall mean Licensor and any individual or Legal Entity
64 | on behalf of whom a Contribution has been received by Licensor and
65 | subsequently incorporated within the Work.
66 |
67 | 2. Grant of Copyright License. Subject to the terms and conditions of
68 | this License, each Contributor hereby grants to You a perpetual,
69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70 | copyright license to reproduce, prepare Derivative Works of,
71 | publicly display, publicly perform, sublicense, and distribute the
72 | Work and such Derivative Works in Source or Object form.
73 |
74 | 3. Grant of Patent License. Subject to the terms and conditions of
75 | this License, each Contributor hereby grants to You a perpetual,
76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77 | (except as stated in this section) patent license to make, have made,
78 | use, offer to sell, sell, import, and otherwise transfer the Work,
79 | where such license applies only to those patent claims licensable
80 | by such Contributor that are necessarily infringed by their
81 | Contribution(s) alone or by combination of their Contribution(s)
82 | with the Work to which such Contribution(s) was submitted. If You
83 | institute patent litigation against any entity (including a
84 | cross-claim or counterclaim in a lawsuit) alleging that the Work
85 | or a Contribution incorporated within the Work constitutes direct
86 | or contributory patent infringement, then any patent licenses
87 | granted to You under this License for that Work shall terminate
88 | as of the date such litigation is filed.
89 |
90 | 4. Redistribution. You may reproduce and distribute copies of the
91 | Work or Derivative Works thereof in any medium, with or without
92 | modifications, and in Source or Object form, provided that You
93 | meet the following conditions:
94 |
95 | (a) You must give any other recipients of the Work or
96 | Derivative Works a copy of this License; and
97 |
98 | (b) You must cause any modified files to carry prominent notices
99 | stating that You changed the files; and
100 |
101 | (c) You must retain, in the Source form of any Derivative Works
102 | that You distribute, all copyright, patent, trademark, and
103 | attribution notices from the Source form of the Work,
104 | excluding those notices that do not pertain to any part of
105 | the Derivative Works; and
106 |
107 | (d) If the Work includes a "NOTICE" text file as part of its
108 | distribution, then any Derivative Works that You distribute must
109 | include a readable copy of the attribution notices contained
110 | within such NOTICE file, excluding those notices that do not
111 | pertain to any part of the Derivative Works, in at least one
112 | of the following places: within a NOTICE text file distributed
113 | as part of the Derivative Works; within the Source form or
114 | documentation, if provided along with the Derivative Works; or,
115 | within a display generated by the Derivative Works, if and
116 | wherever such third-party notices normally appear. The contents
117 | of the NOTICE file are for informational purposes only and
118 | do not modify the License. You may add Your own attribution
119 | notices within Derivative Works that You distribute, alongside
120 | or as an addendum to the NOTICE text from the Work, provided
121 | that such additional attribution notices cannot be construed
122 | as modifying the License.
123 |
124 | You may add Your own copyright statement to Your modifications and
125 | may provide additional or different license terms and conditions
126 | for use, reproduction, or distribution of Your modifications, or
127 | for any such Derivative Works as a whole, provided Your use,
128 | reproduction, and distribution of the Work otherwise complies with
129 | the conditions stated in this License.
130 |
131 | 5. Submission of Contributions. Unless You explicitly state otherwise,
132 | any Contribution intentionally submitted for inclusion in the Work
133 | by You to the Licensor shall be under the terms and conditions of
134 | this License, without any additional terms or conditions.
135 | Notwithstanding the above, nothing herein shall supersede or modify
136 | the terms of any separate license agreement you may have executed
137 | with Licensor regarding such Contributions.
138 |
139 | 6. Trademarks. This License does not grant permission to use the trade
140 | names, trademarks, service marks, or product names of the Licensor,
141 | except as required for reasonable and customary use in describing the
142 | origin of the Work and reproducing the content of the NOTICE file.
143 |
144 | 7. Disclaimer of Warranty. Unless required by applicable law or
145 | agreed to in writing, Licensor provides the Work (and each
146 | Contributor provides its Contributions) on an "AS IS" BASIS,
147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148 | implied, including, without limitation, any warranties or conditions
149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150 | PARTICULAR PURPOSE. You are solely responsible for determining the
151 | appropriateness of using or redistributing the Work and assume any
152 | risks associated with Your exercise of permissions under this License.
153 |
154 | 8. Limitation of Liability. In no event and under no legal theory,
155 | whether in tort (including negligence), contract, or otherwise,
156 | unless required by applicable law (such as deliberate and grossly
157 | negligent acts) or agreed to in writing, shall any Contributor be
158 | liable to You for damages, including any direct, indirect, special,
159 | incidental, or consequential damages of any character arising as a
160 | result of this License or out of the use or inability to use the
161 | Work (including but not limited to damages for loss of goodwill,
162 | work stoppage, computer failure or malfunction, or any and all
163 | other commercial damages or losses), even if such Contributor
164 | has been advised of the possibility of such damages.
165 |
166 | 9. Accepting Warranty or Additional Liability. While redistributing
167 | the Work or Derivative Works thereof, You may choose to offer,
168 | and charge a fee for, acceptance of support, warranty, indemnity,
169 | or other liability obligations and/or rights consistent with this
170 | License. However, in accepting such obligations, You may act only
171 | on Your own behalf and on Your sole responsibility, not on behalf
172 | of any other Contributor, and only if You agree to indemnify,
173 | defend, and hold each Contributor harmless for any liability
174 | incurred by, or claims asserted against, such Contributor by reason
175 | of your accepting any such warranty or additional liability.
176 |
177 | END OF TERMS AND CONDITIONS
178 |
179 | APPENDIX: How to apply the Apache License to your work.
180 |
181 | To apply the Apache License to your work, attach the following
182 | boilerplate notice, with the fields enclosed by brackets "[]"
183 | replaced with your own identifying information. (Don't include
184 | the brackets!) The text should be enclosed in the appropriate
185 | comment syntax for the file format. We also recommend that a
186 | file or class name and description of purpose be included on the
187 | same "printed page" as the copyright notice for easier
188 | identification within third-party archives.
189 |
190 | Copyright [yyyy] [name of copyright owner]
191 |
192 | Licensed under the Apache License, Version 2.0 (the "License");
193 | you may not use this file except in compliance with the License.
194 | You may obtain a copy of the License at
195 |
196 | http://www.apache.org/licenses/LICENSE-2.0
197 |
198 | Unless required by applicable law or agreed to in writing, software
199 | distributed under the License is distributed on an "AS IS" BASIS,
200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201 | See the License for the specific language governing permissions and
202 | limitations under the License.
203 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # MarkerManager
2 |
3 | [](https://www.npmjs.com/package/@googlemaps/markermanager)
4 | 
5 | 
6 | [](https://codecov.io/gh/googlemaps/js-markermanager)
7 | 
8 | [](https://github.com/semantic-release/semantic-release)
9 | [](https://github.com/apps/in-solidarity)
10 | [](https://discord.gg/jRteCzP)
11 |
12 | ## Description
13 |
14 | Marker manager is an interface between the map and the user, designed to manage adding and removing many points when the viewport changes.
15 |
16 | > **Note**: This package was previously located at https://github.com/googlemaps/v3-utility-library.
17 |
18 | ### How it Works
19 |
20 | The MarkerManager places its markers onto a grid, similar to the map tiles. When the user moves the viewport, it computes which grid cells have entered or left the viewport, and shows or hides all the markers in those cells. (If the users scrolls the viewport beyond the markers that are loaded, no markers will be visible until the EVENT_moveend triggers an update.) In practical consequences, this allows 10,000 markers to be distributed over a large area, and as long as only 100-200 are visible in any given viewport, the user will see good performance corresponding to the 100 visible markers, rather than poor performance corresponding to the total 10,000 markers. Note that some code is optimized for speed over space, with the goal of accommodating thousands of markers.
21 |
22 | ## Documentation
23 |
24 | The reference documentation can be found at this [link](https://googlemaps.github.io/js-markermanager).
25 |
26 | ## Examples
27 |
28 | - [Weather Map](https://googlemaps.github.io/js-markermanager/examples/weather_map.html)
29 | - [Google North America Offices](https://googlemaps.github.io/js-markermanager/examples/google_northamerica_offices.html)
30 |
31 | ## Support
32 |
33 | This library is community supported. We're comfortable enough with the stability and features of
34 | the library that we want you to build real production applications on it.
35 |
36 | If you find a bug, or have a feature suggestion, please [log an issue][issues]. If you'd like to
37 | contribute, please read [How to Contribute][contrib].
38 |
39 | [issues]: https://github.com/googlemaps/js-markermanager/issues
40 | [contrib]: https://github.com/googlemaps/js-markermanager/blob/master/packages/markermanager/CONTRIB.md
41 |
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 | # Report a security issue
2 |
3 | To report a security issue, please use https://g.co/vulnz. We use
4 | https://g.co/vulnz for our intake, and do coordination and disclosure here on
5 | GitHub (including using GitHub Security Advisory). The Google Security Team will
6 | respond within 5 working days of your report on g.co/vulnz.
7 |
8 | To contact us about other bugs, please open an issue on GitHub.
9 |
10 | > **Note**: This file is synchronized from the https://github.com/googlemaps/.github repository.
11 |
--------------------------------------------------------------------------------
/examples/google_northamerica_offices.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |