@mapbox/search-js-web
Advanced tools
Comparing version 1.0.0-beta.19 to 1.0.0-beta.20
@@ -7,1 +7,2 @@ export declare const STATIC_BASE_URL_SATELLITE: string; | ||
export declare const SEARCHBOX_TEMPLATE: HTMLTemplateElement; | ||
export declare const GEOCODER_TEMPLATE: HTMLTemplateElement; |
@@ -9,2 +9,3 @@ /// <reference path="../src/types/custom_elements.d.ts" /> | ||
export { MapboxSearchBox } from './components/MapboxSearchBox'; | ||
export { MapboxGeocoder } from './components/MapboxGeocoder'; | ||
export { MapboxAddressMinimap } from './components/MapboxAddressMinimap'; | ||
@@ -11,0 +12,0 @@ export { MapboxHTMLEvent } from './MapboxHTMLEvent'; |
@@ -17,3 +17,3 @@ import mapboxgl from 'mapbox-gl'; | ||
* Gets the maximum zoom level for a [Mapbox Search Box API](https://docs.mapbox.com/api/search/search-box/) | ||
* or [Mapbox Geocoding API](https://docs.mapbox.com/api/search/geocoding/) place type. | ||
* or [Mapbox Geocoding API](https://docs.mapbox.com/api/search/geocoding-v6/) place type. | ||
* | ||
@@ -20,0 +20,0 @@ * @returns The maximum zoom level for the given place type, `16` if the type is not supported. |
export declare enum SEARCH_SERVICE { | ||
AddressAutofill = 0, | ||
GeocodingV5 = 1, | ||
GeocodingV6 = 2, | ||
SearchBox = 3 | ||
Geocoding = 1, | ||
SearchBox = 2 | ||
} |
{ | ||
"name": "@mapbox/search-js-web", | ||
"version": "1.0.0-beta.19", | ||
"version": "1.0.0-beta.20", | ||
"description": "Search web component with form autocomplete.", | ||
@@ -23,3 +23,3 @@ "main": "dist/index.js", | ||
"@floating-ui/dom": "^0.5.2", | ||
"@mapbox/search-js-core": "^1.0.0-beta.19", | ||
"@mapbox/search-js-core": "^1.0.0-beta.20", | ||
"@mapbox/sphericalmercator": "^1.2.0", | ||
@@ -78,5 +78,5 @@ "focus-trap": "^6.7.3", | ||
"path": "dist/mapboxsearch.js", | ||
"limit": "36 kB" | ||
"limit": "37 kB" | ||
} | ||
] | ||
} |
@@ -5,2 +5,3 @@ import mapboxgl from 'mapbox-gl'; | ||
MapboxSearchBox, | ||
MapboxGeocoder, | ||
MapboxAddressMinimap, | ||
@@ -122,5 +123,7 @@ Theme, | ||
const element = (document.querySelector('mapbox-address-autofill') ?? | ||
document.querySelector('mapbox-search-box')) as | ||
document.querySelector('mapbox-search-box') ?? | ||
document.querySelector('mapbox-geocoder')) as | ||
| MapboxAddressAutofill | ||
| MapboxSearchBox; | ||
| MapboxSearchBox | ||
| MapboxGeocoder; | ||
@@ -214,7 +217,39 @@ if (element) { | ||
// clonedElement.search('99 green st'); | ||
// const searchbox = new MapboxSearchBox(); | ||
// searchbox.accessToken = ACCESS_TOKEN; | ||
// map.addControl(searchbox); | ||
} | ||
// const searchbox = new MapboxSearchBox(); | ||
// searchbox.accessToken = ACCESS_TOKEN; | ||
// map.addControl(searchbox); | ||
if (element instanceof MapboxGeocoder) { | ||
element.bindMap(map); | ||
element.mapboxgl = mapboxgl; | ||
element.addEventListener('input', (e) => { | ||
if (e.target !== e.currentTarget) return; | ||
console.log('input', e); | ||
}); | ||
element.addEventListener('suggest', (res) => console.log('suggest', res)); | ||
element.addEventListener('suggesterror', (err) => | ||
console.log('error', err) | ||
); | ||
element.addEventListener('retrieve', (res) => console.log('retrieve', res)); | ||
const clonedElement = element.cloneNode(true) as MapboxGeocoder; | ||
clonedElement.accessToken = ACCESS_TOKEN; | ||
clonedElement.options.language = 'pt'; | ||
clonedElement.mapboxgl = mapboxgl; | ||
clonedElement.marker = { color: 'red' }; | ||
map.addControl(clonedElement); | ||
selectEl.addEventListener('change', () => { | ||
clonedElement.theme = THEMES[selectEl.value]; | ||
}); | ||
// clonedElement.search('99 green st'); | ||
// const searchbox = new MapboxSearchBox(); | ||
// searchbox.accessToken = ACCESS_TOKEN; | ||
// map.addControl(searchbox); | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
3478754
78
15094