├── .env
├── .github
├── ISSUE_TEMPLATE
│ ├── bug_report.md
│ └── feature_request.md
└── pull_request_template.md
├── .gitignore
├── .husky
└── pre-commit
├── .lintstagedrc.json
├── .prettierrc
├── .vscode
└── extensions.json
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── SECURITY.md
├── create-cdn-pr.sh
├── deno.lock
├── eslint.config.js
├── examples
├── leaflet
│ ├── AppLeaflet.svelte
│ ├── index.html
│ └── main.ts
├── maplibregl
│ ├── AppMapLibreGl.svelte
│ ├── index.html
│ └── main.ts
├── maptiler-sdk
│ ├── AppMapTilerSdk.svelte
│ ├── index.html
│ └── main.ts
├── openlayers
│ ├── AppOpenLayers.svelte
│ ├── index.html
│ └── main.ts
├── react
│ ├── index.html
│ ├── main.tsx
│ └── style.css
├── standalone
│ ├── leaflet.html
│ ├── maplibregl.html
│ └── ol.html
└── vanilla
│ ├── AppVanilla.svelte
│ ├── index.html
│ └── main.ts
├── images
├── JS-logo.svg
├── TS-logo.svg
├── maptiler-client-logo.svg
├── maptiler-logo-256.png
├── maptiler-logo.svg
├── react-logo.svg
└── svelte-logo.svg
├── index.html
├── package-lock.json
├── package.json
├── public
└── icons
│ ├── 10pin.svg
│ ├── 9pin.svg
│ ├── advertising_column.svg
│ ├── aerodrome.svg
│ ├── alcohol.svg
│ ├── alpine_hut.svg
│ ├── amusement_arcade.svg
│ ├── amusement_park.svg
│ ├── apartment.svg
│ ├── archaeological_site.svg
│ ├── area.svg
│ ├── art.svg
│ ├── arts_centre.svg
│ ├── artwork.svg
│ ├── audioguide.svg
│ ├── bag.svg
│ ├── beauty.svg
│ ├── bed.svg
│ ├── bell_tower.svg
│ ├── beverages.svg
│ ├── bicycle_repair_station.svg
│ ├── biergarten.svg
│ ├── bird_hide.svg
│ ├── boat_rental.svg
│ ├── bookmaker.svg
│ ├── books.svg
│ ├── bowl.svg
│ ├── bowling_alley.svg
│ ├── bunker.svg
│ ├── bureau_de_change.svg
│ ├── bus_station.svg
│ ├── bust.svg
│ ├── camping.svg
│ ├── car_parts.svg
│ ├── car_wash.svg
│ ├── caravan_park.svg
│ ├── carpet.svg
│ ├── cattle_grid.svg
│ ├── cave_entrance.svg
│ ├── chalet.svg
│ ├── charity.svg
│ ├── chemist.svg
│ ├── chimney.svg
│ ├── church.svg
│ ├── city_gate.svg
│ ├── clinic.svg
│ ├── clothes.svg
│ ├── coffee.svg
│ ├── community_centre.svg
│ ├── computer.svg
│ ├── consulate.svg
│ ├── copyshop.svg
│ ├── cosmetics.svg
│ ├── courthouse.svg
│ ├── crane.svg
│ ├── dairy.svg
│ ├── deli.svg
│ ├── department_store.svg
│ ├── diy.svg
│ ├── electronics.svg
│ ├── embankment.svg
│ ├── embassy.svg
│ ├── excrement_bags.svg
│ ├── fabric.svg
│ ├── farmyard.svg
│ ├── ferry.svg
│ ├── firepit.svg
│ ├── firestation.svg
│ ├── fishing.svg
│ ├── fitness.svg
│ ├── ford.svg
│ ├── fort.svg
│ ├── fortress.svg
│ ├── full-height_turnstile.svg
│ ├── generator_wind.svg
│ ├── golf_pin.svg
│ ├── greengrocer.svg
│ ├── guest_house.svg
│ ├── helipad.svg
│ ├── hifi.svg
│ ├── hostel.svg
│ ├── hotel.svg
│ ├── housenumber.svg
│ ├── houseware.svg
│ ├── hunting_stand.svg
│ ├── interior_decoration.svg
│ ├── internet_cafe.svg
│ ├── kindergarten.svg
│ ├── kissing_gate.svg
│ ├── manor.svg
│ ├── map.svg
│ ├── marker_reverse.svg
│ ├── marker_selected.svg
│ ├── marker_unselected.svg
│ ├── marketplace.svg
│ ├── massage.svg
│ ├── mast.svg
│ ├── mast_communications.svg
│ ├── mast_lighting.svg
│ ├── medical_supply.svg
│ ├── memorial.svg
│ ├── miniature_golf.svg
│ ├── motel.svg
│ ├── mountain_range.svg
│ ├── multifaith.svg
│ ├── musical_instrument.svg
│ ├── newsagent.svg
│ ├── nightclub.svg
│ ├── ocean.svg
│ ├── office.svg
│ ├── outdoor_seating.svg
│ ├── palace.svg
│ ├── parcel_locker.svg
│ ├── parking_space.svg
│ ├── parking_tickets.svg
│ ├── pet.svg
│ ├── photo.svg
│ ├── picnic.svg
│ ├── plaque.svg
│ ├── poi.svg
│ ├── post_box.svg
│ ├── post_office.svg
│ ├── postal_code.svg
│ ├── pub.svg
│ ├── public_bath.svg
│ ├── public_bookcase.svg
│ ├── public_building.svg
│ ├── public_transport_tickets.svg
│ ├── reverse.svg
│ ├── river.svg
│ ├── road.svg
│ ├── saddle.svg
│ ├── sauna.svg
│ ├── sea.svg
│ ├── second_hand.svg
│ ├── shintoist.svg
│ ├── shoe.svg
│ ├── shower.svg
│ ├── shrine.svg
│ ├── sikhist.svg
│ ├── slipway.svg
│ ├── snowmobile.svg
│ ├── social_facility.svg
│ ├── sports.svg
│ ├── sprite.json
│ ├── sprite.png
│ ├── sprite@2x.json
│ ├── sprite@2x.png
│ ├── stationery.svg
│ ├── stile.svg
│ ├── stone.svg
│ ├── storage_tank.svg
│ ├── stream.svg
│ ├── street.svg
│ ├── supermarket.svg
│ ├── tea.svg
│ ├── telescope_dish.svg
│ ├── telescope_dome.svg
│ ├── ticket.svg
│ ├── tobacco.svg
│ ├── tower_cantilever_communication.svg
│ ├── tower_cooling.svg
│ ├── tower_dish.svg
│ ├── tower_dome.svg
│ ├── tower_generic.svg
│ ├── tower_lattice.svg
│ ├── tower_lattice_communication.svg
│ ├── tower_lattice_lighting.svg
│ ├── tower_lighting.svg
│ ├── townhall.svg
│ ├── toys.svg
│ ├── trade.svg
│ ├── traffic_light.svg
│ ├── train_station.svg
│ ├── travel_agency.svg
│ ├── tyres.svg
│ ├── university.svg
│ ├── variety_store.svg
│ ├── vehicle_inspection.svg
│ ├── vending_machine.svg
│ ├── video.svg
│ ├── video_games.svg
│ ├── waste_disposal.svg
│ ├── water_well.svg
│ ├── waterfall.svg
│ └── wilderness_hut.svg
├── replace-env-vars.js
├── src
├── ClearIcon.svelte
├── FailIcon.svelte
├── FeatureItem.svelte
├── GeocodingControl.svelte
├── LoadingIcon.svelte
├── MapLibreBasedGeocodingControl.ts
├── MarkerIcon.svelte
├── ReverseGeocodingIcon.svelte
├── SearchIcon.svelte
├── geo-coordinates-parser.t.ts
├── geoUtils.ts
├── leaflet-controller.ts
├── leaflet.ts
├── maplibregl-controller.ts
├── maplibregl.ts
├── maptilersdk.ts
├── mask.ts
├── openlayers-controller.ts
├── openlayers.ts
├── proximity.ts
├── react.ts
├── types.ts
├── vanilla.ts
└── vite-env.d.ts
├── svelte.config.js
├── sync-info.js
├── tsconfig.dist.json
├── tsconfig.json
├── tsconfig.node.json
└── vite.config.ts
/.env:
--------------------------------------------------------------------------------
1 | VITE_API_URL=https://api.maptiler.com/geocoding
2 | VITE_LIB_VERSION=$npm_package_version
3 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: "[BUG]"
5 | labels: ""
6 | assignees: zdila
7 | ---
8 |
9 | **Describe the bug**
10 | A clear and concise description of what the bug is.
11 |
12 | **To Reproduce**
13 | Steps to reproduce the behavior and browser identification.
14 |
15 | **Expected behavior**
16 | A clear and concise description of what you expected to happen.
17 |
18 | **Screenshots**
19 | If applicable, add screenshots to help explain your problem.
20 |
21 | **Additional context**
22 | Add any other context about the problem here.
23 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: "[FEATURE]"
5 | labels: ""
6 | assignees: jachym
7 | ---
8 |
9 | **Is your feature request related to a problem? Please describe.**
10 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
11 |
12 | **Describe the solution you'd like**
13 | A clear and concise description of what you want to happen.
14 |
15 | **Describe alternatives you've considered**
16 | A clear and concise description of any alternative solutions or features you've considered.
17 |
18 | **Additional context**
19 | Add any other context or screenshots about the feature request here.
20 |
--------------------------------------------------------------------------------
/.github/pull_request_template.md:
--------------------------------------------------------------------------------
1 | GO-XXX
2 |
3 | ## Objective
4 | What is the goal?
5 |
6 | ## Description
7 | What changed, how and why?
8 |
9 | ### Acceptance
10 | How were changes tested?
11 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | pnpm-debug.log*
8 | lerna-debug.log*
9 |
10 | node_modules
11 | dist
12 | dist.svelte
13 | *.local
14 | .svelte-kit
15 |
16 | # Editor directories and files
17 | .vscode/*
18 | !.vscode/extensions.json
19 | .idea
20 | .DS_Store
21 | *.suo
22 | *.ntvs*
23 | *.njsproj
24 | *.sln
25 | *.sw?
26 |
27 | *.tgz
28 | src/info.json
29 |
--------------------------------------------------------------------------------
/.husky/pre-commit:
--------------------------------------------------------------------------------
1 | npm exec -- lint-staged
2 |
--------------------------------------------------------------------------------
/.lintstagedrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "*": ["prettier --check"],
3 | "*.{ts,svelte}": ["eslint"]
4 | }
5 |
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "plugins": ["prettier-plugin-svelte", "prettier-plugin-organize-imports"],
3 | "overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }],
4 | "organizeImportsSkipDestructiveCodeActions": true
5 | }
6 |
--------------------------------------------------------------------------------
/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": ["svelte.svelte-vscode"]
3 | }
4 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6 |
7 | ## Our Standards
8 |
9 | Examples of behavior that contributes to creating a positive environment include:
10 |
11 | - Using welcoming and inclusive language
12 | - Being respectful of differing viewpoints and experiences
13 | - Gracefully accepting constructive criticism
14 | - Focusing on what is best for the community
15 | - Showing empathy towards other community members
16 |
17 | Examples of unacceptable behavior by participants include:
18 |
19 | - The use of sexualized language or imagery and unwelcome sexual attention or advances
20 | - Trolling, insulting/derogatory comments, and personal or political attacks
21 | - Public or private harassment
22 | - Publishing others' private information, such as a physical or electronic address, without explicit permission
23 | - Other conduct which could reasonably be considered inappropriate in a professional setting
24 |
25 | ## Our Responsibilities
26 |
27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28 |
29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30 |
31 | ## Scope
32 |
33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34 |
35 | ## Enforcement
36 |
37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the MapTiler support team at `support [at] maptiler.com` . The support team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The support team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38 |
39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the leadership.
40 |
41 | ## Attribution
42 |
43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [https://contributor-covenant.org/version/1/4][version]
44 |
45 | [homepage]: https://contributor-covenant.org
46 | [version]: https://contributor-covenant.org/version/1/4/
47 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | ## Contributing
2 |
3 | Thank you for considering contributing to MapTiler Geocoding Control package. It's people
4 | like you that make it to great tool.
5 |
6 | ### Where do I go from here?
7 |
8 | If you've noticed a bug or have a feature request, [make one](https://github.com/maptiler/maptiler-geocoding-control/issues/new/choose)! It's
9 | generally best if you get confirmation of your bug or approval for your feature
10 | request this way before starting to code.
11 |
12 | If you have a general question about MapTiler Geocoding Control, you can reach out to the
13 | [MapTiler documentation portal](https://documentation.maptiler.com/hc/en-us/search?query=geocoding)
14 | or contact [our support](https://documentation.maptiler.com/hc/en-us/requests/new), the issue tracker is only for bugs and feature requests.
15 |
16 | ### Fork & create a branch
17 |
18 | If this is something you think you can fix, then [create the fork](https://github.com/maptiler/maptiler-geocoding-control/fork) and create
19 | a branch with a descriptive name.
20 |
21 | A good branch name would be (where issue #325 is the ticket you're working on):
22 |
23 | ```sh
24 | git checkout -b 325-add-poi-filter
25 | ```
26 |
27 | ### Get the test suite running
28 |
29 | Make sure you're using a recent version of NodeJS.
30 |
31 | Install the development dependencies:
32 |
33 | ```sh
34 | npm install
35 | ```
36 |
37 | Then run the development mode, make sure, you export the [MapTiler Key](https://docs.maptiler.com/cloud/api/authentication-key/) as environment variable
38 |
39 | ```sh
40 | VITE_API_KEY=YOUR_MAPTILER_API_KEY_HERE npm run dev
41 | ```
42 |
43 | ### Implement your fix or feature
44 |
45 | At this point, you're ready to make your changes! Feel free to ask for help;
46 | everyone is a beginner at first :smile_cat:
47 |
48 | ### Make a Pull Request
49 |
50 | At this point, you should switch back to your master branch and make sure it's
51 | up to date with MapTiler Geocoding Control main branch:
52 |
53 | ```sh
54 | git remote add upstream git@github.com:maptiler/maptiler-geocoding-control.git
55 | git checkout main
56 | git pull upstream main
57 | ```
58 |
59 | Then update your feature branch from your local copy of master, and push it!
60 |
61 | ```sh
62 | git checkout 325-add-poi-filter
63 | git rebase main
64 | git push --set-upstream origin 325-add-poi-filter
65 | ```
66 |
67 | Finally, go to GitHub and [make a Pull Request](https://github.com/maptiler/maptiler-geocoding-control/compare)
68 |
69 | ## Final word
70 |
71 | Thank you one more time for your contribution. We try to deliver best user experience of geocoding, your contribution
72 | will make better experience to all users!
73 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | BSD 3-Clause License
2 |
3 | Copyright (c) 2023, MapTiler
4 | All rights reserved.
5 |
6 | Redistribution and use in source and binary forms, with or without
7 | modification, are permitted provided that the following conditions are met:
8 |
9 | 1. Redistributions of source code must retain the above copyright notice, this
10 | list of conditions and the following disclaimer.
11 |
12 | 2. Redistributions in binary form must reproduce the above copyright notice,
13 | this list of conditions and the following disclaimer in the documentation
14 | and/or other materials provided with the distribution.
15 |
16 | 3. Neither the name of the copyright holder nor the names of its
17 | contributors may be used to endorse or promote products derived from
18 | this software without specific prior written permission.
19 |
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
7 | The Javascript & TypeScript Map Control component for MapTiler Geocoding service! Easy to be integrated into any JavaScript mapping application.
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | # MapTiler Geocoding control for MapTiler SDK, MapLibre GL JS, Leaflet and OpenLayers
20 |
21 | ## About
22 |
23 | A _Geocoding control_ for [MapTiler SDK](https://github.com/maptiler/maptiler-sdk-js),
24 | [MapLibre GL JS](https://github.com/maplibre/maplibre-gl-js),
25 | [Leaflet](https://leafletjs.com) and [OpenLayers](https://openlayers.org) utilizes [MapTiler Cloud Geocoding
26 | API](https://www.maptiler.com/cloud/geocoding/). With this control, users of
27 | mapping application can find any place on Earth (States, Cities, Streets, Addresses, POIs, ...) down
28 | to the address level, restrict the search area to a specific country, highlight
29 | searched results on the map, autocomplete words while typing, and much more.
30 |
31 | The component can be used as an ES module or UMD module with or without bundler.
32 |
33 | Geocoding control is also provided as [React component](https://docs.maptiler.com/sdk-js/modules/geocoding/api/usage/react/) and [Svelte component](https://docs.maptiler.com/sdk-js/modules/geocoding/api/usage/svelte/) and [other libraries](#installation-and-more-usage-examples).
34 |
35 | ## Quick start
36 |
37 | Install the Geocoding control unsing `npm`:
38 |
39 | **⚠️ Warning! ⚠️**
40 |
41 | The current version of Geocoding Control is only compatible with Svelte v4, this will potentially cause peer dependency issues when installing with certain versions of npm in Svelte projects (eg if you're using Svelte v5), or if you intend to import the Svelte component directly.
42 |
43 | If you are using a this library in a Svelte project you can npm install with `--force` or `--legacy-peer-deps` and use only the **pre-compiled `GeoLocatControl` vanilla module**, not the Svelte component.
44 |
45 | ```shell
46 | npm install --save @maptiler/geocoding-control @maptiler/sdk
47 | ```
48 |
49 | Use the component in your mapping application:
50 |
51 | ```js
52 | import * as maptilersdk from "@maptiler/sdk";
53 | import { GeocodingControl } from "@maptiler/geocoding-control/maptilersdk";
54 | import "@maptiler/sdk/dist/maptiler-sdk.css";
55 | import "@maptiler/geocoding-control/style.css";
56 |
57 | maptilersdk.config.apiKey = "YOUR_MAPTILER_API_KEY_HERE";
58 |
59 | const map = new maptilersdk.Map({
60 | container: "map", // id of HTML container element
61 | });
62 |
63 | const gc = new GeocodingControl();
64 |
65 | map.addControl(gc);
66 | ```
67 |
68 | NOTE: Get your personal [MapTiler API key](https://docs.maptiler.com/cloud/api/authentication-key/) in the [MapTiler Cloud](https://cloud.maptiler.com).
69 |
70 | ## Installation and more usage examples
71 |
72 | - [With MapTiler SDK](https://docs.maptiler.com/sdk-js/modules/geocoding/api/usage/sdk-js/)
73 | - [With MapLibre GL](https://docs.maptiler.com/sdk-js/modules/geocoding/api/usage/maplibre-gl-js/)
74 | - [With Leaflet](https://docs.maptiler.com/sdk-js/modules/geocoding/api/usage/leaflet/)
75 | - [With OpenLayers](https://docs.maptiler.com/sdk-js/modules/geocoding/api/usage/openlayers/)
76 | - [As a React component](https://docs.maptiler.com/sdk-js/modules/geocoding/api/usage/react/)
77 | - [As Svelte component](https://docs.maptiler.com/sdk-js/modules/geocoding/api/usage/svelte/)
78 | - [As vanilla JavaScript module](https://docs.maptiler.com/sdk-js/modules/geocoding/api/usage/vanilla-js/)
79 |
80 | ## API Documentation
81 |
82 | In addition to the details and examples provided in this `README.md` and our documentation, check out
83 |
84 | - [The complete Geocoding service API documentation](https://docs.maptiler.com/cloud/api/geocoding/)
85 | - [The complete Geocoding control reference](https://docs.maptiler.com/sdk-js/modules/geocoding/api/api-reference/)
86 | - [UMD global variables](https://docs.maptiler.com/sdk-js/modules/geocoding/#umd-global-variables)
87 |
88 | ## Development
89 |
90 | ### Building
91 |
92 | ```bash
93 | npm install && npm run build
94 | ```
95 |
96 | You will find compilation result in the `dist` directory.
97 |
98 | ### Running in dev mode
99 |
100 | ```bash
101 | npm install && VITE_API_KEY=YOUR_MAPTILER_API_KEY_HERE npm run dev
102 | ```
103 |
104 | ### POI icons and bundlers
105 |
106 | POI icons are served from CDN per default. If there is an requirement to serve them from a different location and the control is used in the application which is built with Web Application bundler (like Webpack or Vite) then it is necessary to do some extra configuration. Icons are bundled in the library and you can find them in `node_modules/@maptiler/geocoding-control/icons`. Configure your bundler and/or provide `iconsBaseUrl` option for the icons to be properly resolved. You can also copy icons from that directory to your `public` directory.
107 |
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 | # Security Policy
2 |
3 | ## Supported Versions
4 |
5 | Following versions are supported with security updateds:
6 |
7 | | Version | Supported |
8 | | ------- | ------------------ |
9 | | 0.0.x | :white_check_mark: |
10 |
11 | ## Reporting a Vulnerability
12 |
13 | To report Vulnerability, add [new issue](https://github.com/maptiler/maptiler-geocoding-control/issues/new/choose) to the issues tracker
14 |
--------------------------------------------------------------------------------
/create-cdn-pr.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -e
3 |
4 | export GIT_WORK_TREE=../cdn.maptiler.com
5 | export GIT_DIR=$GIT_WORK_TREE/.git
6 |
7 | git checkout main
8 |
9 | git pull
10 |
11 | VERSION=$npm_package_version
12 |
13 | git checkout -b maptiler-geocoding-control-$VERSION
14 |
15 | BASE=../cdn.maptiler.com/maptiler-geocoding-control
16 |
17 | mkdir -p $BASE/v$VERSION
18 |
19 | cp -r dist/* $BASE/v$VERSION
20 |
21 | ln -sfn v$VERSION $BASE/latest
22 |
23 | git add maptiler-geocoding-control/v$VERSION maptiler-geocoding-control/latest
24 |
25 | git reset maptiler-geocoding-control/v$VERSION/*.tgz
26 |
27 | git commit -m "Add maptiler-geocoding-control v$VERSION"
28 |
29 | gh pr create --base main --fill --repo maptiler/cdn.maptiler.com
30 |
--------------------------------------------------------------------------------
/deno.lock:
--------------------------------------------------------------------------------
1 | {
2 | "version": "4",
3 | "redirects": {
4 | "https://cdn.skypack.dev/chroma-js": "https://cdn.skypack.dev/new/chroma-js@v3.1.2/dist=es2019",
5 | "https://cdn.skypack.dev/new/chroma-js@v3.1.2/dist=es2019": "https://cdn.skypack.dev/error/build:chroma-js@v3.1.2-QwkMr4VCpNO0CLkbGUyZ"
6 | },
7 | "remote": {
8 | "https://cdn.skypack.dev/error/build:chroma-js@v3.1.2-QwkMr4VCpNO0CLkbGUyZ": "97aee30af87a5f6905a6af1a3eb1ed523426de337cf7d92ed3604a6b289eca8b"
9 | },
10 | "workspace": {
11 | "packageJson": {
12 | "dependencies": [
13 | "npm:@maptiler/sdk@^2.5.0",
14 | "npm:@sveltejs/package@^2.3.7",
15 | "npm:@sveltejs/vite-plugin-svelte@^3.1.2",
16 | "npm:@tsconfig/svelte@^5.0.4",
17 | "npm:@turf/bbox@^7.1.0",
18 | "npm:@turf/clone@^7.1.0",
19 | "npm:@turf/difference@^7.1.0",
20 | "npm:@turf/flatten@^7.1.0",
21 | "npm:@turf/union@^7.1.0",
22 | "npm:@types/geojson@^7946.0.15",
23 | "npm:@types/leaflet@^1.9.15",
24 | "npm:@types/node@^22.10.1",
25 | "npm:@types/react-dom@^19.0.2",
26 | "npm:@types/react@^19.0.1",
27 | "npm:concurrently@^9.1.0",
28 | "npm:dotenv@^16.4.7",
29 | "npm:eslint-plugin-svelte@^2.46.1",
30 | "npm:eslint@^9.16.0",
31 | "npm:esm-env@^1.2.1",
32 | "npm:geo-coordinates-parser@^1.7.4",
33 | "npm:globals@^15.13.0",
34 | "npm:husky@^9.1.7",
35 | "npm:leaflet@^1.9.4",
36 | "npm:lint-staged@^15.2.11",
37 | "npm:maplibre-gl@^4.7.1",
38 | "npm:ol@10.3",
39 | "npm:prettier-plugin-organize-imports@^4.1.0",
40 | "npm:prettier-plugin-svelte@^3.3.2",
41 | "npm:prettier@^3.4.2",
42 | "npm:react-dom@19",
43 | "npm:react@19",
44 | "npm:replace-in-file@^8.2.0",
45 | "npm:sass@^1.82.0",
46 | "npm:svelte-check@^4.1.1",
47 | "npm:svelte-preprocess@^6.0.3",
48 | "npm:svelte@^4.2.19",
49 | "npm:tslib@^2.8.1",
50 | "npm:typescript-eslint@^8.18.0",
51 | "npm:typescript@^5.7.2",
52 | "npm:vite@^5.4.11"
53 | ]
54 | }
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/eslint.config.js:
--------------------------------------------------------------------------------
1 | import js from "@eslint/js";
2 | import tsParser from "@typescript-eslint/parser";
3 | import eslintPluginSvelte from "eslint-plugin-svelte";
4 | import globals from "globals";
5 | import svelteParser from "svelte-eslint-parser";
6 | import tsEslint from "typescript-eslint";
7 |
8 | export default [
9 | js.configs.recommended,
10 | ...tsEslint.configs.strict,
11 | ...eslintPluginSvelte.configs["flat/recommended"],
12 | ...eslintPluginSvelte.configs["flat/prettier"],
13 | {
14 | rules: {
15 | "no-undef": "off",
16 | "@typescript-eslint/no-unused-vars": [
17 | "error",
18 | { ignoreRestSiblings: true },
19 | ],
20 | // TODO for the reason of next 2 rules see https://github.com/eslint/eslint/issues/19134#issuecomment-2480588649
21 | "@typescript-eslint/no-unused-expressions": [
22 | "error",
23 | {
24 | allowShortCircuit: true,
25 | allowTernary: true,
26 | },
27 | ],
28 | "@typescript-eslint/no-empty-function": [
29 | "error",
30 | { allow: ["arrowFunctions"] },
31 | ],
32 | },
33 | },
34 | {
35 | ignores: [
36 | "dist/",
37 | "dist.svelte/",
38 | ".svelte-kit/",
39 | "replace-env-vars.js",
40 | "eslint.config.js",
41 | "svelte.config.js",
42 | ],
43 | },
44 | {
45 | files: ["**/*.svelte"],
46 | languageOptions: {
47 | ecmaVersion: 2022,
48 | sourceType: "module",
49 | globals: {
50 | ...globals.browser,
51 | RequestInit: false,
52 | },
53 | parser: svelteParser,
54 | parserOptions: {
55 | parser: tsParser,
56 | // project: true,
57 | extraFileExtensions: [".svelte"],
58 | },
59 | },
60 | },
61 | ];
62 |
--------------------------------------------------------------------------------
/examples/leaflet/AppLeaflet.svelte:
--------------------------------------------------------------------------------
1 |
63 |
64 |
65 |
66 |
72 |
--------------------------------------------------------------------------------
/examples/leaflet/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | MapTiler Geocoding Control :: Leaflet
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/examples/leaflet/main.ts:
--------------------------------------------------------------------------------
1 | import App from "./AppLeaflet.svelte";
2 |
3 | const appElement = document.getElementById("app");
4 |
5 | if (!appElement) {
6 | throw new Error("element with id 'app' not found");
7 | }
8 |
9 | export default new App({ target: appElement });
10 |
--------------------------------------------------------------------------------
/examples/maplibregl/AppMapLibreGl.svelte:
--------------------------------------------------------------------------------
1 |
81 |
82 |
83 |
84 |
90 |
--------------------------------------------------------------------------------
/examples/maplibregl/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | MapTiler Geocoding Control :: MapLibre GL JS
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/examples/maplibregl/main.ts:
--------------------------------------------------------------------------------
1 | import App from "./AppMapLibreGl.svelte";
2 |
3 | const appElement = document.getElementById("app");
4 |
5 | if (!appElement) {
6 | throw new Error("element with id 'app' not found");
7 | }
8 |
9 | export default new App({ target: appElement });
10 |
--------------------------------------------------------------------------------
/examples/maptiler-sdk/AppMapTilerSdk.svelte:
--------------------------------------------------------------------------------
1 |
53 |
54 |
55 |
56 |
62 |
--------------------------------------------------------------------------------
/examples/maptiler-sdk/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | MapTiler Geocoding Control :: MapTiler SDK
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/examples/maptiler-sdk/main.ts:
--------------------------------------------------------------------------------
1 | import App from "./AppMapTilerSdk.svelte";
2 |
3 | const appElement = document.getElementById("app");
4 |
5 | if (!appElement) {
6 | throw new Error("element with id 'app' not found");
7 | }
8 |
9 | export default new App({ target: appElement });
10 |
--------------------------------------------------------------------------------
/examples/openlayers/AppOpenLayers.svelte:
--------------------------------------------------------------------------------
1 |
57 |
58 |
59 |
60 |
72 |
--------------------------------------------------------------------------------
/examples/openlayers/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | MapTiler Geocoding Control :: OpenLayers
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/examples/openlayers/main.ts:
--------------------------------------------------------------------------------
1 | import App from "./AppOpenLayers.svelte";
2 |
3 | const appElement = document.getElementById("app");
4 |
5 | if (!appElement) {
6 | throw new Error("element with id 'app' not found");
7 | }
8 |
9 | export default new App({ target: appElement });
10 |
--------------------------------------------------------------------------------
/examples/react/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | MapTiler Geocoding Control :: React
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/examples/react/style.css:
--------------------------------------------------------------------------------
1 | html,
2 | body,
3 | main {
4 | height: 100%;
5 | background-color: #eee;
6 | }
7 |
8 | main {
9 | padding: 1em;
10 | display: flex;
11 | flex-direction: column;
12 | }
13 |
14 | .control-bar {
15 | display: flex;
16 | gap: 0.5em;
17 | align-items: center;
18 | flex-wrap: wrap;
19 | }
20 |
21 | .flex-grow {
22 | flex-grow: 1;
23 | }
24 |
25 | .overflow-auto {
26 | overflow: auto;
27 | }
28 |
29 | .logs {
30 | display: grid;
31 | column-gap: 1em;
32 | grid-template-columns: auto 1fr;
33 | height: 0px; /* fixes overflow */
34 | }
35 |
36 | .logs > div:nth-child(2n) {
37 | text-wrap: nowrap;
38 | color: blue;
39 | }
40 |
41 | select {
42 | margin-right: 2ex;
43 | }
44 |
45 | button.is-small {
46 | padding: 4px 8px;
47 | font-size: 0.8em;
48 | }
49 |
--------------------------------------------------------------------------------
/examples/standalone/leaflet.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
11 |
12 |
13 |
21 |
22 |
28 |
29 |
30 |
31 |
68 |
--------------------------------------------------------------------------------
/examples/standalone/maplibregl.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
11 |
12 |
13 |
21 |
22 |
28 |
29 |
30 |
31 |
68 |
--------------------------------------------------------------------------------
/examples/standalone/ol.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
19 |
20 |
32 |
33 |
34 |
35 |
76 |
--------------------------------------------------------------------------------
/examples/vanilla/AppVanilla.svelte:
--------------------------------------------------------------------------------
1 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/examples/vanilla/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | MapTiler Geocoding Control :: Vanilla JS
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/examples/vanilla/main.ts:
--------------------------------------------------------------------------------
1 | import App from "./AppVanilla.svelte";
2 |
3 | const appElement = document.getElementById("app");
4 |
5 | if (!appElement) {
6 | throw new Error("element with id 'app' not found");
7 | }
8 |
9 | export default new App({ target: appElement });
10 |
--------------------------------------------------------------------------------
/images/JS-logo.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/images/TS-logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
7 |
--------------------------------------------------------------------------------
/images/maptiler-logo-256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maptiler/maptiler-geocoding-control/e8b4d65286d75c9dd906f24c554c42582ae71b91/images/maptiler-logo-256.png
--------------------------------------------------------------------------------
/images/maptiler-logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
24 |
--------------------------------------------------------------------------------
/images/react-logo.svg:
--------------------------------------------------------------------------------
1 |
10 |
--------------------------------------------------------------------------------
/images/svelte-logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
21 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 | MapTiler Geocoding Control
11 |
12 |