@maptiler/geocoding-control 2.1.7 → 3.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CODE_OF_CONDUCT.md +46 -0
- package/CONTRIBUTING.md +72 -0
- package/README.md +34 -26
- package/SECURITY.md +16 -0
- package/dist/index.js +856 -0
- package/dist/index.js.map +1 -0
- package/dist/index.umd.js +263 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/leaflet.public.js +1273 -0
- package/dist/leaflet.public.js.map +1 -0
- package/dist/leaflet.public.umd.js +276 -0
- package/dist/leaflet.public.umd.js.map +1 -0
- package/dist/maplibregl.js +1297 -0
- package/dist/maplibregl.js.map +1 -0
- package/dist/maplibregl.umd.js +276 -0
- package/dist/maplibregl.umd.js.map +1 -0
- package/dist/maptilersdk.js +1305 -0
- package/dist/maptilersdk.js.map +1 -0
- package/dist/maptilersdk.umd.js +276 -0
- package/dist/maptilersdk.umd.js.map +1 -0
- package/dist/src/components/clear-icon.d.ts +10 -0
- package/dist/src/components/fail-icon.d.ts +10 -0
- package/dist/src/components/loading-icon.d.ts +10 -0
- package/dist/src/components/marker.d.ts +10 -0
- package/dist/src/components/reverse-geocoding-icon.d.ts +10 -0
- package/dist/src/components/search-icon.d.ts +10 -0
- package/dist/src/controls/leaflet-control.d.ts +58 -0
- package/dist/src/controls/leaflet-events.d.ts +42 -0
- package/dist/src/controls/leaflet-options.d.ts +84 -0
- package/dist/src/controls/maplibregl-control.d.ts +55 -0
- package/dist/src/controls/maplibregl-events.d.ts +44 -0
- package/dist/src/controls/maplibregl-options.d.ts +104 -0
- package/dist/src/controls/maptilersdk-control.d.ts +6 -0
- package/dist/src/controls/maptilersdk-events.d.ts +2 -0
- package/dist/src/controls/maptilersdk-options.d.ts +10 -0
- package/dist/src/geocoder/geocoder-events.d.ts +46 -0
- package/dist/src/geocoder/geocoder-feature-item.d.ts +22 -0
- package/{svelte/types.d.ts → dist/src/geocoder/geocoder-options.d.ts} +11 -147
- package/dist/src/geocoder/geocoder.d.ts +112 -0
- package/dist/src/index.d.ts +9 -0
- package/dist/src/leaflet.public.d.ts +7 -0
- package/dist/src/maplibregl.d.ts +7 -0
- package/dist/src/maptilersdk.d.ts +7 -0
- package/dist/src/types.d.ts +45 -0
- package/dist/src/utils/geo-utils.d.ts +6 -0
- package/dist/src/utils/mask.d.ts +2 -0
- package/dist/src/utils/proximity.d.ts +2 -0
- package/package.json +80 -113
- package/MapLibreBasedGeocodingControl.d.ts +0 -3072
- package/geo-coordinates-parser.t.d.ts +0 -8
- package/geoUtils.d.ts +0 -3
- package/leaflet-controller.d.ts +0 -12
- package/leaflet-controller.js +0 -2475
- package/leaflet-controller.js.map +0 -1
- package/leaflet-controller.umd.js +0 -2
- package/leaflet-controller.umd.js.map +0 -1
- package/leaflet.d.ts +0 -131
- package/leaflet.js +0 -5082
- package/leaflet.js.map +0 -1
- package/leaflet.umd.js +0 -14
- package/leaflet.umd.js.map +0 -1
- package/maplibregl-controller.d.ts +0 -19
- package/maplibregl-controller.js +0 -2418
- package/maplibregl-controller.js.map +0 -1
- package/maplibregl-controller.umd.js +0 -2
- package/maplibregl-controller.umd.js.map +0 -1
- package/maplibregl.d.ts +0 -2509
- package/maplibregl.js +0 -5142
- package/maplibregl.js.map +0 -1
- package/maplibregl.umd.js +0 -14
- package/maplibregl.umd.js.map +0 -1
- package/maptilersdk.d.ts +0 -2504
- package/maptilersdk.js +0 -5152
- package/maptilersdk.js.map +0 -1
- package/maptilersdk.umd.js +0 -14
- package/maptilersdk.umd.js.map +0 -1
- package/mask.d.ts +0 -2
- package/openlayers-controller.d.ts +0 -15
- package/openlayers-controller.js +0 -2174
- package/openlayers-controller.js.map +0 -1
- package/openlayers-controller.umd.js +0 -2
- package/openlayers-controller.umd.js.map +0 -1
- package/openlayers.d.ts +0 -109
- package/openlayers.js +0 -5045
- package/openlayers.js.map +0 -1
- package/openlayers.umd.js +0 -14
- package/openlayers.umd.js.map +0 -1
- package/proximity.d.ts +0 -2
- package/react.d.ts +0 -45
- package/react.js +0 -2795
- package/react.js.map +0 -1
- package/react.umd.js +0 -14
- package/react.umd.js.map +0 -1
- package/style.css +0 -1
- package/svelte/ClearIcon.svelte +0 -12
- package/svelte/ClearIcon.svelte.d.ts +0 -25
- package/svelte/FailIcon.svelte +0 -12
- package/svelte/FailIcon.svelte.d.ts +0 -25
- package/svelte/FeatureItem.svelte +0 -246
- package/svelte/FeatureItem.svelte.d.ts +0 -26
- package/svelte/GeocodingControl.svelte +0 -921
- package/svelte/GeocodingControl.svelte.d.ts +0 -105
- package/svelte/LoadingIcon.svelte +0 -40
- package/svelte/LoadingIcon.svelte.d.ts +0 -25
- package/svelte/MapLibreBasedGeocodingControl.d.ts +0 -3072
- package/svelte/MapLibreBasedGeocodingControl.js +0 -210
- package/svelte/MarkerIcon.svelte +0 -71
- package/svelte/MarkerIcon.svelte.d.ts +0 -18
- package/svelte/ReverseGeocodingIcon.svelte +0 -12
- package/svelte/ReverseGeocodingIcon.svelte.d.ts +0 -25
- package/svelte/SearchIcon.svelte +0 -26
- package/svelte/SearchIcon.svelte.d.ts +0 -25
- package/svelte/geo-coordinates-parser.t.d.ts +0 -8
- package/svelte/geo-coordinates-parser.t.js +0 -1
- package/svelte/geoUtils.d.ts +0 -3
- package/svelte/geoUtils.js +0 -18
- package/svelte/info.json +0 -1
- package/svelte/leaflet-controller.d.ts +0 -12
- package/svelte/leaflet-controller.js +0 -274
- package/svelte/leaflet.d.ts +0 -131
- package/svelte/leaflet.js +0 -116
- package/svelte/maplibregl-controller.d.ts +0 -19
- package/svelte/maplibregl-controller.js +0 -279
- package/svelte/maplibregl.d.ts +0 -2509
- package/svelte/maplibregl.js +0 -17
- package/svelte/maptilersdk.d.ts +0 -2504
- package/svelte/maptilersdk.js +0 -32
- package/svelte/mask.d.ts +0 -2
- package/svelte/mask.js +0 -54
- package/svelte/openlayers-controller.d.ts +0 -15
- package/svelte/openlayers-controller.js +0 -283
- package/svelte/openlayers.d.ts +0 -109
- package/svelte/openlayers.js +0 -178
- package/svelte/proximity.d.ts +0 -2
- package/svelte/proximity.js +0 -60
- package/svelte/react.d.ts +0 -45
- package/svelte/react.js +0 -106
- package/svelte/types.js +0 -1
- package/svelte/vanilla.d.ts +0 -61
- package/svelte/vanilla.js +0 -101
- package/svelte/vite-env.d.ts +0 -2
- package/types.d.ts +0 -391
- package/vanilla.d.ts +0 -61
- package/vanilla.js +0 -2799
- package/vanilla.js.map +0 -1
- package/vanilla.umd.js +0 -14
- package/vanilla.umd.js.map +0 -1
- /package/{icons → dist/icons}/10pin.svg +0 -0
- /package/{icons → dist/icons}/9pin.svg +0 -0
- /package/{icons → dist/icons}/advertising_column.svg +0 -0
- /package/{icons → dist/icons}/aerodrome.svg +0 -0
- /package/{icons → dist/icons}/alcohol.svg +0 -0
- /package/{icons → dist/icons}/alpine_hut.svg +0 -0
- /package/{icons → dist/icons}/amusement_arcade.svg +0 -0
- /package/{icons → dist/icons}/amusement_park.svg +0 -0
- /package/{icons → dist/icons}/apartment.svg +0 -0
- /package/{icons → dist/icons}/archaeological_site.svg +0 -0
- /package/{icons → dist/icons}/area.svg +0 -0
- /package/{icons → dist/icons}/art.svg +0 -0
- /package/{icons → dist/icons}/arts_centre.svg +0 -0
- /package/{icons → dist/icons}/artwork.svg +0 -0
- /package/{icons → dist/icons}/audioguide.svg +0 -0
- /package/{icons → dist/icons}/bag.svg +0 -0
- /package/{icons → dist/icons}/beauty.svg +0 -0
- /package/{icons → dist/icons}/bed.svg +0 -0
- /package/{icons → dist/icons}/bell_tower.svg +0 -0
- /package/{icons → dist/icons}/beverages.svg +0 -0
- /package/{icons → dist/icons}/bicycle_repair_station.svg +0 -0
- /package/{icons → dist/icons}/biergarten.svg +0 -0
- /package/{icons → dist/icons}/bird_hide.svg +0 -0
- /package/{icons → dist/icons}/boat_rental.svg +0 -0
- /package/{icons → dist/icons}/bookmaker.svg +0 -0
- /package/{icons → dist/icons}/books.svg +0 -0
- /package/{icons → dist/icons}/bowl.svg +0 -0
- /package/{icons → dist/icons}/bowling_alley.svg +0 -0
- /package/{icons → dist/icons}/bunker.svg +0 -0
- /package/{icons → dist/icons}/bureau_de_change.svg +0 -0
- /package/{icons → dist/icons}/bus_station.svg +0 -0
- /package/{icons → dist/icons}/bust.svg +0 -0
- /package/{icons → dist/icons}/camping.svg +0 -0
- /package/{icons → dist/icons}/car_parts.svg +0 -0
- /package/{icons → dist/icons}/car_wash.svg +0 -0
- /package/{icons → dist/icons}/caravan_park.svg +0 -0
- /package/{icons → dist/icons}/carpet.svg +0 -0
- /package/{icons → dist/icons}/cattle_grid.svg +0 -0
- /package/{icons → dist/icons}/cave_entrance.svg +0 -0
- /package/{icons → dist/icons}/chalet.svg +0 -0
- /package/{icons → dist/icons}/charity.svg +0 -0
- /package/{icons → dist/icons}/chemist.svg +0 -0
- /package/{icons → dist/icons}/chimney.svg +0 -0
- /package/{icons → dist/icons}/church.svg +0 -0
- /package/{icons → dist/icons}/city_gate.svg +0 -0
- /package/{icons → dist/icons}/clinic.svg +0 -0
- /package/{icons → dist/icons}/clothes.svg +0 -0
- /package/{icons → dist/icons}/coffee.svg +0 -0
- /package/{icons → dist/icons}/community_centre.svg +0 -0
- /package/{icons → dist/icons}/computer.svg +0 -0
- /package/{icons → dist/icons}/consulate.svg +0 -0
- /package/{icons → dist/icons}/copyshop.svg +0 -0
- /package/{icons → dist/icons}/cosmetics.svg +0 -0
- /package/{icons → dist/icons}/courthouse.svg +0 -0
- /package/{icons → dist/icons}/crane.svg +0 -0
- /package/{icons → dist/icons}/dairy.svg +0 -0
- /package/{icons → dist/icons}/deli.svg +0 -0
- /package/{icons → dist/icons}/department_store.svg +0 -0
- /package/{icons → dist/icons}/diy.svg +0 -0
- /package/{icons → dist/icons}/electronics.svg +0 -0
- /package/{icons → dist/icons}/embankment.svg +0 -0
- /package/{icons → dist/icons}/embassy.svg +0 -0
- /package/{icons → dist/icons}/excrement_bags.svg +0 -0
- /package/{icons → dist/icons}/fabric.svg +0 -0
- /package/{icons → dist/icons}/farmyard.svg +0 -0
- /package/{icons → dist/icons}/ferry.svg +0 -0
- /package/{icons → dist/icons}/firepit.svg +0 -0
- /package/{icons → dist/icons}/firestation.svg +0 -0
- /package/{icons → dist/icons}/fishing.svg +0 -0
- /package/{icons → dist/icons}/fitness.svg +0 -0
- /package/{icons → dist/icons}/ford.svg +0 -0
- /package/{icons → dist/icons}/fort.svg +0 -0
- /package/{icons → dist/icons}/fortress.svg +0 -0
- /package/{icons → dist/icons}/full-height_turnstile.svg +0 -0
- /package/{icons → dist/icons}/generator_wind.svg +0 -0
- /package/{icons → dist/icons}/golf_pin.svg +0 -0
- /package/{icons → dist/icons}/greengrocer.svg +0 -0
- /package/{icons → dist/icons}/guest_house.svg +0 -0
- /package/{icons → dist/icons}/helipad.svg +0 -0
- /package/{icons → dist/icons}/hifi.svg +0 -0
- /package/{icons → dist/icons}/hostel.svg +0 -0
- /package/{icons → dist/icons}/hotel.svg +0 -0
- /package/{icons → dist/icons}/housenumber.svg +0 -0
- /package/{icons → dist/icons}/houseware.svg +0 -0
- /package/{icons → dist/icons}/hunting_stand.svg +0 -0
- /package/{icons → dist/icons}/interior_decoration.svg +0 -0
- /package/{icons → dist/icons}/internet_cafe.svg +0 -0
- /package/{icons → dist/icons}/kindergarten.svg +0 -0
- /package/{icons → dist/icons}/kissing_gate.svg +0 -0
- /package/{icons → dist/icons}/manor.svg +0 -0
- /package/{icons → dist/icons}/map.svg +0 -0
- /package/{icons → dist/icons}/marker_reverse.svg +0 -0
- /package/{icons → dist/icons}/marker_selected.svg +0 -0
- /package/{icons → dist/icons}/marker_unselected.svg +0 -0
- /package/{icons → dist/icons}/marketplace.svg +0 -0
- /package/{icons → dist/icons}/massage.svg +0 -0
- /package/{icons → dist/icons}/mast.svg +0 -0
- /package/{icons → dist/icons}/mast_communications.svg +0 -0
- /package/{icons → dist/icons}/mast_lighting.svg +0 -0
- /package/{icons → dist/icons}/medical_supply.svg +0 -0
- /package/{icons → dist/icons}/memorial.svg +0 -0
- /package/{icons → dist/icons}/miniature_golf.svg +0 -0
- /package/{icons → dist/icons}/motel.svg +0 -0
- /package/{icons → dist/icons}/mountain_range.svg +0 -0
- /package/{icons → dist/icons}/multifaith.svg +0 -0
- /package/{icons → dist/icons}/musical_instrument.svg +0 -0
- /package/{icons → dist/icons}/newsagent.svg +0 -0
- /package/{icons → dist/icons}/nightclub.svg +0 -0
- /package/{icons → dist/icons}/ocean.svg +0 -0
- /package/{icons → dist/icons}/office.svg +0 -0
- /package/{icons → dist/icons}/outdoor_seating.svg +0 -0
- /package/{icons → dist/icons}/palace.svg +0 -0
- /package/{icons → dist/icons}/parcel_locker.svg +0 -0
- /package/{icons → dist/icons}/parking_space.svg +0 -0
- /package/{icons → dist/icons}/parking_tickets.svg +0 -0
- /package/{icons → dist/icons}/pet.svg +0 -0
- /package/{icons → dist/icons}/photo.svg +0 -0
- /package/{icons → dist/icons}/picnic.svg +0 -0
- /package/{icons → dist/icons}/plaque.svg +0 -0
- /package/{icons → dist/icons}/poi.svg +0 -0
- /package/{icons → dist/icons}/post_box.svg +0 -0
- /package/{icons → dist/icons}/post_office.svg +0 -0
- /package/{icons → dist/icons}/postal_code.svg +0 -0
- /package/{icons → dist/icons}/pub.svg +0 -0
- /package/{icons → dist/icons}/public_bath.svg +0 -0
- /package/{icons → dist/icons}/public_bookcase.svg +0 -0
- /package/{icons → dist/icons}/public_building.svg +0 -0
- /package/{icons → dist/icons}/public_transport_tickets.svg +0 -0
- /package/{icons → dist/icons}/reverse.svg +0 -0
- /package/{icons → dist/icons}/river.svg +0 -0
- /package/{icons → dist/icons}/road.svg +0 -0
- /package/{icons → dist/icons}/saddle.svg +0 -0
- /package/{icons → dist/icons}/sauna.svg +0 -0
- /package/{icons → dist/icons}/sea.svg +0 -0
- /package/{icons → dist/icons}/second_hand.svg +0 -0
- /package/{icons → dist/icons}/shintoist.svg +0 -0
- /package/{icons → dist/icons}/shoe.svg +0 -0
- /package/{icons → dist/icons}/shower.svg +0 -0
- /package/{icons → dist/icons}/shrine.svg +0 -0
- /package/{icons → dist/icons}/sikhist.svg +0 -0
- /package/{icons → dist/icons}/slipway.svg +0 -0
- /package/{icons → dist/icons}/snowmobile.svg +0 -0
- /package/{icons → dist/icons}/social_facility.svg +0 -0
- /package/{icons → dist/icons}/sports.svg +0 -0
- /package/{icons → dist/icons}/sprite.json +0 -0
- /package/{icons → dist/icons}/sprite.png +0 -0
- /package/{icons → dist/icons}/sprite@2x.json +0 -0
- /package/{icons → dist/icons}/sprite@2x.png +0 -0
- /package/{icons → dist/icons}/stationery.svg +0 -0
- /package/{icons → dist/icons}/stile.svg +0 -0
- /package/{icons → dist/icons}/stone.svg +0 -0
- /package/{icons → dist/icons}/storage_tank.svg +0 -0
- /package/{icons → dist/icons}/stream.svg +0 -0
- /package/{icons → dist/icons}/street.svg +0 -0
- /package/{icons → dist/icons}/supermarket.svg +0 -0
- /package/{icons → dist/icons}/tea.svg +0 -0
- /package/{icons → dist/icons}/telescope_dish.svg +0 -0
- /package/{icons → dist/icons}/telescope_dome.svg +0 -0
- /package/{icons → dist/icons}/ticket.svg +0 -0
- /package/{icons → dist/icons}/tobacco.svg +0 -0
- /package/{icons → dist/icons}/tower_cantilever_communication.svg +0 -0
- /package/{icons → dist/icons}/tower_cooling.svg +0 -0
- /package/{icons → dist/icons}/tower_dish.svg +0 -0
- /package/{icons → dist/icons}/tower_dome.svg +0 -0
- /package/{icons → dist/icons}/tower_generic.svg +0 -0
- /package/{icons → dist/icons}/tower_lattice.svg +0 -0
- /package/{icons → dist/icons}/tower_lattice_communication.svg +0 -0
- /package/{icons → dist/icons}/tower_lattice_lighting.svg +0 -0
- /package/{icons → dist/icons}/tower_lighting.svg +0 -0
- /package/{icons → dist/icons}/townhall.svg +0 -0
- /package/{icons → dist/icons}/toys.svg +0 -0
- /package/{icons → dist/icons}/trade.svg +0 -0
- /package/{icons → dist/icons}/traffic_light.svg +0 -0
- /package/{icons → dist/icons}/train_station.svg +0 -0
- /package/{icons → dist/icons}/travel_agency.svg +0 -0
- /package/{icons → dist/icons}/tyres.svg +0 -0
- /package/{icons → dist/icons}/university.svg +0 -0
- /package/{icons → dist/icons}/variety_store.svg +0 -0
- /package/{icons → dist/icons}/vehicle_inspection.svg +0 -0
- /package/{icons → dist/icons}/vending_machine.svg +0 -0
- /package/{icons → dist/icons}/video.svg +0 -0
- /package/{icons → dist/icons}/video_games.svg +0 -0
- /package/{icons → dist/icons}/waste_disposal.svg +0 -0
- /package/{icons → dist/icons}/water_well.svg +0 -0
- /package/{icons → dist/icons}/waterfall.svg +0 -0
- /package/{icons → dist/icons}/wilderness_hut.svg +0 -0
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} ClearIconProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} ClearIconEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} ClearIconSlots */
|
|
4
|
-
export default class ClearIcon extends SvelteComponent<{
|
|
5
|
-
[x: string]: never;
|
|
6
|
-
}, {
|
|
7
|
-
[evt: string]: CustomEvent<any>;
|
|
8
|
-
}, {}> {
|
|
9
|
-
}
|
|
10
|
-
export type ClearIconProps = typeof __propDef.props;
|
|
11
|
-
export type ClearIconEvents = typeof __propDef.events;
|
|
12
|
-
export type ClearIconSlots = typeof __propDef.slots;
|
|
13
|
-
import { SvelteComponent } from "svelte";
|
|
14
|
-
declare const __propDef: {
|
|
15
|
-
props: {
|
|
16
|
-
[x: string]: never;
|
|
17
|
-
};
|
|
18
|
-
events: {
|
|
19
|
-
[evt: string]: CustomEvent<any>;
|
|
20
|
-
};
|
|
21
|
-
slots: {};
|
|
22
|
-
exports?: undefined;
|
|
23
|
-
bindings?: undefined;
|
|
24
|
-
};
|
|
25
|
-
export {};
|
package/svelte/FailIcon.svelte
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<svg viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path
|
|
3
|
-
d="M15 0C6.705 0 0 6.705 0 15C0 23.295 6.705 30 15 30C23.295 30 30 23.295 30 15C30 6.705 23.295 0 15 0ZM22.5 20.385L20.385 22.5L15 17.115L9.615 22.5L7.5 20.385L12.885 15L7.5 9.615L9.615 7.5L15 12.885L20.385 7.5L22.5 9.615L17.115 15L22.5 20.385Z"
|
|
4
|
-
/>
|
|
5
|
-
</svg>
|
|
6
|
-
|
|
7
|
-
<style>
|
|
8
|
-
svg {
|
|
9
|
-
display: block;
|
|
10
|
-
fill: #e15042;
|
|
11
|
-
}
|
|
12
|
-
</style>
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} FailIconProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} FailIconEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} FailIconSlots */
|
|
4
|
-
export default class FailIcon extends SvelteComponent<{
|
|
5
|
-
[x: string]: never;
|
|
6
|
-
}, {
|
|
7
|
-
[evt: string]: CustomEvent<any>;
|
|
8
|
-
}, {}> {
|
|
9
|
-
}
|
|
10
|
-
export type FailIconProps = typeof __propDef.props;
|
|
11
|
-
export type FailIconEvents = typeof __propDef.events;
|
|
12
|
-
export type FailIconSlots = typeof __propDef.slots;
|
|
13
|
-
import { SvelteComponent } from "svelte";
|
|
14
|
-
declare const __propDef: {
|
|
15
|
-
props: {
|
|
16
|
-
[x: string]: never;
|
|
17
|
-
};
|
|
18
|
-
events: {
|
|
19
|
-
[evt: string]: CustomEvent<any>;
|
|
20
|
-
};
|
|
21
|
-
slots: {};
|
|
22
|
-
exports?: undefined;
|
|
23
|
-
bindings?: undefined;
|
|
24
|
-
};
|
|
25
|
-
export {};
|
|
@@ -1,246 +0,0 @@
|
|
|
1
|
-
<script context="module">"use strict";
|
|
2
|
-
const hidpi = typeof devicePixelRatio === "undefined" ? 1 : devicePixelRatio > 1.25;
|
|
3
|
-
const scaleUrl = hidpi ? "@2x" : "";
|
|
4
|
-
const scaleFactor = hidpi ? 2 : 1;
|
|
5
|
-
let sprites;
|
|
6
|
-
let spritePromise;
|
|
7
|
-
</script>
|
|
8
|
-
|
|
9
|
-
<script>import { createEventDispatcher } from "svelte";
|
|
10
|
-
export let feature;
|
|
11
|
-
export let style = "default";
|
|
12
|
-
export let showPlaceType;
|
|
13
|
-
export let missingIconsCache;
|
|
14
|
-
export let iconsBaseUrl;
|
|
15
|
-
$: categories = feature.properties?.categories;
|
|
16
|
-
$: isReverse = feature.place_type[0] === "reverse";
|
|
17
|
-
const dispatch = createEventDispatcher();
|
|
18
|
-
let category;
|
|
19
|
-
let imageUrl;
|
|
20
|
-
let spriteIcon;
|
|
21
|
-
let index;
|
|
22
|
-
$: placeType =
|
|
23
|
-
feature.properties?.categories?.join(", ") ??
|
|
24
|
-
feature.properties?.place_type_name?.[0] ??
|
|
25
|
-
feature.place_type[0];
|
|
26
|
-
$: {
|
|
27
|
-
index = categories?.length ?? 0;
|
|
28
|
-
loadIcon();
|
|
29
|
-
}
|
|
30
|
-
function loadSprites() {
|
|
31
|
-
spritePromise ??= fetch(`${iconsBaseUrl}sprite${scaleUrl}.json`)
|
|
32
|
-
.then((response) => response.json())
|
|
33
|
-
.then((data) => {
|
|
34
|
-
sprites = data;
|
|
35
|
-
})
|
|
36
|
-
.catch(() => {
|
|
37
|
-
sprites = null;
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
function handleImgError() {
|
|
41
|
-
if (imageUrl) {
|
|
42
|
-
missingIconsCache.add(imageUrl);
|
|
43
|
-
}
|
|
44
|
-
loadIcon();
|
|
45
|
-
}
|
|
46
|
-
function loadIcon() {
|
|
47
|
-
if (sprites !== undefined) {
|
|
48
|
-
loadIcon2();
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
loadSprites();
|
|
52
|
-
spritePromise?.then(loadIcon2);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
function loadIcon2() {
|
|
56
|
-
do {
|
|
57
|
-
index--;
|
|
58
|
-
category = categories?.[index];
|
|
59
|
-
spriteIcon = category ? sprites?.icons[category] : undefined;
|
|
60
|
-
if (spriteIcon) {
|
|
61
|
-
break;
|
|
62
|
-
}
|
|
63
|
-
imageUrl = category
|
|
64
|
-
? iconsBaseUrl + category.replace(/ /g, "_") + ".svg"
|
|
65
|
-
: undefined;
|
|
66
|
-
} while (index > -1 && (!imageUrl || missingIconsCache.has(imageUrl)));
|
|
67
|
-
}
|
|
68
|
-
</script>
|
|
69
|
-
|
|
70
|
-
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
71
|
-
<li
|
|
72
|
-
tabindex="-1"
|
|
73
|
-
role="option"
|
|
74
|
-
aria-selected={style === "selected"}
|
|
75
|
-
aria-checked={style === "picked"}
|
|
76
|
-
class={style}
|
|
77
|
-
on:mouseenter
|
|
78
|
-
on:focus={() => dispatch("select", undefined)}
|
|
79
|
-
on:click={(ev) => {
|
|
80
|
-
// this is to trigger the event if we click on focused item
|
|
81
|
-
if (document.activeElement !== ev.target) {
|
|
82
|
-
dispatch("select", undefined);
|
|
83
|
-
}
|
|
84
|
-
}}
|
|
85
|
-
>
|
|
86
|
-
{#if sprites && spriteIcon}
|
|
87
|
-
<div
|
|
88
|
-
class="sprite-icon"
|
|
89
|
-
style={`
|
|
90
|
-
width: ${spriteIcon.width / scaleFactor}px;
|
|
91
|
-
height: ${spriteIcon.height / scaleFactor}px;
|
|
92
|
-
background-image: url(${iconsBaseUrl}sprite${scaleUrl}.png);
|
|
93
|
-
background-position: -${spriteIcon.x / scaleFactor}px -${spriteIcon.y / scaleFactor}px;
|
|
94
|
-
background-size: ${sprites.width / scaleFactor}px ${sprites.height / scaleFactor}px;
|
|
95
|
-
`}
|
|
96
|
-
title={placeType}
|
|
97
|
-
/>
|
|
98
|
-
{:else if imageUrl}
|
|
99
|
-
<img
|
|
100
|
-
src={imageUrl}
|
|
101
|
-
alt={category}
|
|
102
|
-
title={placeType}
|
|
103
|
-
on:error={() => handleImgError()}
|
|
104
|
-
/>
|
|
105
|
-
{:else if feature.address}
|
|
106
|
-
<img
|
|
107
|
-
src={iconsBaseUrl + "housenumber.svg"}
|
|
108
|
-
alt={placeType}
|
|
109
|
-
title={placeType}
|
|
110
|
-
/>
|
|
111
|
-
{:else if feature.id.startsWith("road.")}
|
|
112
|
-
<img src={iconsBaseUrl + "road.svg"} alt={placeType} title={placeType} />
|
|
113
|
-
{:else if feature.id.startsWith("address.")}
|
|
114
|
-
<img src={iconsBaseUrl + "street.svg"} alt={placeType} title={placeType} />
|
|
115
|
-
{:else if feature.id.startsWith("postal_code.")}
|
|
116
|
-
<img
|
|
117
|
-
src={iconsBaseUrl + "postal_code.svg"}
|
|
118
|
-
alt={placeType}
|
|
119
|
-
title={placeType}
|
|
120
|
-
/>
|
|
121
|
-
{:else if feature.id.startsWith("poi.")}
|
|
122
|
-
<img src={iconsBaseUrl + "poi.svg"} alt={placeType} title={placeType} />
|
|
123
|
-
{:else if isReverse}
|
|
124
|
-
<img src={iconsBaseUrl + "reverse.svg"} alt={placeType} title={placeType} />
|
|
125
|
-
{:else}
|
|
126
|
-
<img src={iconsBaseUrl + "area.svg"} alt={placeType} title={placeType} />
|
|
127
|
-
{/if}
|
|
128
|
-
|
|
129
|
-
<span class="texts">
|
|
130
|
-
<span>
|
|
131
|
-
<span class="primary">
|
|
132
|
-
{isReverse ? feature.place_name : feature.place_name.replace(/,.*/, "")}
|
|
133
|
-
</span>
|
|
134
|
-
|
|
135
|
-
{#if showPlaceType === "always" || (showPlaceType !== "never" && !feature.address && !feature.id.startsWith("road.") && !feature.id.startsWith("address.") && !feature.id.startsWith("postal_code.") && (!feature.id.startsWith("poi.") || !imageUrl) && !isReverse)}
|
|
136
|
-
<span class="secondary">
|
|
137
|
-
{placeType}
|
|
138
|
-
</span>
|
|
139
|
-
{/if}
|
|
140
|
-
</span>
|
|
141
|
-
|
|
142
|
-
<span class="line2">
|
|
143
|
-
{isReverse ? "" : feature.place_name.replace(/[^,]*,?\s*/, "")}
|
|
144
|
-
</span>
|
|
145
|
-
</span>
|
|
146
|
-
</li>
|
|
147
|
-
|
|
148
|
-
<style>.sprite-icon {
|
|
149
|
-
align-self: center;
|
|
150
|
-
justify-self: center;
|
|
151
|
-
opacity: 0.75;
|
|
152
|
-
background-repeat: no-repeat;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
li {
|
|
156
|
-
text-align: left;
|
|
157
|
-
cursor: default;
|
|
158
|
-
display: grid;
|
|
159
|
-
grid-template-columns: 40px 1fr;
|
|
160
|
-
color: var(--color-text);
|
|
161
|
-
padding: 8px 0px;
|
|
162
|
-
font-size: 14px;
|
|
163
|
-
line-height: 18px;
|
|
164
|
-
min-width: fit-content;
|
|
165
|
-
outline: 0;
|
|
166
|
-
}
|
|
167
|
-
li:first-child {
|
|
168
|
-
padding-top: 10px;
|
|
169
|
-
}
|
|
170
|
-
li:last-child {
|
|
171
|
-
padding-bottom: 10px;
|
|
172
|
-
}
|
|
173
|
-
li.picked {
|
|
174
|
-
background-color: #e7edff;
|
|
175
|
-
}
|
|
176
|
-
li.picked .secondary {
|
|
177
|
-
color: #96a4c7;
|
|
178
|
-
padding-left: 4px;
|
|
179
|
-
}
|
|
180
|
-
li.picked .line2 {
|
|
181
|
-
color: #96a4c7;
|
|
182
|
-
}
|
|
183
|
-
li.selected {
|
|
184
|
-
background-color: #f3f6ff;
|
|
185
|
-
}
|
|
186
|
-
li.selected {
|
|
187
|
-
animation: backAndForth 5s linear infinite;
|
|
188
|
-
}
|
|
189
|
-
li.selected .primary {
|
|
190
|
-
color: #2b8bfb;
|
|
191
|
-
}
|
|
192
|
-
li.selected .secondary {
|
|
193
|
-
color: #a2adc7;
|
|
194
|
-
padding-left: 4px;
|
|
195
|
-
}
|
|
196
|
-
li.selected .line2 {
|
|
197
|
-
color: #a2adc7;
|
|
198
|
-
}
|
|
199
|
-
li > img {
|
|
200
|
-
align-self: center;
|
|
201
|
-
justify-self: center;
|
|
202
|
-
opacity: 0.75;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
.texts {
|
|
206
|
-
padding: 0 17px 0 0;
|
|
207
|
-
}
|
|
208
|
-
.texts > * {
|
|
209
|
-
white-space: nowrap;
|
|
210
|
-
display: block;
|
|
211
|
-
min-width: fit-content;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
.primary {
|
|
215
|
-
font-weight: 600;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
.secondary {
|
|
219
|
-
color: #aeb6c7;
|
|
220
|
-
padding-left: 4px;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
.line2 {
|
|
224
|
-
color: #aeb6c7;
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
@keyframes backAndForth {
|
|
228
|
-
0% {
|
|
229
|
-
transform: translateX(0);
|
|
230
|
-
}
|
|
231
|
-
10% {
|
|
232
|
-
transform: translateX(0);
|
|
233
|
-
}
|
|
234
|
-
45% {
|
|
235
|
-
transform: translateX(calc(-100% + 270px));
|
|
236
|
-
}
|
|
237
|
-
55% {
|
|
238
|
-
transform: translateX(calc(-100% + 270px));
|
|
239
|
-
}
|
|
240
|
-
90% {
|
|
241
|
-
transform: translateX(0);
|
|
242
|
-
}
|
|
243
|
-
100% {
|
|
244
|
-
transform: translateX(0);
|
|
245
|
-
}
|
|
246
|
-
}</style>
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
|
-
import type { Feature, ShowPlaceType } from "./types";
|
|
3
|
-
declare const __propDef: {
|
|
4
|
-
props: {
|
|
5
|
-
feature: Feature;
|
|
6
|
-
style?: "selected" | "picked" | "default";
|
|
7
|
-
showPlaceType: ShowPlaceType;
|
|
8
|
-
missingIconsCache: Set<string>;
|
|
9
|
-
iconsBaseUrl: string;
|
|
10
|
-
};
|
|
11
|
-
events: {
|
|
12
|
-
mouseenter: MouseEvent;
|
|
13
|
-
select: CustomEvent<undefined>;
|
|
14
|
-
} & {
|
|
15
|
-
[evt: string]: CustomEvent<any>;
|
|
16
|
-
};
|
|
17
|
-
slots: {};
|
|
18
|
-
exports?: {} | undefined;
|
|
19
|
-
bindings?: string | undefined;
|
|
20
|
-
};
|
|
21
|
-
export type FeatureItemProps = typeof __propDef.props;
|
|
22
|
-
export type FeatureItemEvents = typeof __propDef.events;
|
|
23
|
-
export type FeatureItemSlots = typeof __propDef.slots;
|
|
24
|
-
export default class FeatureItem extends SvelteComponent<FeatureItemProps, FeatureItemEvents, FeatureItemSlots> {
|
|
25
|
-
}
|
|
26
|
-
export {};
|