@amir83nasr/map 1.0.4 → 1.1.0
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/README.md +24 -23
- package/dist/core/defaults.test.d.ts +1 -0
- package/dist/core/format.test.d.ts +1 -0
- package/dist/{emitter.d.ts → engine/emitter.d.ts} +1 -1
- package/dist/engine/engine.test.d.ts +1 -0
- package/dist/{picker.d.ts → engine/picker.d.ts} +1 -1
- package/dist/{qompick-react.cjs → index.cjs} +6 -5
- package/dist/index.d.cts +4 -0
- package/dist/index.d.ts +4 -18
- package/dist/{qompick-react.js → index.js} +6 -5
- package/dist/react/LocationPickerView.d.ts +16 -0
- package/dist/react/react.test.d.ts +1 -0
- package/dist/style/style.test.d.ts +1 -0
- package/package.json +18 -10
- /package/dist/{defaults.d.ts → core/defaults.d.ts} +0 -0
- /package/dist/{format.d.ts → core/format.d.ts} +0 -0
- /package/dist/{geocode.d.ts → core/geocode.d.ts} +0 -0
- /package/dist/{i18n.d.ts → core/i18n.d.ts} +0 -0
- /package/dist/{icons.d.ts → core/icons.d.ts} +0 -0
- /package/dist/{types.d.ts → core/types.d.ts} +0 -0
- /package/dist/{snap.d.ts → engine/snap.d.ts} +0 -0
- /package/dist/{colors.d.ts → style/colors.d.ts} +0 -0
- /package/dist/{map-style.d.ts → style/map-style.d.ts} +0 -0
- /package/dist/{qompick-react.css → styles.css} +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/0-255.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/1024-1279.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/10240-10495.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/10496-10751.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/10752-11007.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/11008-11263.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/11264-11519.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/11520-11775.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/11776-12031.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/12032-12287.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/12288-12543.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/12544-12799.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/1280-1535.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/12800-13055.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/13056-13311.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/13312-13567.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/13568-13823.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/13824-14079.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/14080-14335.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/14336-14591.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/14592-14847.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/14848-15103.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/15104-15359.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/1536-1791.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/15360-15615.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/15616-15871.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/15872-16127.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/16128-16383.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/16384-16639.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/16640-16895.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/16896-17151.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/17152-17407.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/17408-17663.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/17664-17919.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/1792-2047.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/17920-18175.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/18176-18431.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/18432-18687.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/18688-18943.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/18944-19199.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/19200-19455.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/19456-19711.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/19712-19967.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/19968-20223.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/20224-20479.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/2048-2303.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/20480-20735.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/20736-20991.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/20992-21247.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/21248-21503.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/21504-21759.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/21760-22015.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/22016-22271.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/22272-22527.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/22528-22783.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/22784-23039.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/2304-2559.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/23040-23295.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/23296-23551.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/23552-23807.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/23808-24063.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/24064-24319.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/24320-24575.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/24576-24831.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/24832-25087.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/25088-25343.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/25344-25599.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/256-511.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/2560-2815.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/25600-25855.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/25856-26111.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/26112-26367.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/26368-26623.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/26624-26879.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/26880-27135.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/27136-27391.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/27392-27647.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/27648-27903.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/27904-28159.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/2816-3071.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/28160-28415.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/28416-28671.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/28672-28927.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/28928-29183.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/29184-29439.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/29440-29695.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/29696-29951.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/29952-30207.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/30208-30463.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/30464-30719.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/3072-3327.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/30720-30975.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/30976-31231.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/31232-31487.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/31488-31743.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/31744-31999.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/32000-32255.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/32256-32511.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/32512-32767.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/32768-33023.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/33024-33279.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/3328-3583.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/33280-33535.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/33536-33791.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/33792-34047.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/34048-34303.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/34304-34559.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/34560-34815.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/34816-35071.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/35072-35327.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/35328-35583.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/35584-35839.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/3584-3839.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/35840-36095.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/36096-36351.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/36352-36607.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/36608-36863.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/36864-37119.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/37120-37375.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/37376-37631.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/37632-37887.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/37888-38143.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/38144-38399.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/3840-4095.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/38400-38655.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/38656-38911.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/38912-39167.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/39168-39423.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/39424-39679.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/39680-39935.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/39936-40191.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/40192-40447.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/40448-40703.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/40704-40959.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/4096-4351.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/40960-41215.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/41216-41471.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/41472-41727.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/41728-41983.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/41984-42239.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/42240-42495.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/42496-42751.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/42752-43007.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/43008-43263.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/43264-43519.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/4352-4607.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/43520-43775.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/43776-44031.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/44032-44287.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/44288-44543.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/44544-44799.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/44800-45055.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/45056-45311.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/45312-45567.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/45568-45823.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/45824-46079.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/4608-4863.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/46080-46335.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/46336-46591.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/46592-46847.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/46848-47103.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/47104-47359.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/47360-47615.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/47616-47871.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/47872-48127.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/48128-48383.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/48384-48639.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/4864-5119.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/48640-48895.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/48896-49151.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/49152-49407.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/49408-49663.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/49664-49919.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/49920-50175.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/50176-50431.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/50432-50687.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/50688-50943.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/50944-51199.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/512-767.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/5120-5375.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/51200-51455.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/51456-51711.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/51712-51967.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/51968-52223.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/52224-52479.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/52480-52735.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/52736-52991.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/52992-53247.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/53248-53503.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/53504-53759.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/5376-5631.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/53760-54015.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/54016-54271.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/54272-54527.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/54528-54783.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/54784-55039.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/55040-55295.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/55296-55551.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/55552-55807.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/55808-56063.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/56064-56319.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/5632-5887.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/56320-56575.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/56576-56831.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/56832-57087.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/57088-57343.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/57344-57599.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/57600-57855.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/57856-58111.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/58112-58367.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/58368-58623.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/58624-58879.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/5888-6143.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/58880-59135.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/59136-59391.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/59392-59647.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/59648-59903.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/59904-60159.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/60160-60415.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/60416-60671.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/60672-60927.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/60928-61183.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/61184-61439.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/6144-6399.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/61440-61695.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/61696-61951.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/61952-62207.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/62208-62463.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/62464-62719.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/62720-62975.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/62976-63231.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/63232-63487.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/63488-63743.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/63744-63999.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/6400-6655.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/64000-64255.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/64256-64511.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/64512-64767.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/64768-65023.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/65024-65279.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/65280-65535.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/6656-6911.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/6912-7167.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/7168-7423.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/7424-7679.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/768-1023.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/7680-7935.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/7936-8191.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/8192-8447.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/8448-8703.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/8704-8959.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/8960-9215.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/9216-9471.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/9472-9727.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/9728-9983.pbf +0 -0
- /package/fonts/{IRANYekanX Regular → IRANYekanX}/9984-10239.pbf +0 -0
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
MapLibre location picker as a publish-ready npm library. React-only (`@amir83nasr/map`) + Vite demo. Persian RTL, mobile-first, vector tiles.
|
|
4
4
|
|
|
5
|
-
> Agent handbook: [`docs/USAGE.md`](
|
|
5
|
+
> Agent handbook: [`docs/USAGE.md`](./docs/USAGE.md) — copy-paste install, worker setup, recipes, callbacks, troubleshooting.
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
@@ -52,19 +52,19 @@ Public surface: one component (`LocationPickerView`), its props type (`QomPickPr
|
|
|
52
52
|
|
|
53
53
|
Props of `LocationPickerView` (`QomPickProps` = engine options minus `container`, plus `className`/`style`; callbacks are props):
|
|
54
54
|
|
|
55
|
-
| Key | Type | Default | Notes
|
|
56
|
-
| ---------------------------------------- | ----------------------------------------------------------------------------------------------- | -------------------------------------- |
|
|
57
|
-
| `map.center/zoom/minZoom/maxZoom/bounds` | — | Qom
|
|
58
|
-
| `map.style` | URL
|
|
59
|
-
| `map.glyphs` | string | jsDelivr CDN (bundled IRANYekanX PBFs) | relative paths resolve against page base; self-host by copying
|
|
60
|
-
| `controls` | `{gps, confirmButton, searchTrigger, developers}` | all true except developers | `developers` opens the in-map developer docs
|
|
61
|
-
| `search` | `{enabled, placeholder, suggestions, minLength, debounceMs, limit}` | 41 Qom neighborhoods
|
|
62
|
-
| `sheet` | `{enabled}` | true | —
|
|
63
|
-
| `behavior` | `{snapToRoad, resolveOnMove, resolveDelayMs, settleDelayMs, snapDelayMs, pickZoom, locateZoom}` | `400/250/900/15/18` | snap waits longer than settle; pinch-zoom never snaps
|
|
64
|
-
| `markers` | `Venue[]` | `[]` (off) | generic pins, demo enables Qom data
|
|
65
|
-
| `i18n` | `{labels}` | Persian (`fa`), always RTL | full label override
|
|
66
|
-
| callbacks | `onLocationChange/onAddressResolved/onSearchResults/onPick/onConfirm/onLocate/onError` | — | props
|
|
67
|
-
| `className/style` | — | height
|
|
55
|
+
| Key | Type | Default | Notes |
|
|
56
|
+
| ---------------------------------------- | ----------------------------------------------------------------------------------------------- | -------------------------------------- | ------------------------------------------------------------------------------------------------ |
|
|
57
|
+
| `map.center/zoom/minZoom/maxZoom/bounds` | — | Qom`34.6416,50.8764`, z14 | — |
|
|
58
|
+
| `map.style` | URL\| StyleSpecification | Snapp-like OpenFreeMap | vector style only (never raster) |
|
|
59
|
+
| `map.glyphs` | string | jsDelivr CDN (bundled IRANYekanX PBFs) | relative paths resolve against page base; self-host by copying`fonts/` |
|
|
60
|
+
| `controls` | `{gps, confirmButton, searchTrigger, developers}` | all true except developers | `developers` opens the in-map developer docs |
|
|
61
|
+
| `search` | `{enabled, placeholder, suggestions, minLength, debounceMs, limit}` | 41 Qom neighborhoods;`3 / 350ms / 5` | Nominatim, Qom viewbox; custom array replaces,`[]` disables; `limit` also caps local suggestions |
|
|
62
|
+
| `sheet` | `{enabled}` | true | — |
|
|
63
|
+
| `behavior` | `{snapToRoad, resolveOnMove, resolveDelayMs, settleDelayMs, snapDelayMs, pickZoom, locateZoom}` | `400/250/900/15/18` | snap waits longer than settle; pinch-zoom never snaps |
|
|
64
|
+
| `markers` | `Venue[]` | `[]` (off) | generic pins, demo enables Qom data |
|
|
65
|
+
| `i18n` | `{labels}` | Persian (`fa`), always RTL | full label override |
|
|
66
|
+
| callbacks | `onLocationChange/onAddressResolved/onSearchResults/onPick/onConfirm/onLocate/onError` | — | props |
|
|
67
|
+
| `className/style` | — | height`480` | pass a height, otherwise the map is empty |
|
|
68
68
|
|
|
69
69
|
Types (`PickerLocation`, `Venue`, `SearchSuggestion`, `QomPickProps`, …) are re-exported from `@amir83nasr/map`.
|
|
70
70
|
|
|
@@ -105,14 +105,15 @@ Pass `controls={{ developers: true }}` to show a «توسعهدهندگان»
|
|
|
105
105
|
|
|
106
106
|
```text
|
|
107
107
|
package/ # npm package `@amir83nasr/map`
|
|
108
|
-
src/index.tsx # public
|
|
109
|
-
src/
|
|
110
|
-
src
|
|
111
|
-
src/
|
|
112
|
-
|
|
113
|
-
test
|
|
114
|
-
|
|
115
|
-
|
|
108
|
+
src/index.tsx # public re-export only
|
|
109
|
+
src/react/ # LocationPickerView + setupQomPickWorker
|
|
110
|
+
src/engine/ # internal picker/emitter/snap (not exported)
|
|
111
|
+
src/core/ # types, defaults, i18n, format, geocode, icons
|
|
112
|
+
src/style/ # map-style, colors, styles.css → dist/styles.css
|
|
113
|
+
src/*/*.test.ts # colocated vitest per folder
|
|
114
|
+
fonts/ # IRANYekanX woff2 + IRANYekanX/*.pbf glyphs (published)
|
|
115
|
+
demo/ # Vite demo (vector map, port 5500); USE_DIST=1 builds vs dist
|
|
116
|
+
CONTRIBUTING.md SECURITY.md LICENSE.md
|
|
116
117
|
```
|
|
117
118
|
|
|
118
119
|
## Scripts
|
|
@@ -132,7 +133,7 @@ cd package && pnpm build && pnpm pack --dry-run # inspect tarball
|
|
|
132
133
|
pnpm publish --filter @amir83nasr/map --access public
|
|
133
134
|
```
|
|
134
135
|
|
|
135
|
-
Versioning: semver, currently `1.0
|
|
136
|
+
Versioning: semver, currently `1.1.0`.
|
|
136
137
|
|
|
137
138
|
## Limitations
|
|
138
139
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EventHandler, LocationPickerOptions, PickerEvent, PickerLocation } from '
|
|
1
|
+
import { EventHandler, LocationPickerOptions, PickerEvent, PickerLocation } from '../core/types.js';
|
|
2
2
|
export declare function isMapLibreWorkerError(value: unknown): boolean;
|
|
3
3
|
export declare class LocationPicker {
|
|
4
4
|
private opts;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var le=Object.defineProperty;var ce=(s,e,t)=>e in s?le(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var d=(s,e,t)=>ce(s,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const de=require("react/jsx-runtime"),P=require("react"),z=require("maplibre-gl"),pe={searchPlaceholder:"جستوجوی موقعیت...",searchTitle:"جستجوی موقعیت",suggestedPlaces:"مکانهای پیشنهادی",searching:"در حال جستجو...",noResults:"نتیجهای پیدا نشد؛ عبارت دیگری امتحان کنید",searchError:"خطا در جستجو؛ اتصال را بررسی کنید",confirmLocation:"تایید موقعیت",confirm:"تایید",editOnMap:"ویرایش روی نقشه",chosenAddress:"آدرس انتخابی",coordsToServer:"مختصات ارسالی به سرور",close:"بستن",clearSearch:"پاک کردن جستجو",currentLocation:"موقعیت فعلی",locating:"در حال پیدا کردن آدرس...",resolving:"در حال پیدا کردن آدرس...",registered:"موقعیت ثبت شد",gpsUnsupported:"GPS در این مرورگر پشتیبانی نمیشود",locateTimeout:"دریافت موقعیت طول کشید؛ دستی انتخاب کنید",locateUnavailable:"موقعیت در دسترس نیست؛ دستی انتخاب کنید",geoTitle:"دسترسی به موقعیت مکانی",geoText:"برای انتخاب موقعیت فعلی شما، لازم است دسترسی موقعیت مکانی را فعال کنید.",geoBlocked:"مرورگر قبلاً دسترسی را بسته است. از تنظیمات سایت مرورگر، دسترسی Location را مجاز کنید.",enableAccess:"فعال کردن دسترسی",developers:"توسعهدهندگان",backToMap:"بازگشت به نقشه",copy:"کپی",copied:"کپی شد",submitting:"در حال ثبت..."},ie=[{name:"۱۹ دی، قم",addr:"محله ۱۹ دی، شهر قم",lat:34.6558,lng:50.9055},{name:"آذر، قم",addr:"محله آذر، شهر قم",lat:34.6492,lng:50.8965},{name:"امام حسین، قم",addr:"میدان امام حسین، شهر قم",lat:34.6512,lng:50.8932},{name:"انسجام، قم",addr:"محله انسجام، شهر قم",lat:34.6058,lng:50.8752},{name:"انقلاب، قم",addr:"خیابان انقلاب، شهر قم",lat:34.6462,lng:50.8915},{name:"باجک، قم",addr:"محله باجک، شهر قم",lat:34.6601,lng:50.8823},{name:"بلوار امین، قم",addr:"محله بلوار امین، شهر قم",lat:34.6248,lng:50.8792},{name:"بنیاد، قم",addr:"محله بنیاد، شهر قم",lat:34.6475,lng:50.8985},{name:"پردیسان، قم",addr:"شهرک پردیسان، شهر قم",lat:34.6021,lng:50.8412},{name:"توحید، قم",addr:"محله توحید، شهر قم",lat:34.6685,lng:50.8748},{name:"جمکران، قم",addr:"محله جمکران، شهر قم",lat:34.5853,lng:50.9068},{name:"چهارمردان، قم",addr:"محله چهارمردان، شهر قم",lat:34.6401,lng:50.8873},{name:"حافظ، قم",addr:"خیابان حافظ، شهر قم",lat:34.6368,lng:50.8785},{name:"حرم، قم",addr:"محله حرم، شهر قم",lat:34.6448,lng:50.8791},{name:"خاکفرج، قم",addr:"محله خاکفرج، شهر قم",lat:34.6798,lng:50.9012},{name:"دروازه ری، قم",addr:"محله دروازه ری، شهر قم",lat:34.6352,lng:50.8958},{name:"دورشهر، قم",addr:"محله دورشهر، شهر قم",lat:34.6442,lng:50.8744},{name:"زاویه، قم",addr:"محله زاویه، شهر قم",lat:34.6385,lng:50.8682},{name:"زنبیلآباد، قم",addr:"محله زنبیلآباد، شهر قم",lat:34.6221,lng:50.8912},{name:"سالاریه، قم",addr:"محله سالاریه، شهر قم",lat:34.6289,lng:50.8624},{name:"سمیه، قم",addr:"خیابان سمیه، شهر قم",lat:34.6521,lng:50.8842},{name:"شهدا، قم",addr:"خیابان شهدا، شهر قم",lat:34.6425,lng:50.8831},{name:"شهرقائم، قم",addr:"شهرک قائم، شهر قم",lat:34.6158,lng:50.8505},{name:"شهرک امام حسن، قم",addr:"شهرک امام حسن، شهر قم",lat:34.6358,lng:50.8521},{name:"شهرک مهدیه، قم",addr:"شهرک مهدیه، شهر قم",lat:34.6258,lng:50.8452},{name:"شهرک ولیعصر، قم",addr:"شهرک ولیعصر، شهر قم",lat:34.6125,lng:50.8585},{name:"شیخآباد، قم",addr:"محله شیخآباد، شهر قم",lat:34.6582,lng:50.8718},{name:"صدوق، قم",addr:"خیابان صدوق، شهر قم",lat:34.6198,lng:50.8725},{name:"صفائیه، قم",addr:"محله صفائیه، شهر قم",lat:34.6327,lng:50.8713},{name:"عسگریه، قم",addr:"محله عسگریه، شهر قم",lat:34.6305,lng:50.9018},{name:"عطاران، قم",addr:"محله عطاران، شهر قم",lat:34.6548,lng:50.8895},{name:"فرهنگیان، قم",addr:"محله فرهنگیان، شهر قم",lat:34.6105,lng:50.8702},{name:"کشاورز، قم",addr:"محله کشاورز، شهر قم",lat:34.6642,lng:50.8885},{name:"کلهری، قم",addr:"منطقه کلهری، شهر قم",lat:34.6211,lng:50.9055},{name:"کیوانفر، قم",addr:"محله کیوانفر، شهر قم",lat:34.6172,lng:50.8856},{name:"مطهری، قم",addr:"خیابان مطهری، شهر قم",lat:34.6485,lng:50.8878},{name:"معلم، قم",addr:"میدان معلم، شهر قم",lat:34.6275,lng:50.8942},{name:"نوبهار، قم",addr:"محله نوبهار، شهر قم",lat:34.6623,lng:50.8952},{name:"نیروگاه، قم",addr:"محله نیروگاه، شهر قم",lat:34.6712,lng:50.8851},{name:"هفتتیر، قم",addr:"خیابان هفتتیر، شهر قم",lat:34.6442,lng:50.8995},{name:"یزدانشهر، قم",addr:"محله یزدانشهر، شهر قم",lat:34.6012,lng:50.8628}],$={lat:34.6416,lng:50.8764},ue=14;function he(s){return{...pe,...(s==null?void 0:s.labels)??{}}}function me(){return"rtl"}function ge(s){const e=s??{};return{container:e.container,map:{center:{...$},zoom:ue,minZoom:11,maxZoom:19,bounds:[[34.15,50.35],[35.05,51.45]],...e.map??{}},controls:{gps:!0,confirmButton:!0,searchTrigger:!0,developers:!1,...e.controls??{}},search:{enabled:!0,suggestions:ie,minLength:3,debounceMs:350,limit:5,...e.search??{}},sheet:{enabled:!0,...e.sheet??{}},behavior:{snapToRoad:!0,resolveOnMove:!0,resolveDelayMs:400,settleDelayMs:250,snapDelayMs:900,pickZoom:15,locateZoom:18,...e.behavior??{}},i18n:{labels:he(e.i18n)},markers:e.markers??[]}}const ye="#e9ebee",fe="#e9ebee",G="#a9e29b",be="#9ed894",ve="#b5e8a6",we="#d3ddd0",qe="#e9dfc0",xe="#b9d9f2",ke="#cfe4f7",N="#a9cdf0",V="#4e6e94",U="#dfe3e9",Se="#e9ebee",O="#ffffff",Le="#d9dde2",x="#ffffff",A="#d5dae0",Ee="#cdbfa8",Te="#e9ebee",H="#c6ccd4",F="#b9bdc4",Q="#a7aab3",Y="#5b6067",_="#2f3338",f="#f7f8f9",j="#565b62",Me=["coalesce",["get","name:fa"],["get","name:nonlatin"],["get","name"],["get","name:latin"]],Re=["0","۰","1","۱","2","۲","3","۳","4","۴","5","۵","6","۶","7","۷","8","۸","9","۹","٠","۰","١","۱","٢","۲","٣","۳","٤","۴","٥","۵","٦","۶","٧","۷","٨","۸","٩","۹"];function Ae(s,e=40){const t=["coalesce",s,""],o=["split",["to-string",t],""],r=["length",o],i=[];for(let a=0;a<e;a++){const n=["at",a,o];i.push(["case",[">",r,a],["match",n,...Re,n],""])}return i.push(["slice",["to-string",t],e]),["format",["concat",...i],{}]}const b=Ae(Me),k=["IRANYekanX Regular"],D=["IRANYekanX Regular"],q=["LineString","MultiLineString"],_e=["MultiPoint","Point"];function y(s){return["interpolate",["exponential",1.2],["zoom"],...s]}const X=["interpolate",["exponential",1.2],["zoom"],12.5,0,13,1.5,14,2.5,20,11.5],Ce=["interpolate",["exponential",1.2],["zoom"],12,.5,13,1,14,4,20,15],ze=[{id:"background",type:"background",paint:{"background-color":ye}},{id:"landuse-residential",type:"fill",source:"openmaptiles","source-layer":"landuse",filter:["match",["get","class"],["neighbourhood","residential"],!0,!1],paint:{"fill-color":fe}},{id:"landuse-cemetery",type:"fill",source:"openmaptiles","source-layer":"landuse",filter:["==",["get","class"],"cemetery"],paint:{"fill-color":we}},{id:"landcover-wood",type:"fill",source:"openmaptiles","source-layer":"landcover",filter:["==",["get","class"],"wood"],paint:{"fill-color":be}},{id:"landcover-grass",type:"fill",source:"openmaptiles","source-layer":"landcover",filter:["==",["get","class"],"grass"],paint:{"fill-color":ve}},{id:"landcover-grass-park",type:"fill",source:"openmaptiles","source-layer":"park",paint:{"fill-color":G}},{id:"park",type:"fill",source:"openmaptiles","source-layer":"park",filter:["match",["geometry-type"],["MultiPolygon","Polygon"],!0,!1],paint:{"fill-color":G}},{id:"landcover-sand",type:"fill",source:"openmaptiles","source-layer":"landcover",filter:["==",["get","class"],"sand"],paint:{"fill-color":qe}},{id:"water",type:"fill",source:"openmaptiles","source-layer":"water",filter:["all",["!=",["get","intermittent"],1],["!=",["get","brunnel"],"tunnel"]],paint:{"fill-color":xe}},{id:"water-intermittent",type:"fill",source:"openmaptiles","source-layer":"water",filter:["all",["==",["get","intermittent"],1],["!=",["get","brunnel"],"tunnel"]],paint:{"fill-color":ke,"fill-opacity":.8}},{id:"waterway-other",type:"line",source:"openmaptiles","source-layer":"waterway",filter:["all",["match",["get","class"],["canal","river","stream"],!1,!0],["==",["get","intermittent"],0]],paint:{"line-color":N,"line-width":["interpolate",["exponential",1.3],["zoom"],13,.5,20,2]}},{id:"waterway-stream-canal",type:"line",source:"openmaptiles","source-layer":"waterway",filter:["all",["match",["get","class"],["canal","stream"],!0,!1],["!=",["get","brunnel"],"tunnel"],["==",["get","intermittent"],0]],paint:{"line-color":N,"line-width":["interpolate",["exponential",1.3],["zoom"],13,.5,20,6]}},{id:"waterway-river",type:"line",source:"openmaptiles","source-layer":"waterway",filter:["all",["==",["get","class"],"river"],["!=",["get","brunnel"],"tunnel"],["!=",["get","intermittent"],1]],paint:{"line-color":N,"line-width":["interpolate",["exponential",1.2],["zoom"],10,.8,20,6]}},{id:"building",type:"fill",source:"openmaptiles","source-layer":"building",paint:{"fill-antialias":!0,"fill-color":U}},{id:"building-top",type:"fill",source:"openmaptiles","source-layer":"building",paint:{"fill-color":Se,"fill-opacity":["interpolate",["linear"],["zoom"],13,0,16,1],"fill-outline-color":U,"fill-translate":["interpolate",["linear"],["zoom"],14,["literal",[0,0]],16,["literal",[-2,-2]]]}},{id:"aeroway-area",type:"fill",source:"openmaptiles","source-layer":"aeroway",paint:{"fill-color":Te,"fill-opacity":["interpolate",["linear"],["zoom"],13,0,14,1]}},{id:"aeroway-taxiway-casing",type:"line",source:"openmaptiles","source-layer":"aeroway",filter:["==",["get","class"],"taxiway"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":H,"line-width":["interpolate",["exponential",1.5],["zoom"],11,2,17,12]}},{id:"aeroway-taxiway",type:"line",source:"openmaptiles","source-layer":"aeroway",filter:["==",["get","class"],"taxiway"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":O,"line-width":["interpolate",["exponential",1.5],["zoom"],11,1,17,10]}},{id:"aeroway-runway-casing",type:"line",source:"openmaptiles","source-layer":"aeroway",filter:["==",["get","class"],"runway"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":H,"line-width":["interpolate",["exponential",1.5],["zoom"],11,5,17,55]}},{id:"aeroway-runway",type:"line",source:"openmaptiles","source-layer":"aeroway",filter:["==",["get","class"],"runway"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":O,"line-width":["interpolate",["exponential",1.5],["zoom"],11,4,17,50]}},{id:"highway-minor-casing",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["match",["geometry-type"],q,!0,!1],["!=",["get","brunnel"],"tunnel"],["match",["get","class"],["minor","service","track"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":Le,"line-opacity":["interpolate",["linear"],["zoom"],12,0,12.5,1],"line-width":Ce}},{id:"highway-link-casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1],["==",["get","ramp"],1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":A,"line-width":y([12,1,13,3,14,4,20,15])}},{id:"highway-secondary-tertiary-casing",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["match",["get","class"],["secondary","tertiary"],!0,!1],["!=",["get","ramp"],1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":A,"line-width":y([8,1.5,20,17])}},{id:"highway-primary-casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["match",["get","class"],["primary"],!0,!1],["!=",["get","ramp"],1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":A,"line-opacity":["interpolate",["linear"],["zoom"],7,0,8,1],"line-width":y([7,0,8,.6,9,1.5,20,22])}},{id:"highway-trunk-casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["match",["get","class"],["trunk"],!0,!1],["!=",["get","ramp"],1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":A,"line-opacity":["interpolate",["linear"],["zoom"],5,0,6,1],"line-width":y([5,0,6,.6,7,1.5,20,22])}},{id:"highway-motorway-casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:4,filter:["all",["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["==",["get","class"],"motorway"],["!=",["get","ramp"],1]],layout:{"line-cap":"butt","line-join":"round"},paint:{"line-color":A,"line-opacity":["interpolate",["linear"],["zoom"],4,0,5,1],"line-width":y([4,0,5,.4,6,.6,7,1.5,20,22])}},{id:"highway-path",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["match",["geometry-type"],q,!0,!1],["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["==",["get","class"],"path"]],paint:{"line-color":Ee,"line-dasharray":[1.5,.75],"line-width":y([15,1.2,20,4])}},{id:"highway-link",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1],["==",["get","ramp"],1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":x,"line-width":y([12.5,0,13,1.5,14,2.5,20,11.5])}},{id:"highway-minor",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["match",["geometry-type"],q,!0,!1],["!=",["get","brunnel"],"tunnel"],["match",["get","class"],["minor","service","track"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":O,"line-width":X}},{id:"highway-secondary-tertiary",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["match",["get","class"],["secondary","tertiary"],!0,!1],["!=",["get","ramp"],1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":x,"line-width":y([6.5,0,8,.5,20,13])}},{id:"highway-primary",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["match",["geometry-type"],q,!0,!1],["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["match",["get","class"],["primary"],!0,!1],["!=",["get","ramp"],1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":x,"line-width":y([8.5,0,9,.5,20,18])}},{id:"highway-trunk",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["match",["geometry-type"],q,!0,!1],["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["match",["get","class"],["trunk"],!0,!1],["!=",["get","ramp"],1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":x,"line-width":y([6.5,0,7,.5,20,18])}},{id:"highway-motorway",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["match",["geometry-type"],q,!0,!1],["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["==",["get","class"],"motorway"],["!=",["get","ramp"],1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":x,"line-width":y([6.5,0,7,.5,20,18])}},{id:"bridge-link",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["==",["get","brunnel"],"bridge"],["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1],["==",["get","ramp"],1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":x,"line-width":y([12.5,0,13,1.5,14,2.5,20,11.5])}},{id:"bridge-minor",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["==",["get","brunnel"],"bridge"],["match",["get","class"],["minor","service","track"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":O,"line-width":X}},{id:"bridge-secondary-tertiary",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["==",["get","brunnel"],"bridge"],["match",["get","class"],["secondary","tertiary"],!0,!1],["!=",["get","ramp"],1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":x,"line-width":y([6.5,0,8,.5,20,13])}},{id:"bridge-trunk-primary",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["==",["get","brunnel"],"bridge"],["match",["get","class"],["primary","trunk"],!0,!1],["!=",["get","ramp"],1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":x,"line-width":y([6.5,0,7,.5,20,18])}},{id:"bridge-motorway",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["==",["get","brunnel"],"bridge"],["==",["get","class"],"motorway"],["!=",["get","ramp"],1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":x,"line-width":y([6.5,0,7,.5,20,18])}},{id:"railway-transit",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["match",["geometry-type"],q,!0,!1],["==",["get","class"],"transit"],["match",["get","brunnel"],["tunnel"],!1,!0]],paint:{"line-color":F,"line-width":["interpolate",["exponential",1.4],["zoom"],14,.4,20,1]}},{id:"railway-service",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["match",["geometry-type"],q,!0,!1],["has","service"],["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["==",["get","class"],"rail"]],paint:{"line-color":F,"line-width":["interpolate",["exponential",1.4],["zoom"],14,.4,20,1]}},{id:"railway",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["match",["geometry-type"],q,!0,!1],["!",["has","service"]],["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["==",["get","class"],"rail"]],paint:{"line-color":F,"line-width":["interpolate",["exponential",1.4],["zoom"],14,.4,15,.75,20,2]}},{id:"boundary_3",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["==",["get","admin_level"],3],["!=",["get","maritime"],1]],paint:{"line-color":Q,"line-dasharray":[1,1],"line-width":["interpolate",["linear"],["zoom"],7,1,11,2]}},{id:"boundary_2",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["==",["get","admin_level"],2],["!=",["get","maritime"],1],["!=",["get","disputed"],1],["!",["has","claimed_by"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":Q,"line-opacity":["interpolate",["linear"],["zoom"],0,.4,4,1],"line-width":["interpolate",["linear"],["zoom"],3,1,5,1.2,12,3]}},{id:"waterway_line_label",type:"symbol",source:"openmaptiles","source-layer":"waterway",layout:{"symbol-placement":"line","symbol-spacing":350,"text-field":b,"text-font":k,"text-size":13},paint:{"text-color":V,"text-halo-color":f,"text-halo-width":1.5}},{id:"water_name_label",type:"symbol",source:"openmaptiles","source-layer":"water_name",layout:{"text-field":b,"text-font":k,"text-max-width":8,"text-size":12},paint:{"text-color":V,"text-halo-color":f,"text-halo-width":1.5}},{id:"poi_worship_school",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:14,filter:["match",["get","class"],["place_of_worship","school","college","library","hospital","park"],!0,!1],layout:{"icon-image":["match",["get","class"],["place_of_worship"],"place_of_worship",["school"],"school",["college"],"school",["library"],"school",["hospital"],"hospital",["park"],"park",""],"icon-size":1.1,"text-anchor":"top","text-field":b,"text-font":k,"text-max-width":8,"text-offset":[0,1],"text-size":12},paint:{"text-color":j,"text-halo-color":f,"text-halo-width":1.5}},{id:"poi_shops",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:15.5,filter:["match",["get","class"],["shop","grocery","restaurant","cafe","fast_food","pharmacy","bank","fuel"],!0,!1],layout:{"icon-image":["match",["get","class"],["grocery"],"grocery",["restaurant"],"restaurant",["cafe"],"cafe",["fast_food"],"restaurant",["pharmacy"],"pharmacy",["bank"],"bank",["fuel"],"fuel","shop"],"icon-size":1,"text-anchor":"top","text-field":b,"text-font":k,"text-max-width":8,"text-offset":[0,1],"text-size":12},paint:{"text-color":j,"text-halo-color":f,"text-halo-width":1.5}},{id:"poi_r1",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:16,filter:["all",["match",["geometry-type"],_e,!0,!1],[">=",["get","rank"],1],["<",["get","rank"],7]],layout:{"icon-image":["match",["get","subclass"],["florist","furniture"],["get","subclass"],["get","class"]],"icon-size":.8,"text-anchor":"top","text-field":b,"text-font":k,"text-max-width":8,"text-offset":[0,.8],"text-size":12},paint:{"text-color":j,"text-halo-color":f,"text-halo-width":1.5}},{id:"airport",type:"symbol",source:"openmaptiles","source-layer":"aerodrome_label",minzoom:10,filter:["all",["has","iata"]],layout:{"icon-image":"airport_11","icon-size":1,"text-anchor":"top","text-field":b,"text-font":k,"text-max-width":8,"text-offset":[0,.8],"text-size":12},paint:{"text-color":j,"text-halo-color":f,"text-halo-width":1.5}},{id:"highway-name-minor",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:14,filter:["all",["match",["geometry-type"],q,!0,!1],["match",["get","class"],["minor","service","track"],!0,!1]],layout:{"symbol-placement":"line","text-field":b,"text-font":k,"text-rotation-alignment":"map","text-size":["interpolate",["linear"],["zoom"],14,11,17,12]},paint:{"text-color":Y,"text-halo-color":f,"text-halo-width":1.5}},{id:"highway-name-major",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:11,filter:["match",["get","class"],["primary","secondary","tertiary","trunk","motorway"],!0,!1],layout:{"symbol-placement":"line","text-field":b,"text-font":D,"text-rotation-alignment":"map","text-size":["interpolate",["linear"],["zoom"],11,11,15,13]},paint:{"text-color":Y,"text-halo-color":f,"text-halo-width":1.5}},{id:"label_village",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:9,filter:["==",["get","class"],"village"],layout:{"text-field":b,"text-font":k,"text-max-width":8,"text-size":["interpolate",["exponential",1.2],["zoom"],9,11,12,13]},paint:{"text-color":_,"text-halo-color":f,"text-halo-width":1.5}},{id:"label_town",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:6,filter:["==",["get","class"],"town"],layout:{"text-field":b,"text-font":D,"text-max-width":8,"text-size":["interpolate",["exponential",1.2],["zoom"],7,12,11,14]},paint:{"text-color":_,"text-halo-color":f,"text-halo-width":1.5}},{id:"label_other",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:8,filter:["match",["get","class"],["city","continent","country","state","town","village"],!1,!0],layout:{"text-field":b,"text-font":k,"text-max-width":8,"text-size":["interpolate",["linear"],["zoom"],8,10,12,12]},paint:{"text-color":_,"text-halo-color":f,"text-halo-width":1.5}},{id:"label_city",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:3,filter:["all",["==",["get","class"],"city"],["!=",["get","capital"],2]],layout:{"text-field":b,"text-font":D,"text-max-width":8,"text-size":["interpolate",["exponential",1.2],["zoom"],4,11,7,13,11,16]},paint:{"text-color":_,"text-halo-color":f,"text-halo-width":1.5}},{id:"label_city_capital",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:3,filter:["all",["==",["get","class"],"city"],["==",["get","capital"],2]],layout:{"text-field":b,"text-font":D,"text-max-width":8,"text-size":["interpolate",["exponential",1.2],["zoom"],4,12,7,14,11,18]},paint:{"text-color":_,"text-halo-color":f,"text-halo-width":1.5}}],$e="https://tiles.openfreemap.org/planet",Pe={version:8,name:"snapp-like",glyphs:"https://cdn.jsdelivr.net/npm/@amir83nasr/map@1/fonts/{fontstack}/{range}.pbf",sprite:"https://tiles.openfreemap.org/sprites/ofm_f384/ofm",sources:{openmaptiles:{type:"vector",url:$e}},layers:ze};class Oe{constructor(){d(this,"map",new Map)}on(e,t){let o=this.map.get(e);return o||this.map.set(e,o=new Set),o.add(t),()=>this.off(e,t)}off(e,t){var o;(o=this.map.get(e))==null||o.delete(t)}emit(e,t){for(const o of this.map.get(e)??[])try{o(t)}catch{}}}function C(s){return`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${s}</svg>`}const v={locate:C('<line x1="2" x2="5" y1="12" y2="12"/><line x1="19" x2="22" y1="12" y2="12"/><line x1="12" x2="12" y1="2" y2="5"/><line x1="12" x2="12" y1="19" y2="22"/><circle cx="12" cy="12" r="7"/><circle cx="12" cy="12" r="3"/>'),pin:C('<path d="M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z"/><circle cx="12" cy="10" r="3"/>'),search:C('<circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/>'),star:C('<polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" fill="currentColor" stroke="none"/>'),x:C('<path d="M18 6 6 18"/><path d="m6 6 12 12"/>')},K="۰۱۲۳۴۵۶۷۸۹";function S(s){return String(s).replace(/\d/g,e=>K[Number(e)]).replace(/[٠-٩]/g,e=>K["٠١٢٣٤٥٦٧٨٩".indexOf(e)])}function J(s,e=5){return S(Number(s).toFixed(e))}function M(s){return String(s).replace(/[۰-۹]/g,e=>String("۰۱۲۳۴۵۶۷۸۹".indexOf(e))).replace(/[٠-٩]/g,e=>String("٠١٢٣٤٥٦٧٨٩".indexOf(e)))}function ee(s){if(!s)return"";const e=String(s).split(",").map(o=>o.trim()).filter(Boolean),t=o=>!!(/^(ایران|Iran)$/i.test(o)||/^استان\b/.test(o)||/^شهرستان\b/.test(o)||/^بخش\b/.test(o)||/^[\d\s\-–—]+$/.test(M(o)));return e.filter(o=>!t(o)).slice(0,4).reverse().join(", ")}function je(s,e){return Number.isFinite(s)&&Number.isFinite(e)&&s>=-90&&s<=90&&e>=-180&&e<=180}const De="50.35,35.05,51.45,34.15",W=new Map,Z=new Map;function se(s,e){s.size>e&&s.delete(s.keys().next().value)}async function Ie(s,e,t){const o=`${s.toFixed(4)},${e.toFixed(4)}`,r=W.get(o);if(r)return r;const i=await fetch(`https://nominatim.openstreetmap.org/reverse?format=jsonv2&lat=${s}&lon=${e}&accept-language=fa`,{headers:{Accept:"application/json"},signal:t==null?void 0:t.signal});if(!i.ok)throw new Error(`http ${i.status}`);const a=await i.json();if(!a.display_name)throw new Error("empty result");return W.set(o,a.display_name),se(W,200),a.display_name}async function Ne(s,e=5,t){const o=`${M(s).trim().toLowerCase()}|${e}`,r=Z.get(o);if(r)return r;const i=await fetch(`https://nominatim.openstreetmap.org/search?format=jsonv2&accept-language=fa&limit=${e}&viewbox=${De}&bounded=1&q=${encodeURIComponent(M(s))}`,{headers:{Accept:"application/json"},signal:t==null?void 0:t.signal});if(!i.ok)throw new Error(`http ${i.status}`);const a=await i.json();return Z.set(o,a),se(Z,50),a}const Fe=["highway-minor","highway-link","highway-secondary-tertiary","highway-primary","highway-trunk","highway-motorway","bridge-minor","bridge-link","bridge-secondary-tertiary","bridge-trunk-primary","bridge-motorway"],T=64,We=15,te=2;function Ze(s,e,t,o,r,i){const a=r-t,n=i-o,l=a*a+n*n,g=l===0?0:((s-t)*a+(e-o)*n)/l,m=Math.max(0,Math.min(1,g)),p=t+m*a,u=o+m*n;return{x:p,y:u,d2:(s-p)*(s-p)+(e-u)*(e-u)}}function Be(s,e,t){if(s.getZoom()<We)return null;const o=s.project([t,e]);let r;try{const l=[[o.x-T,o.y-T],[o.x+T,o.y+T]];r=s.queryRenderedFeatures(l,{layers:Fe})}catch{return null}let i=null,a=T*T;for(const l of r){const g=l.geometry,m=g.type==="LineString"?[g.coordinates]:g.type==="MultiLineString"?g.coordinates:[];for(const p of m){let u=null;for(const L of p){const c=s.project(L);if(u){const h=Ze(o.x,o.y,u.x,u.y,c.x,c.y);h.d2<a&&(a=h.d2,i={x:h.x,y:h.y})}u={x:c.x,y:c.y}}}}if(!i||a<te*te)return null;const n=s.unproject([i.x,i.y]);return{lat:n.lat,lng:n.lng}}const oe=3,Ge="Vite: import workerUrl from 'maplibre-gl/dist/maplibre-gl-worker.mjs?worker&url'; سپس setupQomPickWorker(workerUrl) را قبل از mount صدا بزنید. Next.js/webpack: هر دو فایل worker و shared را کپی کنید.",Ve="qompick: MapLibre worker failed to load. Call setupQomPickWorker(workerUrl) from @amir83nasr/map before mounting LocationPickerView. Vite: use maplibre-gl-worker.mjs?worker&url. Next.js/webpack: copy maplibre-gl-worker.mjs and maplibre-gl-shared.mjs.";let B=!1;function Ue(s){const e=globalThis.Worker;if(typeof e!="function")return()=>{};class t extends e{constructor(r,i){super(r,i),B=!1,this.addEventListener("error",()=>{B=!0,s()})}}return globalThis.Worker=t,()=>{globalThis.Worker=e}}function He(s){const e=s,t=[e==null?void 0:e.message,e==null?void 0:e.filename,e==null?void 0:e.url,s].filter(o=>typeof o=="string").join(" ").toLowerCase();return/maplibre-gl-(worker|shared)(?:-dev)?\.mjs/.test(t)||/failed to fetch worker script/.test(t)||/worker/.test(t)&&/failed to load|cannot load|dynamically imported module/.test(t)}const I="من میخواهم با پکیج قمپیک (@amir83nasr/map) یک نقشه انتخاب موقعیت (LocationPickerView) از صفر در پروژه React/Next.js بسازم. این پکیج کاملاً متنباز و رایگان است و روی MapLibre GL ساخته شده و فقط نسخه React دارد. لطفاً قدمبهقدم و به ترتیب راهنماییام کن: ۱) نصب — دستور نصب @amir83nasr/map و maplibre-gl نسخه ۶ (که peer dependency است و باید جدا نصب شود)؛ ۲) راهاندازی پایه — ایمپورت @amir83nasr/map/styles.css (شامل CSS مپلایبر، فقط یک import CSS) و رندر کامپوننت LocationPickerView با ارتفاع مشخص (مثلاً 480px، چون بدون ارتفاع نقشه خالی دیده میشود) و center و zoom اولیه؛ ۳) جستجو — استفاده از پیشنهادهای پیشفرض محلههای قم، یا جایگزینی آنها با search.suggestions شامل name و addr و lat و lng؛۴) مارکرها — نمایش مارکر مکانها با markers؛ ۵) دریافت نتیجه — گرفتن مختصات و آدرس تاییدشده کاربر با onConfirm؛ ۶) پاکسازی — کامپوننت LocationPickerView خودش destroy را در cleanup صدا میزند. کد کامل و قابل اجرا بده شامل همه importها و cssها، بگو هر بخش چه میکند، و در پایان خروجی مورد انتظار را توصیف کن: نقشه فارسی راستچین (RTL) و موبایلفرست با پین وسط، دکمه GPS، جستجو و دکمه تایید موقعیت. اگر چیزی از پروژه من لازم داری (نسخه React/Next.js، نسخه پکیجها) اول بپرس.",ae="پروژه React/Next.js من از قبل وجود دارد و میخواهم نقشه انتخاب موقعیت قمپیک (@amir83nasr/map) را به آن اضافه کنم بدون اینکه چیز دیگری خراب شود. این پکیج کاملاً متنباز و رایگان است و روی MapLibre GL ساخته شده و فقط نسخه React دارد. لطفاً قدمبهقدم و به ترتیب راهنماییام کن: ۱) نصب — دستور نصب @amir83nasr/map و maplibre-gl نسخه ۶ (که peer dependency است و باید جدا نصب شود)، با توجه به اینکه بقیه dependencyهای پروژه نباید بههم بخورد؛ ۲) ایمپورت css — اضافه کردن @amir83nasr/map/styles.css (شامل CSS مپلایبر؛ فقط یک import CSS) طوری که با استایلهای فعلی پروژه تداخل نکند (همه کلاسها و متغیرهای قمپیک با qp- شروع میشوند)؛ ۳) کانتینر — رندر LocationPickerView با ارتفاع مشخص (مثلاً 480px، چون بدون ارتفاع نقشه خالی دیده میشود) در جای مناسب صفحه فعلی؛ ۴) اتصال — دادن center و zoom، استفاده یا جایگزینی پیشنهادهای پیشفرض search، نمایش markers، و گرفتن مختصات و آدرس تاییدشده با onConfirm؛۵) پاکسازی — کامپوننت LocationPickerView خودش destroy را در cleanup صدا میزند. کد کامل و قابل اجرا بده شامل همه importها، بگو هر بخش چه میکند، و در پایان خروجی مورد انتظار را توصیف کن: نقشه فارسی راستچین (RTL) و موبایلفرست با پین وسط، دکمه GPS، جستجو و دکمه تایید موقعیت. اگر چیزی از پروژه من لازم داری (نسخه React/Next.js، نسخه پکیجها، ساختار فایلها) اول بپرس.",re={zero:I,existing:ae};function w(s){const e=document.createElement("template");return e.innerHTML=s.trim(),e.content.firstElementChild}class Qe{constructor(e){d(this,"opts");d(this,"emitter",new Oe);d(this,"root");d(this,"map");d(this,"myMarker",null);d(this,"venueMarkers",[]);d(this,"labelEl");d(this,"toastEl");d(this,"overlay");d(this,"resolveT",0);d(this,"searchT",0);d(this,"toastT",0);d(this,"settleT",0);d(this,"confirmT",0);d(this,"venueT",[]);d(this,"revSeq",0);d(this,"searchSeq",0);d(this,"revAbort",null);d(this,"searchAbort",null);d(this,"destroyed",!1);d(this,"workerFailed",!1);d(this,"boundsSaved",null);d(this,"lat",$.lat);d(this,"lng",$.lng);d(this,"address","");d(this,"resolving",!1);d(this,"onKey",e=>{e.key==="Escape"&&(this.overlay.hidden?this.isHidden(".qp-docs")?this.isHidden(".qp-confirm")?this.isHidden(".qp-geo")||this.closeModal("qp-geo"):this.closeModal("qp-confirm"):this.closeDocs():this.closeSearch())});var o,r;const t=typeof e.container=="string"?document.querySelector(e.container):e.container;if(!t)throw new Error("qompick: container not found");this.opts=ge(e);for(const[i,a]of[["onLocationChange","locationChange"],["onAddressResolved","addressResolved"],["onSearchResults","searchResults"],["onPick","pick"],["onConfirm","confirm"],["onLocate","locate"],["onError","error"]]){const n=e[i];typeof n=="function"&&this.emitter.on(a,n)}this.build(t),this.initMap(),this.opts.markers.length&&this.addVenues(this.opts.markers),this.setLocation(((o=this.opts.map.center)==null?void 0:o.lat)??$.lat,((r=this.opts.map.center)==null?void 0:r.lng)??$.lng,{resolve:!0}),this.emitter.emit("ready",this.getLocation())}isHidden(e){var t;return((t=this.root.querySelector(e))==null?void 0:t.hidden)??!0}on(e,t){return this.emitter.on(e,t)}off(e,t){this.emitter.off(e,t)}getLocation(){return{lat:this.lat,lng:this.lng,address:this.address}}setLocation(e,t,o={}){if(!je(e,t)){this.fail(new Error("invalid coordinates"));return}this.lat=e,this.lng=t;const r=this.getLocation();if(this.emitter.emit("locationChange",r),o.moveMap&&this.map){const i=o.zoom??Math.max(this.map.getZoom(),this.opts.behavior.pickZoom??15);this.map.flyTo({center:[t,e],zoom:i,duration:450})}o.resolve!==!1&&this.opts.behavior.resolveOnMove!==!1?this.scheduleResolve(e,t):this.renderLabel()}locate(){if(!navigator.geolocation){this.toast(this.t("gpsUnsupported")),this.fail(new Error("geolocate: unsupported"));return}const e=this.root.querySelector(".qp-gps");if(!window.isSecureContext){this.openModal("qp-geo"),this.fail(new Error("geolocate: insecure-context"));return}e==null||e.classList.add("is-locating"),navigator.geolocation.getCurrentPosition(t=>{if(e==null||e.classList.remove("is-locating"),!this.boundsSaved){const o=this.map.getMaxBounds();o&&(this.boundsSaved={sw:o.getSouthWest().toArray(),ne:o.getNorthEast().toArray()})}this.map.setMaxBounds(null),this.showMyPos(t.coords.latitude,t.coords.longitude),this.setLocation(t.coords.latitude,t.coords.longitude,{moveMap:!0,zoom:this.opts.behavior.locateZoom??18}),this.boundsSaved&&(this.map.setMaxBounds([this.boundsSaved.sw,this.boundsSaved.ne]),this.boundsSaved=null),this.emitter.emit("locate",this.getLocation())},t=>{e==null||e.classList.remove("is-locating"),(t==null?void 0:t.code)===t.PERMISSION_DENIED?this.openModal("qp-geo"):(this.toast((t==null?void 0:t.code)===t.TIMEOUT?this.t("locateTimeout"):this.t("locateUnavailable")),this.scheduleResolve(this.lat,this.lng,100)),this.fail(new Error(`geolocate: ${t==null?void 0:t.code}`))},{timeout:1e4})}confirm(e){const t={lat:this.lat,lng:this.lng,address:e??this.address};return this.emitter.emit("confirm",t),t}destroy(){var e,t,o,r;this.destroyed=!0,document.removeEventListener("keydown",this.onKey),window.clearTimeout(this.resolveT),window.clearTimeout(this.searchT),window.clearTimeout(this.toastT),window.clearTimeout(this.settleT),window.clearTimeout(this.confirmT),this.venueT.forEach(i=>window.clearTimeout(i)),(e=this.revAbort)==null||e.abort(),(t=this.searchAbort)==null||t.abort(),this.venueMarkers.forEach(i=>i.remove()),(o=this.myMarker)==null||o.remove(),(r=this.map)==null||r.remove(),this.root.remove()}t(e){return this.opts.i18n.labels[e]}build(e){const t=this.opts,o=me(),r=(t.search.placeholder??this.t("searchPlaceholder")).replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">");this.root=w(`<div class="qp qp-app" dir="${o}"></div>`);const i='<div class="qp-pin" aria-hidden="true"><div class="qp-pin-body"><div class="qp-pin-head"><div class="qp-pin-hole"></div></div><div class="qp-pin-stem"></div><div class="qp-pin-foot"></div></div><div class="qp-pin-shadow"></div></div>';this.root.innerHTML=`
|
|
1
|
+
"use strict";var le=Object.defineProperty;var ce=(s,e,t)=>e in s?le(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var d=(s,e,t)=>ce(s,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const de=require("react/jsx-runtime"),P=require("react"),z=require("maplibre-gl"),pe={searchPlaceholder:"جستوجوی موقعیت...",searchTitle:"جستجوی موقعیت",suggestedPlaces:"مکانهای پیشنهادی",searching:"در حال جستجو...",noResults:"نتیجهای پیدا نشد؛ عبارت دیگری امتحان کنید",searchError:"خطا در جستجو؛ اتصال را بررسی کنید",confirmLocation:"تایید موقعیت",confirm:"تایید",editOnMap:"ویرایش روی نقشه",chosenAddress:"آدرس انتخابی",coordsToServer:"مختصات ارسالی به سرور",close:"بستن",clearSearch:"پاک کردن جستجو",currentLocation:"موقعیت فعلی",locating:"در حال پیدا کردن آدرس...",resolving:"در حال پیدا کردن آدرس...",registered:"موقعیت ثبت شد",gpsUnsupported:"GPS در این مرورگر پشتیبانی نمیشود",locateTimeout:"دریافت موقعیت طول کشید؛ دستی انتخاب کنید",locateUnavailable:"موقعیت در دسترس نیست؛ دستی انتخاب کنید",geoTitle:"دسترسی به موقعیت مکانی",geoText:"برای انتخاب موقعیت فعلی شما، لازم است دسترسی موقعیت مکانی را فعال کنید.",geoBlocked:"مرورگر قبلاً دسترسی را بسته است. از تنظیمات سایت مرورگر، دسترسی Location را مجاز کنید.",enableAccess:"فعال کردن دسترسی",developers:"توسعهدهندگان",backToMap:"بازگشت به نقشه",copy:"کپی",copied:"کپی شد",submitting:"در حال ثبت..."},ie=[{name:"۱۹ دی، قم",addr:"محله ۱۹ دی، شهر قم",lat:34.6558,lng:50.9055},{name:"آذر، قم",addr:"محله آذر، شهر قم",lat:34.6492,lng:50.8965},{name:"امام حسین، قم",addr:"میدان امام حسین، شهر قم",lat:34.6512,lng:50.8932},{name:"انسجام، قم",addr:"محله انسجام، شهر قم",lat:34.6058,lng:50.8752},{name:"انقلاب، قم",addr:"خیابان انقلاب، شهر قم",lat:34.6462,lng:50.8915},{name:"باجک، قم",addr:"محله باجک، شهر قم",lat:34.6601,lng:50.8823},{name:"بلوار امین، قم",addr:"محله بلوار امین، شهر قم",lat:34.6248,lng:50.8792},{name:"بنیاد، قم",addr:"محله بنیاد، شهر قم",lat:34.6475,lng:50.8985},{name:"پردیسان، قم",addr:"شهرک پردیسان، شهر قم",lat:34.6021,lng:50.8412},{name:"توحید، قم",addr:"محله توحید، شهر قم",lat:34.6685,lng:50.8748},{name:"جمکران، قم",addr:"محله جمکران، شهر قم",lat:34.5853,lng:50.9068},{name:"چهارمردان، قم",addr:"محله چهارمردان، شهر قم",lat:34.6401,lng:50.8873},{name:"حافظ، قم",addr:"خیابان حافظ، شهر قم",lat:34.6368,lng:50.8785},{name:"حرم، قم",addr:"محله حرم، شهر قم",lat:34.6448,lng:50.8791},{name:"خاکفرج، قم",addr:"محله خاکفرج، شهر قم",lat:34.6798,lng:50.9012},{name:"دروازه ری، قم",addr:"محله دروازه ری، شهر قم",lat:34.6352,lng:50.8958},{name:"دورشهر، قم",addr:"محله دورشهر، شهر قم",lat:34.6442,lng:50.8744},{name:"زاویه، قم",addr:"محله زاویه، شهر قم",lat:34.6385,lng:50.8682},{name:"زنبیلآباد، قم",addr:"محله زنبیلآباد، شهر قم",lat:34.6221,lng:50.8912},{name:"سالاریه، قم",addr:"محله سالاریه، شهر قم",lat:34.6289,lng:50.8624},{name:"سمیه، قم",addr:"خیابان سمیه، شهر قم",lat:34.6521,lng:50.8842},{name:"شهدا، قم",addr:"خیابان شهدا، شهر قم",lat:34.6425,lng:50.8831},{name:"شهرقائم، قم",addr:"شهرک قائم، شهر قم",lat:34.6158,lng:50.8505},{name:"شهرک امام حسن، قم",addr:"شهرک امام حسن، شهر قم",lat:34.6358,lng:50.8521},{name:"شهرک مهدیه، قم",addr:"شهرک مهدیه، شهر قم",lat:34.6258,lng:50.8452},{name:"شهرک ولیعصر، قم",addr:"شهرک ولیعصر، شهر قم",lat:34.6125,lng:50.8585},{name:"شیخآباد، قم",addr:"محله شیخآباد، شهر قم",lat:34.6582,lng:50.8718},{name:"صدوق، قم",addr:"خیابان صدوق، شهر قم",lat:34.6198,lng:50.8725},{name:"صفائیه، قم",addr:"محله صفائیه، شهر قم",lat:34.6327,lng:50.8713},{name:"عسگریه، قم",addr:"محله عسگریه، شهر قم",lat:34.6305,lng:50.9018},{name:"عطاران، قم",addr:"محله عطاران، شهر قم",lat:34.6548,lng:50.8895},{name:"فرهنگیان، قم",addr:"محله فرهنگیان، شهر قم",lat:34.6105,lng:50.8702},{name:"کشاورز، قم",addr:"محله کشاورز، شهر قم",lat:34.6642,lng:50.8885},{name:"کلهری، قم",addr:"منطقه کلهری، شهر قم",lat:34.6211,lng:50.9055},{name:"کیوانفر، قم",addr:"محله کیوانفر، شهر قم",lat:34.6172,lng:50.8856},{name:"مطهری، قم",addr:"خیابان مطهری، شهر قم",lat:34.6485,lng:50.8878},{name:"معلم، قم",addr:"میدان معلم، شهر قم",lat:34.6275,lng:50.8942},{name:"نوبهار، قم",addr:"محله نوبهار، شهر قم",lat:34.6623,lng:50.8952},{name:"نیروگاه، قم",addr:"محله نیروگاه، شهر قم",lat:34.6712,lng:50.8851},{name:"هفتتیر، قم",addr:"خیابان هفتتیر، شهر قم",lat:34.6442,lng:50.8995},{name:"یزدانشهر، قم",addr:"محله یزدانشهر، شهر قم",lat:34.6012,lng:50.8628}],$={lat:34.6416,lng:50.8764},ue=14;function he(s){return{...pe,...(s==null?void 0:s.labels)??{}}}function me(){return"rtl"}function ge(s){const e=s??{};return{container:e.container,map:{center:{...$},zoom:ue,minZoom:11,maxZoom:19,bounds:[[34.15,50.35],[35.05,51.45]],...e.map??{}},controls:{gps:!0,confirmButton:!0,searchTrigger:!0,developers:!1,...e.controls??{}},search:{enabled:!0,suggestions:ie,minLength:3,debounceMs:350,limit:5,...e.search??{}},sheet:{enabled:!0,...e.sheet??{}},behavior:{snapToRoad:!0,resolveOnMove:!0,resolveDelayMs:400,settleDelayMs:250,snapDelayMs:900,pickZoom:15,locateZoom:18,...e.behavior??{}},i18n:{labels:he(e.i18n)},markers:e.markers??[]}}const ye="#e9ebee",fe="#e9ebee",G="#a9e29b",be="#9ed894",ve="#b5e8a6",we="#d3ddd0",qe="#e9dfc0",xe="#b9d9f2",ke="#cfe4f7",N="#a9cdf0",V="#4e6e94",U="#dfe3e9",Se="#e9ebee",O="#ffffff",Le="#d9dde2",x="#ffffff",A="#d5dae0",Ee="#cdbfa8",Te="#e9ebee",H="#c6ccd4",F="#b9bdc4",Q="#a7aab3",Y="#5b6067",_="#2f3338",f="#f7f8f9",j="#565b62",Me=["coalesce",["get","name:fa"],["get","name:nonlatin"],["get","name"],["get","name:latin"]],Re=["0","۰","1","۱","2","۲","3","۳","4","۴","5","۵","6","۶","7","۷","8","۸","9","۹","٠","۰","١","۱","٢","۲","٣","۳","٤","۴","٥","۵","٦","۶","٧","۷","٨","۸","٩","۹"];function Ae(s,e=40){const t=["coalesce",s,""],o=["split",["to-string",t],""],r=["length",o],i=[];for(let a=0;a<e;a++){const n=["at",a,o];i.push(["case",[">",r,a],["match",n,...Re,n],""])}return i.push(["slice",["to-string",t],e]),["format",["concat",...i],{}]}const b=Ae(Me),k=["IRANYekanX"],D=["IRANYekanX"],q=["LineString","MultiLineString"],_e=["MultiPoint","Point"];function y(s){return["interpolate",["exponential",1.2],["zoom"],...s]}const X=["interpolate",["exponential",1.2],["zoom"],12.5,0,13,1.5,14,2.5,20,11.5],Ce=["interpolate",["exponential",1.2],["zoom"],12,.5,13,1,14,4,20,15],ze=[{id:"background",type:"background",paint:{"background-color":ye}},{id:"landuse-residential",type:"fill",source:"openmaptiles","source-layer":"landuse",filter:["match",["get","class"],["neighbourhood","residential"],!0,!1],paint:{"fill-color":fe}},{id:"landuse-cemetery",type:"fill",source:"openmaptiles","source-layer":"landuse",filter:["==",["get","class"],"cemetery"],paint:{"fill-color":we}},{id:"landcover-wood",type:"fill",source:"openmaptiles","source-layer":"landcover",filter:["==",["get","class"],"wood"],paint:{"fill-color":be}},{id:"landcover-grass",type:"fill",source:"openmaptiles","source-layer":"landcover",filter:["==",["get","class"],"grass"],paint:{"fill-color":ve}},{id:"landcover-grass-park",type:"fill",source:"openmaptiles","source-layer":"park",paint:{"fill-color":G}},{id:"park",type:"fill",source:"openmaptiles","source-layer":"park",filter:["match",["geometry-type"],["MultiPolygon","Polygon"],!0,!1],paint:{"fill-color":G}},{id:"landcover-sand",type:"fill",source:"openmaptiles","source-layer":"landcover",filter:["==",["get","class"],"sand"],paint:{"fill-color":qe}},{id:"water",type:"fill",source:"openmaptiles","source-layer":"water",filter:["all",["!=",["get","intermittent"],1],["!=",["get","brunnel"],"tunnel"]],paint:{"fill-color":xe}},{id:"water-intermittent",type:"fill",source:"openmaptiles","source-layer":"water",filter:["all",["==",["get","intermittent"],1],["!=",["get","brunnel"],"tunnel"]],paint:{"fill-color":ke,"fill-opacity":.8}},{id:"waterway-other",type:"line",source:"openmaptiles","source-layer":"waterway",filter:["all",["match",["get","class"],["canal","river","stream"],!1,!0],["==",["get","intermittent"],0]],paint:{"line-color":N,"line-width":["interpolate",["exponential",1.3],["zoom"],13,.5,20,2]}},{id:"waterway-stream-canal",type:"line",source:"openmaptiles","source-layer":"waterway",filter:["all",["match",["get","class"],["canal","stream"],!0,!1],["!=",["get","brunnel"],"tunnel"],["==",["get","intermittent"],0]],paint:{"line-color":N,"line-width":["interpolate",["exponential",1.3],["zoom"],13,.5,20,6]}},{id:"waterway-river",type:"line",source:"openmaptiles","source-layer":"waterway",filter:["all",["==",["get","class"],"river"],["!=",["get","brunnel"],"tunnel"],["!=",["get","intermittent"],1]],paint:{"line-color":N,"line-width":["interpolate",["exponential",1.2],["zoom"],10,.8,20,6]}},{id:"building",type:"fill",source:"openmaptiles","source-layer":"building",paint:{"fill-antialias":!0,"fill-color":U}},{id:"building-top",type:"fill",source:"openmaptiles","source-layer":"building",paint:{"fill-color":Se,"fill-opacity":["interpolate",["linear"],["zoom"],13,0,16,1],"fill-outline-color":U,"fill-translate":["interpolate",["linear"],["zoom"],14,["literal",[0,0]],16,["literal",[-2,-2]]]}},{id:"aeroway-area",type:"fill",source:"openmaptiles","source-layer":"aeroway",paint:{"fill-color":Te,"fill-opacity":["interpolate",["linear"],["zoom"],13,0,14,1]}},{id:"aeroway-taxiway-casing",type:"line",source:"openmaptiles","source-layer":"aeroway",filter:["==",["get","class"],"taxiway"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":H,"line-width":["interpolate",["exponential",1.5],["zoom"],11,2,17,12]}},{id:"aeroway-taxiway",type:"line",source:"openmaptiles","source-layer":"aeroway",filter:["==",["get","class"],"taxiway"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":O,"line-width":["interpolate",["exponential",1.5],["zoom"],11,1,17,10]}},{id:"aeroway-runway-casing",type:"line",source:"openmaptiles","source-layer":"aeroway",filter:["==",["get","class"],"runway"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":H,"line-width":["interpolate",["exponential",1.5],["zoom"],11,5,17,55]}},{id:"aeroway-runway",type:"line",source:"openmaptiles","source-layer":"aeroway",filter:["==",["get","class"],"runway"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":O,"line-width":["interpolate",["exponential",1.5],["zoom"],11,4,17,50]}},{id:"highway-minor-casing",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["match",["geometry-type"],q,!0,!1],["!=",["get","brunnel"],"tunnel"],["match",["get","class"],["minor","service","track"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":Le,"line-opacity":["interpolate",["linear"],["zoom"],12,0,12.5,1],"line-width":Ce}},{id:"highway-link-casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1],["==",["get","ramp"],1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":A,"line-width":y([12,1,13,3,14,4,20,15])}},{id:"highway-secondary-tertiary-casing",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["match",["get","class"],["secondary","tertiary"],!0,!1],["!=",["get","ramp"],1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":A,"line-width":y([8,1.5,20,17])}},{id:"highway-primary-casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["match",["get","class"],["primary"],!0,!1],["!=",["get","ramp"],1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":A,"line-opacity":["interpolate",["linear"],["zoom"],7,0,8,1],"line-width":y([7,0,8,.6,9,1.5,20,22])}},{id:"highway-trunk-casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["match",["get","class"],["trunk"],!0,!1],["!=",["get","ramp"],1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":A,"line-opacity":["interpolate",["linear"],["zoom"],5,0,6,1],"line-width":y([5,0,6,.6,7,1.5,20,22])}},{id:"highway-motorway-casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:4,filter:["all",["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["==",["get","class"],"motorway"],["!=",["get","ramp"],1]],layout:{"line-cap":"butt","line-join":"round"},paint:{"line-color":A,"line-opacity":["interpolate",["linear"],["zoom"],4,0,5,1],"line-width":y([4,0,5,.4,6,.6,7,1.5,20,22])}},{id:"highway-path",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["match",["geometry-type"],q,!0,!1],["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["==",["get","class"],"path"]],paint:{"line-color":Ee,"line-dasharray":[1.5,.75],"line-width":y([15,1.2,20,4])}},{id:"highway-link",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1],["==",["get","ramp"],1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":x,"line-width":y([12.5,0,13,1.5,14,2.5,20,11.5])}},{id:"highway-minor",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["match",["geometry-type"],q,!0,!1],["!=",["get","brunnel"],"tunnel"],["match",["get","class"],["minor","service","track"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":O,"line-width":X}},{id:"highway-secondary-tertiary",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["match",["get","class"],["secondary","tertiary"],!0,!1],["!=",["get","ramp"],1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":x,"line-width":y([6.5,0,8,.5,20,13])}},{id:"highway-primary",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["match",["geometry-type"],q,!0,!1],["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["match",["get","class"],["primary"],!0,!1],["!=",["get","ramp"],1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":x,"line-width":y([8.5,0,9,.5,20,18])}},{id:"highway-trunk",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["match",["geometry-type"],q,!0,!1],["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["match",["get","class"],["trunk"],!0,!1],["!=",["get","ramp"],1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":x,"line-width":y([6.5,0,7,.5,20,18])}},{id:"highway-motorway",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["match",["geometry-type"],q,!0,!1],["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["==",["get","class"],"motorway"],["!=",["get","ramp"],1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":x,"line-width":y([6.5,0,7,.5,20,18])}},{id:"bridge-link",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["==",["get","brunnel"],"bridge"],["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1],["==",["get","ramp"],1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":x,"line-width":y([12.5,0,13,1.5,14,2.5,20,11.5])}},{id:"bridge-minor",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["==",["get","brunnel"],"bridge"],["match",["get","class"],["minor","service","track"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":O,"line-width":X}},{id:"bridge-secondary-tertiary",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["==",["get","brunnel"],"bridge"],["match",["get","class"],["secondary","tertiary"],!0,!1],["!=",["get","ramp"],1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":x,"line-width":y([6.5,0,8,.5,20,13])}},{id:"bridge-trunk-primary",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["==",["get","brunnel"],"bridge"],["match",["get","class"],["primary","trunk"],!0,!1],["!=",["get","ramp"],1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":x,"line-width":y([6.5,0,7,.5,20,18])}},{id:"bridge-motorway",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["==",["get","brunnel"],"bridge"],["==",["get","class"],"motorway"],["!=",["get","ramp"],1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":x,"line-width":y([6.5,0,7,.5,20,18])}},{id:"railway-transit",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["match",["geometry-type"],q,!0,!1],["==",["get","class"],"transit"],["match",["get","brunnel"],["tunnel"],!1,!0]],paint:{"line-color":F,"line-width":["interpolate",["exponential",1.4],["zoom"],14,.4,20,1]}},{id:"railway-service",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["match",["geometry-type"],q,!0,!1],["has","service"],["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["==",["get","class"],"rail"]],paint:{"line-color":F,"line-width":["interpolate",["exponential",1.4],["zoom"],14,.4,20,1]}},{id:"railway",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["match",["geometry-type"],q,!0,!1],["!",["has","service"]],["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["==",["get","class"],"rail"]],paint:{"line-color":F,"line-width":["interpolate",["exponential",1.4],["zoom"],14,.4,15,.75,20,2]}},{id:"boundary_3",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["==",["get","admin_level"],3],["!=",["get","maritime"],1]],paint:{"line-color":Q,"line-dasharray":[1,1],"line-width":["interpolate",["linear"],["zoom"],7,1,11,2]}},{id:"boundary_2",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["==",["get","admin_level"],2],["!=",["get","maritime"],1],["!=",["get","disputed"],1],["!",["has","claimed_by"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":Q,"line-opacity":["interpolate",["linear"],["zoom"],0,.4,4,1],"line-width":["interpolate",["linear"],["zoom"],3,1,5,1.2,12,3]}},{id:"waterway_line_label",type:"symbol",source:"openmaptiles","source-layer":"waterway",layout:{"symbol-placement":"line","symbol-spacing":350,"text-field":b,"text-font":k,"text-size":13},paint:{"text-color":V,"text-halo-color":f,"text-halo-width":1.5}},{id:"water_name_label",type:"symbol",source:"openmaptiles","source-layer":"water_name",layout:{"text-field":b,"text-font":k,"text-max-width":8,"text-size":12},paint:{"text-color":V,"text-halo-color":f,"text-halo-width":1.5}},{id:"poi_worship_school",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:14,filter:["match",["get","class"],["place_of_worship","school","college","library","hospital","park"],!0,!1],layout:{"icon-image":["match",["get","class"],["place_of_worship"],"place_of_worship",["school"],"school",["college"],"school",["library"],"school",["hospital"],"hospital",["park"],"park",""],"icon-size":1.1,"text-anchor":"top","text-field":b,"text-font":k,"text-max-width":8,"text-offset":[0,1],"text-size":12},paint:{"text-color":j,"text-halo-color":f,"text-halo-width":1.5}},{id:"poi_shops",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:15.5,filter:["match",["get","class"],["shop","grocery","restaurant","cafe","fast_food","pharmacy","bank","fuel"],!0,!1],layout:{"icon-image":["match",["get","class"],["grocery"],"grocery",["restaurant"],"restaurant",["cafe"],"cafe",["fast_food"],"restaurant",["pharmacy"],"pharmacy",["bank"],"bank",["fuel"],"fuel","shop"],"icon-size":1,"text-anchor":"top","text-field":b,"text-font":k,"text-max-width":8,"text-offset":[0,1],"text-size":12},paint:{"text-color":j,"text-halo-color":f,"text-halo-width":1.5}},{id:"poi_r1",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:16,filter:["all",["match",["geometry-type"],_e,!0,!1],[">=",["get","rank"],1],["<",["get","rank"],7]],layout:{"icon-image":["match",["get","subclass"],["florist","furniture"],["get","subclass"],["get","class"]],"icon-size":.8,"text-anchor":"top","text-field":b,"text-font":k,"text-max-width":8,"text-offset":[0,.8],"text-size":12},paint:{"text-color":j,"text-halo-color":f,"text-halo-width":1.5}},{id:"airport",type:"symbol",source:"openmaptiles","source-layer":"aerodrome_label",minzoom:10,filter:["all",["has","iata"]],layout:{"icon-image":"airport_11","icon-size":1,"text-anchor":"top","text-field":b,"text-font":k,"text-max-width":8,"text-offset":[0,.8],"text-size":12},paint:{"text-color":j,"text-halo-color":f,"text-halo-width":1.5}},{id:"highway-name-minor",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:14,filter:["all",["match",["geometry-type"],q,!0,!1],["match",["get","class"],["minor","service","track"],!0,!1]],layout:{"symbol-placement":"line","text-field":b,"text-font":k,"text-rotation-alignment":"map","text-size":["interpolate",["linear"],["zoom"],14,11,17,12]},paint:{"text-color":Y,"text-halo-color":f,"text-halo-width":1.5}},{id:"highway-name-major",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:11,filter:["match",["get","class"],["primary","secondary","tertiary","trunk","motorway"],!0,!1],layout:{"symbol-placement":"line","text-field":b,"text-font":D,"text-rotation-alignment":"map","text-size":["interpolate",["linear"],["zoom"],11,11,15,13]},paint:{"text-color":Y,"text-halo-color":f,"text-halo-width":1.5}},{id:"label_village",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:9,filter:["==",["get","class"],"village"],layout:{"text-field":b,"text-font":k,"text-max-width":8,"text-size":["interpolate",["exponential",1.2],["zoom"],9,11,12,13]},paint:{"text-color":_,"text-halo-color":f,"text-halo-width":1.5}},{id:"label_town",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:6,filter:["==",["get","class"],"town"],layout:{"text-field":b,"text-font":D,"text-max-width":8,"text-size":["interpolate",["exponential",1.2],["zoom"],7,12,11,14]},paint:{"text-color":_,"text-halo-color":f,"text-halo-width":1.5}},{id:"label_other",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:8,filter:["match",["get","class"],["city","continent","country","state","town","village"],!1,!0],layout:{"text-field":b,"text-font":k,"text-max-width":8,"text-size":["interpolate",["linear"],["zoom"],8,10,12,12]},paint:{"text-color":_,"text-halo-color":f,"text-halo-width":1.5}},{id:"label_city",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:3,filter:["all",["==",["get","class"],"city"],["!=",["get","capital"],2]],layout:{"text-field":b,"text-font":D,"text-max-width":8,"text-size":["interpolate",["exponential",1.2],["zoom"],4,11,7,13,11,16]},paint:{"text-color":_,"text-halo-color":f,"text-halo-width":1.5}},{id:"label_city_capital",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:3,filter:["all",["==",["get","class"],"city"],["==",["get","capital"],2]],layout:{"text-field":b,"text-font":D,"text-max-width":8,"text-size":["interpolate",["exponential",1.2],["zoom"],4,12,7,14,11,18]},paint:{"text-color":_,"text-halo-color":f,"text-halo-width":1.5}}],$e="https://tiles.openfreemap.org/planet",Pe={version:8,name:"snapp-like",glyphs:"https://cdn.jsdelivr.net/npm/@amir83nasr/map@1/fonts/{fontstack}/{range}.pbf",sprite:"https://tiles.openfreemap.org/sprites/ofm_f384/ofm",sources:{openmaptiles:{type:"vector",url:$e}},layers:ze};class Oe{constructor(){d(this,"map",new Map)}on(e,t){let o=this.map.get(e);return o||this.map.set(e,o=new Set),o.add(t),()=>this.off(e,t)}off(e,t){var o;(o=this.map.get(e))==null||o.delete(t)}emit(e,t){for(const o of this.map.get(e)??[])try{o(t)}catch{}}}function C(s){return`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${s}</svg>`}const v={locate:C('<line x1="2" x2="5" y1="12" y2="12"/><line x1="19" x2="22" y1="12" y2="12"/><line x1="12" x2="12" y1="2" y2="5"/><line x1="12" x2="12" y1="19" y2="22"/><circle cx="12" cy="12" r="7"/><circle cx="12" cy="12" r="3"/>'),pin:C('<path d="M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z"/><circle cx="12" cy="10" r="3"/>'),search:C('<circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/>'),star:C('<polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" fill="currentColor" stroke="none"/>'),x:C('<path d="M18 6 6 18"/><path d="m6 6 12 12"/>')},K="۰۱۲۳۴۵۶۷۸۹";function S(s){return String(s).replace(/\d/g,e=>K[Number(e)]).replace(/[٠-٩]/g,e=>K["٠١٢٣٤٥٦٧٨٩".indexOf(e)])}function J(s,e=5){return S(Number(s).toFixed(e))}function M(s){return String(s).replace(/[۰-۹]/g,e=>String("۰۱۲۳۴۵۶۷۸۹".indexOf(e))).replace(/[٠-٩]/g,e=>String("٠١٢٣٤٥٦٧٨٩".indexOf(e)))}function ee(s){if(!s)return"";const e=String(s).split(",").map(o=>o.trim()).filter(Boolean),t=o=>!!(/^(ایران|Iran)$/i.test(o)||/^استان\b/.test(o)||/^شهرستان\b/.test(o)||/^بخش\b/.test(o)||/^[\d\s\-–—]+$/.test(M(o)));return e.filter(o=>!t(o)).slice(0,4).reverse().join(", ")}function je(s,e){return Number.isFinite(s)&&Number.isFinite(e)&&s>=-90&&s<=90&&e>=-180&&e<=180}const De="50.35,35.05,51.45,34.15",W=new Map,Z=new Map;function se(s,e){s.size>e&&s.delete(s.keys().next().value)}async function Ie(s,e,t){const o=`${s.toFixed(4)},${e.toFixed(4)}`,r=W.get(o);if(r)return r;const i=await fetch(`https://nominatim.openstreetmap.org/reverse?format=jsonv2&lat=${s}&lon=${e}&accept-language=fa`,{headers:{Accept:"application/json"},signal:t==null?void 0:t.signal});if(!i.ok)throw new Error(`http ${i.status}`);const a=await i.json();if(!a.display_name)throw new Error("empty result");return W.set(o,a.display_name),se(W,200),a.display_name}async function Ne(s,e=5,t){const o=`${M(s).trim().toLowerCase()}|${e}`,r=Z.get(o);if(r)return r;const i=await fetch(`https://nominatim.openstreetmap.org/search?format=jsonv2&accept-language=fa&limit=${e}&viewbox=${De}&bounded=1&q=${encodeURIComponent(M(s))}`,{headers:{Accept:"application/json"},signal:t==null?void 0:t.signal});if(!i.ok)throw new Error(`http ${i.status}`);const a=await i.json();return Z.set(o,a),se(Z,50),a}const Fe=["highway-minor","highway-link","highway-secondary-tertiary","highway-primary","highway-trunk","highway-motorway","bridge-minor","bridge-link","bridge-secondary-tertiary","bridge-trunk-primary","bridge-motorway"],T=64,We=15,te=2;function Ze(s,e,t,o,r,i){const a=r-t,n=i-o,l=a*a+n*n,g=l===0?0:((s-t)*a+(e-o)*n)/l,m=Math.max(0,Math.min(1,g)),p=t+m*a,u=o+m*n;return{x:p,y:u,d2:(s-p)*(s-p)+(e-u)*(e-u)}}function Be(s,e,t){if(s.getZoom()<We)return null;const o=s.project([t,e]);let r;try{const l=[[o.x-T,o.y-T],[o.x+T,o.y+T]];r=s.queryRenderedFeatures(l,{layers:Fe})}catch{return null}let i=null,a=T*T;for(const l of r){const g=l.geometry,m=g.type==="LineString"?[g.coordinates]:g.type==="MultiLineString"?g.coordinates:[];for(const p of m){let u=null;for(const L of p){const c=s.project(L);if(u){const h=Ze(o.x,o.y,u.x,u.y,c.x,c.y);h.d2<a&&(a=h.d2,i={x:h.x,y:h.y})}u={x:c.x,y:c.y}}}}if(!i||a<te*te)return null;const n=s.unproject([i.x,i.y]);return{lat:n.lat,lng:n.lng}}const oe=3,Ge="Vite: import workerUrl from 'maplibre-gl/dist/maplibre-gl-worker.mjs?worker&url'; سپس setupQomPickWorker(workerUrl) را قبل از mount صدا بزنید. Next.js/webpack: هر دو فایل worker و shared را کپی کنید.",Ve="qompick: MapLibre worker failed to load. Call setupQomPickWorker(workerUrl) from @amir83nasr/map before mounting LocationPickerView. Vite: use maplibre-gl-worker.mjs?worker&url. Next.js/webpack: copy maplibre-gl-worker.mjs and maplibre-gl-shared.mjs.";let B=!1;function Ue(s){const e=globalThis.Worker;if(typeof e!="function")return()=>{};class t extends e{constructor(r,i){super(r,i),B=!1,this.addEventListener("error",()=>{B=!0,s()})}}return globalThis.Worker=t,()=>{globalThis.Worker=e}}function He(s){const e=s,t=[e==null?void 0:e.message,e==null?void 0:e.filename,e==null?void 0:e.url,s].filter(o=>typeof o=="string").join(" ").toLowerCase();return/maplibre-gl-(worker|shared)(?:-dev)?\.mjs/.test(t)||/failed to fetch worker script/.test(t)||/worker/.test(t)&&/failed to load|cannot load|dynamically imported module/.test(t)}const I="من میخواهم با پکیج قمپیک (@amir83nasr/map) یک نقشه انتخاب موقعیت (LocationPickerView) از صفر در پروژه React/Next.js بسازم. این پکیج کاملاً متنباز و رایگان است و روی MapLibre GL ساخته شده و فقط نسخه React دارد. لطفاً قدمبهقدم و به ترتیب راهنماییام کن: ۱) نصب — دستور نصب @amir83nasr/map و maplibre-gl نسخه ۶ (که peer dependency است و باید جدا نصب شود)؛ ۲) راهاندازی پایه — ایمپورت @amir83nasr/map/styles.css (شامل CSS مپلایبر، فقط یک import CSS) و رندر کامپوننت LocationPickerView با ارتفاع مشخص (مثلاً 480px، چون بدون ارتفاع نقشه خالی دیده میشود) و center و zoom اولیه؛ ۳) جستجو — استفاده از پیشنهادهای پیشفرض محلههای قم، یا جایگزینی آنها با search.suggestions شامل name و addr و lat و lng؛۴) مارکرها — نمایش مارکر مکانها با markers؛ ۵) دریافت نتیجه — گرفتن مختصات و آدرس تاییدشده کاربر با onConfirm؛ ۶) پاکسازی — کامپوننت LocationPickerView خودش destroy را در cleanup صدا میزند. کد کامل و قابل اجرا بده شامل همه importها و cssها، بگو هر بخش چه میکند، و در پایان خروجی مورد انتظار را توصیف کن: نقشه فارسی راستچین (RTL) و موبایلفرست با پین وسط، دکمه GPS، جستجو و دکمه تایید موقعیت. اگر چیزی از پروژه من لازم داری (نسخه React/Next.js، نسخه پکیجها) اول بپرس.",ae="پروژه React/Next.js من از قبل وجود دارد و میخواهم نقشه انتخاب موقعیت قمپیک (@amir83nasr/map) را به آن اضافه کنم بدون اینکه چیز دیگری خراب شود. این پکیج کاملاً متنباز و رایگان است و روی MapLibre GL ساخته شده و فقط نسخه React دارد. لطفاً قدمبهقدم و به ترتیب راهنماییام کن: ۱) نصب — دستور نصب @amir83nasr/map و maplibre-gl نسخه ۶ (که peer dependency است و باید جدا نصب شود)، با توجه به اینکه بقیه dependencyهای پروژه نباید بههم بخورد؛ ۲) ایمپورت css — اضافه کردن @amir83nasr/map/styles.css (شامل CSS مپلایبر؛ فقط یک import CSS) طوری که با استایلهای فعلی پروژه تداخل نکند (همه کلاسها و متغیرهای قمپیک با qp- شروع میشوند)؛ ۳) کانتینر — رندر LocationPickerView با ارتفاع مشخص (مثلاً 480px، چون بدون ارتفاع نقشه خالی دیده میشود) در جای مناسب صفحه فعلی؛ ۴) اتصال — دادن center و zoom، استفاده یا جایگزینی پیشنهادهای پیشفرض search، نمایش markers، و گرفتن مختصات و آدرس تاییدشده با onConfirm؛۵) پاکسازی — کامپوننت LocationPickerView خودش destroy را در cleanup صدا میزند. کد کامل و قابل اجرا بده شامل همه importها، بگو هر بخش چه میکند، و در پایان خروجی مورد انتظار را توصیف کن: نقشه فارسی راستچین (RTL) و موبایلفرست با پین وسط، دکمه GPS، جستجو و دکمه تایید موقعیت. اگر چیزی از پروژه من لازم داری (نسخه React/Next.js، نسخه پکیجها، ساختار فایلها) اول بپرس.",re={zero:I,existing:ae};function w(s){const e=document.createElement("template");return e.innerHTML=s.trim(),e.content.firstElementChild}class Qe{constructor(e){d(this,"opts");d(this,"emitter",new Oe);d(this,"root");d(this,"map");d(this,"myMarker",null);d(this,"venueMarkers",[]);d(this,"labelEl");d(this,"toastEl");d(this,"overlay");d(this,"resolveT",0);d(this,"searchT",0);d(this,"toastT",0);d(this,"settleT",0);d(this,"confirmT",0);d(this,"venueT",[]);d(this,"revSeq",0);d(this,"searchSeq",0);d(this,"revAbort",null);d(this,"searchAbort",null);d(this,"destroyed",!1);d(this,"workerFailed",!1);d(this,"boundsSaved",null);d(this,"lat",$.lat);d(this,"lng",$.lng);d(this,"address","");d(this,"resolving",!1);d(this,"onKey",e=>{e.key==="Escape"&&(this.overlay.hidden?this.isHidden(".qp-docs")?this.isHidden(".qp-confirm")?this.isHidden(".qp-geo")||this.closeModal("qp-geo"):this.closeModal("qp-confirm"):this.closeDocs():this.closeSearch())});var o,r;const t=typeof e.container=="string"?document.querySelector(e.container):e.container;if(!t)throw new Error("qompick: container not found");this.opts=ge(e);for(const[i,a]of[["onLocationChange","locationChange"],["onAddressResolved","addressResolved"],["onSearchResults","searchResults"],["onPick","pick"],["onConfirm","confirm"],["onLocate","locate"],["onError","error"]]){const n=e[i];typeof n=="function"&&this.emitter.on(a,n)}this.build(t),this.initMap(),this.opts.markers.length&&this.addVenues(this.opts.markers),this.setLocation(((o=this.opts.map.center)==null?void 0:o.lat)??$.lat,((r=this.opts.map.center)==null?void 0:r.lng)??$.lng,{resolve:!0}),this.emitter.emit("ready",this.getLocation())}isHidden(e){var t;return((t=this.root.querySelector(e))==null?void 0:t.hidden)??!0}on(e,t){return this.emitter.on(e,t)}off(e,t){this.emitter.off(e,t)}getLocation(){return{lat:this.lat,lng:this.lng,address:this.address}}setLocation(e,t,o={}){if(!je(e,t)){this.fail(new Error("invalid coordinates"));return}this.lat=e,this.lng=t;const r=this.getLocation();if(this.emitter.emit("locationChange",r),o.moveMap&&this.map){const i=o.zoom??Math.max(this.map.getZoom(),this.opts.behavior.pickZoom??15);this.map.flyTo({center:[t,e],zoom:i,duration:450})}o.resolve!==!1&&this.opts.behavior.resolveOnMove!==!1?this.scheduleResolve(e,t):this.renderLabel()}locate(){if(!navigator.geolocation){this.toast(this.t("gpsUnsupported")),this.fail(new Error("geolocate: unsupported"));return}const e=this.root.querySelector(".qp-gps");if(!window.isSecureContext){this.openModal("qp-geo"),this.fail(new Error("geolocate: insecure-context"));return}e==null||e.classList.add("is-locating"),navigator.geolocation.getCurrentPosition(t=>{if(e==null||e.classList.remove("is-locating"),!this.boundsSaved){const o=this.map.getMaxBounds();o&&(this.boundsSaved={sw:o.getSouthWest().toArray(),ne:o.getNorthEast().toArray()})}this.map.setMaxBounds(null),this.showMyPos(t.coords.latitude,t.coords.longitude),this.setLocation(t.coords.latitude,t.coords.longitude,{moveMap:!0,zoom:this.opts.behavior.locateZoom??18}),this.boundsSaved&&(this.map.setMaxBounds([this.boundsSaved.sw,this.boundsSaved.ne]),this.boundsSaved=null),this.emitter.emit("locate",this.getLocation())},t=>{e==null||e.classList.remove("is-locating"),(t==null?void 0:t.code)===t.PERMISSION_DENIED?this.openModal("qp-geo"):(this.toast((t==null?void 0:t.code)===t.TIMEOUT?this.t("locateTimeout"):this.t("locateUnavailable")),this.scheduleResolve(this.lat,this.lng,100)),this.fail(new Error(`geolocate: ${t==null?void 0:t.code}`))},{timeout:1e4})}confirm(e){const t={lat:this.lat,lng:this.lng,address:e??this.address};return this.emitter.emit("confirm",t),t}destroy(){var e,t,o,r;this.destroyed=!0,document.removeEventListener("keydown",this.onKey),window.clearTimeout(this.resolveT),window.clearTimeout(this.searchT),window.clearTimeout(this.toastT),window.clearTimeout(this.settleT),window.clearTimeout(this.confirmT),this.venueT.forEach(i=>window.clearTimeout(i)),(e=this.revAbort)==null||e.abort(),(t=this.searchAbort)==null||t.abort(),this.venueMarkers.forEach(i=>i.remove()),(o=this.myMarker)==null||o.remove(),(r=this.map)==null||r.remove(),this.root.remove()}t(e){return this.opts.i18n.labels[e]}build(e){const t=this.opts,o=me(),r=(t.search.placeholder??this.t("searchPlaceholder")).replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">");this.root=w(`<div class="qp qp-app" dir="${o}"></div>`);const i='<div class="qp-pin" aria-hidden="true"><div class="qp-pin-body"><div class="qp-pin-head"><div class="qp-pin-hole"></div></div><div class="qp-pin-stem"></div><div class="qp-pin-foot"></div></div><div class="qp-pin-shadow"></div></div>';this.root.innerHTML=`
|
|
2
2
|
<div class="qp-layout">
|
|
3
3
|
<main class="qp-map-wrap"><div class="qp-map"></div>${i}
|
|
4
4
|
${t.controls.gps?`<button class="qp-gps" type="button" aria-label="${this.t("currentLocation")}">${v.locate}</button>`:""}
|
|
@@ -53,10 +53,11 @@ import { LocationPickerView } from '@amir83nasr/map';
|
|
|
53
53
|
onConfirm={(loc) => console.log(loc)}
|
|
54
54
|
/>;</pre></section>
|
|
55
55
|
<section><h3>ساختار پروژه</h3><ul class="qp-list">
|
|
56
|
-
<li><code dir="ltr">package/src/index.tsx</code> — API
|
|
57
|
-
<li><code dir="ltr">package/src/
|
|
58
|
-
<li><code dir="ltr">package/src
|
|
59
|
-
<li><code dir="ltr">package/src/
|
|
56
|
+
<li><code dir="ltr">package/src/index.tsx</code> — API عمومی (re-export از <code dir="ltr">react/ + core/</code>).</li>
|
|
57
|
+
<li><code dir="ltr">package/src/react/</code> — کامپوننت <code dir="ltr">LocationPickerView</code> + هلپر <code dir="ltr">setupQomPickWorker</code>.</li>
|
|
58
|
+
<li><code dir="ltr">package/src/engine/</code> — engine داخلی (<code dir="ltr">picker</code>، در exports عمومی نیست).</li>
|
|
59
|
+
<li><code dir="ltr">package/src/core/ + style/</code> — تایپها و helperها + استایل و basemap.</li>
|
|
60
|
+
<li><code dir="ltr">package/src/style/styles.css</code> — استایلها؛ خروجی build <code dir="ltr">dist/styles.css</code> است (ایمپورت: <code dir="ltr">@amir83nasr/map/styles.css</code>).</li>
|
|
60
61
|
<li><code dir="ltr">package/fonts/</code> — فونت IRANYekanX (woff2) و PBFهای glyph نقشه؛ داخل tarball منتشر میشود.</li>
|
|
61
62
|
<li><code dir="ltr">demo/</code> — دموی Vite؛ <code dir="ltr">docs/</code> — ARCHITECTURE و CHANGELOG.</li></ul></section>
|
|
62
63
|
<section><h3>سفارشیسازی ظاهر</h3><p>همه کلاسها و متغیرها با <code dir="ltr">qp-</code> شروع میشوند و با استایل پروژه تداخل نمیکنند. prop جداگانه theme نیست؛ رنگ و فونت را با متغیرهای CSS عوض کنید:</p>
|
package/dist/index.d.cts
ADDED
package/dist/index.d.ts
CHANGED
|
@@ -1,18 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export type
|
|
4
|
-
|
|
5
|
-
style?: React.CSSProperties;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* Set MapLibre's worker URL before mounting `LocationPickerView`.
|
|
9
|
-
* Worker files are bundler-specific — the package cannot ship them for you.
|
|
10
|
-
* Vite: `import url from 'maplibre-gl/dist/maplibre-gl-worker.mjs?worker&url'`.
|
|
11
|
-
* Next.js/webpack: copy both `maplibre-gl-worker.mjs` and `maplibre-gl-shared.mjs`.
|
|
12
|
-
*/
|
|
13
|
-
export declare function setupQomPickWorker(workerUrl: string): void;
|
|
14
|
-
/** Alias matching the package name; identical to `setupQomPickWorker`. */
|
|
15
|
-
export declare const setupMapWorker: typeof setupQomPickWorker;
|
|
16
|
-
export declare function LocationPickerView({ className, style, ...opts }: QomPickProps): React.JSX.Element;
|
|
17
|
-
export type * from './types.js';
|
|
18
|
-
export { QOM_SUGGESTIONS } from './defaults.js';
|
|
1
|
+
export { LocationPickerView, setupMapWorker, setupQomPickWorker, } from './react/LocationPickerView.js';
|
|
2
|
+
export type { QomPickProps } from './react/LocationPickerView.js';
|
|
3
|
+
export type * from './core/types.js';
|
|
4
|
+
export { QOM_SUGGESTIONS } from './core/defaults.js';
|
|
@@ -184,7 +184,7 @@ function ze(s, e = 40) {
|
|
|
184
184
|
}
|
|
185
185
|
return i.push(["slice", ["to-string", t], e]), ["format", ["concat", ...i], {}];
|
|
186
186
|
}
|
|
187
|
-
const b = ze(_e), k = ["IRANYekanX
|
|
187
|
+
const b = ze(_e), k = ["IRANYekanX"], O = ["IRANYekanX"], q = ["LineString", "MultiLineString"], $e = ["MultiPoint", "Point"];
|
|
188
188
|
function y(s) {
|
|
189
189
|
return ["interpolate", ["exponential", 1.2], ["zoom"], ...s];
|
|
190
190
|
}
|
|
@@ -1630,10 +1630,11 @@ import { LocationPickerView } from '@amir83nasr/map';
|
|
|
1630
1630
|
onConfirm={(loc) => console.log(loc)}
|
|
1631
1631
|
/>;</pre></section>
|
|
1632
1632
|
<section><h3>ساختار پروژه</h3><ul class="qp-list">
|
|
1633
|
-
<li><code dir="ltr">package/src/index.tsx</code> — API
|
|
1634
|
-
<li><code dir="ltr">package/src/
|
|
1635
|
-
<li><code dir="ltr">package/src
|
|
1636
|
-
<li><code dir="ltr">package/src/
|
|
1633
|
+
<li><code dir="ltr">package/src/index.tsx</code> — API عمومی (re-export از <code dir="ltr">react/ + core/</code>).</li>
|
|
1634
|
+
<li><code dir="ltr">package/src/react/</code> — کامپوننت <code dir="ltr">LocationPickerView</code> + هلپر <code dir="ltr">setupQomPickWorker</code>.</li>
|
|
1635
|
+
<li><code dir="ltr">package/src/engine/</code> — engine داخلی (<code dir="ltr">picker</code>، در exports عمومی نیست).</li>
|
|
1636
|
+
<li><code dir="ltr">package/src/core/ + style/</code> — تایپها و helperها + استایل و basemap.</li>
|
|
1637
|
+
<li><code dir="ltr">package/src/style/styles.css</code> — استایلها؛ خروجی build <code dir="ltr">dist/styles.css</code> است (ایمپورت: <code dir="ltr">@amir83nasr/map/styles.css</code>).</li>
|
|
1637
1638
|
<li><code dir="ltr">package/fonts/</code> — فونت IRANYekanX (woff2) و PBFهای glyph نقشه؛ داخل tarball منتشر میشود.</li>
|
|
1638
1639
|
<li><code dir="ltr">demo/</code> — دموی Vite؛ <code dir="ltr">docs/</code> — ARCHITECTURE و CHANGELOG.</li></ul></section>
|
|
1639
1640
|
<section><h3>سفارشیسازی ظاهر</h3><p>همه کلاسها و متغیرها با <code dir="ltr">qp-</code> شروع میشوند و با استایل پروژه تداخل نمیکنند. prop جداگانه theme نیست؛ رنگ و فونت را با متغیرهای CSS عوض کنید:</p>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { LocationPickerOptions } from '../core/types.js';
|
|
2
|
+
/** Public props: engine options minus `container` (React owns the element) + layout. */
|
|
3
|
+
export type QomPickProps = Omit<LocationPickerOptions, 'container'> & {
|
|
4
|
+
className?: string;
|
|
5
|
+
style?: React.CSSProperties;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Set MapLibre's worker URL before mounting `LocationPickerView`.
|
|
9
|
+
* Worker files are bundler-specific — the package cannot ship them for you.
|
|
10
|
+
* Vite: `import url from 'maplibre-gl/dist/maplibre-gl-worker.mjs?worker&url'`.
|
|
11
|
+
* Next.js/webpack: copy both `maplibre-gl-worker.mjs` and `maplibre-gl-shared.mjs`.
|
|
12
|
+
*/
|
|
13
|
+
export declare function setupQomPickWorker(workerUrl: string): void;
|
|
14
|
+
/** Alias matching the package name; identical to `setupQomPickWorker`. */
|
|
15
|
+
export declare const setupMapWorker: typeof setupQomPickWorker;
|
|
16
|
+
export declare function LocationPickerView({ className, style, ...opts }: QomPickProps): React.JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amir83nasr/map",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "React location picker on MapLibre (Persian RTL, mobile-first, vector tiles)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -18,21 +18,29 @@
|
|
|
18
18
|
],
|
|
19
19
|
"exports": {
|
|
20
20
|
".": {
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
"import": {
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
|
+
"default": "./dist/index.js"
|
|
24
|
+
},
|
|
25
|
+
"require": {
|
|
26
|
+
"types": "./dist/index.d.cts",
|
|
27
|
+
"default": "./dist/index.cjs"
|
|
28
|
+
}
|
|
24
29
|
},
|
|
25
|
-
"./styles.css": "./dist/
|
|
30
|
+
"./styles.css": "./dist/styles.css",
|
|
26
31
|
"./package.json": "./package.json"
|
|
27
32
|
},
|
|
28
|
-
"main": "./dist/
|
|
29
|
-
"module": "./dist/
|
|
33
|
+
"main": "./dist/index.cjs",
|
|
34
|
+
"module": "./dist/index.js",
|
|
30
35
|
"types": "./dist/index.d.ts",
|
|
31
|
-
"style": "./dist/
|
|
36
|
+
"style": "./dist/styles.css",
|
|
32
37
|
"files": [
|
|
33
38
|
"dist",
|
|
34
39
|
"fonts"
|
|
35
40
|
],
|
|
41
|
+
"engines": {
|
|
42
|
+
"node": ">=22"
|
|
43
|
+
},
|
|
36
44
|
"peerDependencies": {
|
|
37
45
|
"maplibre-gl": "^6.10.0",
|
|
38
46
|
"react": "^18 || ^19",
|
|
@@ -48,8 +56,8 @@
|
|
|
48
56
|
"vitest": "^2.1.0"
|
|
49
57
|
},
|
|
50
58
|
"scripts": {
|
|
51
|
-
"build": "vite build",
|
|
59
|
+
"build": "vite build && cp dist/index.d.ts dist/index.d.cts",
|
|
52
60
|
"typecheck": "tsc --noEmit",
|
|
53
61
|
"test": "vitest run"
|
|
54
62
|
}
|
|
55
|
-
}
|
|
63
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|