Tso Yandex daim ntawv qhia rau hauv lub vev xaib yog qhov haujlwm tau yooj yim heev uas ua rau cov neeg siv khoom muaj peev xwm zam dhau qhov kev xav tau los nrhiav txoj hauv kev rau lub koom haum tshaj tawm lawv tus kheej. Cov duab kos tuaj yeem muab tso tau yooj yim ob qho tib si rau kev siv loj thiab ntawm ib nplooj ntawv lag luam chaw ntawm nplooj ntawv.
Qhov zoo ntawm Yandex phaib yog tias koj tuaj yeem xaiv qhov kev xaiv muaj zog. Ntawd yog, nws yuav tsis yog daim duab uas khaws qhov taw tes (koomhaum) thiab ob peb txoj kev nyob ze, tab sis yog cov cuab yeej ua haujlwm uas tso cai rau koj kom rub thiab tsim txoj hauv kev. Qhov kev xaiv no yooj yim dua rau tus qhua qhov chaw thiab tam sim ntawd nce qhov feem pua ntawm kev xav zoo ntawm lub tuam txhab daim duab.
sau npe
Ua ntej muab tus tswv tsev xaib nrog "cuab yeej" daim ntawv qhia, Yandex nug kom sau npe. Cov txheej txheem no yooj yim thiab yuav siv sijhawm tsis tshaj ob peb feeb. Tom qab ntawv, siv koj lub npe thiab tus password, koj yuav tsum mus rau ntu "Kab Ntawv" (https://api.yandex.ru/maps/). Nplooj ntawv uas qhib yuav raug hu ua "Yandex. Maps API".
Txhawm rau ua haujlwm ntxiv, koj xav tau qhov tseem ceeb API. Txhawm rau nws, koj yuav tsum nyem kab ntawv "Get API Qhov Tseem Ceeb" nyob rau hauv qab kawg ntawm nplooj ntawv hauv kab "Rau Cov tsim kho". Tom qab ntawd, ib daim ntawv me me rau kev cuv npe ua haujlwm (qhov chaw) tshwm sim, tom qab sau daim ntawv uas thiab lees txais tus neeg siv daim ntawv cog lus (rau Yandex qhov credit, nws yuav tsum tau hais tias nws tsis loj thiab nyeem tau yooj yim), lub kaw lus tawm qhov cim tshwj xeeb, tseem hu ua API tus yuam sij.
Tsim thiab kho cov duab qhia ntawv
Ua ke nrog API tus cim, Yandex muab cov npaj tau tsim html code sau cov Yandex daim ntawv qhia rau hauv lub xaib hauv nws daim qauv (uas yog, nws tseem tsis tau muaj lub koom haum xav tau). Cov kev hloov tsim nyog tau ua nyob rau hauv "Daim Ntawv Qhia Tus Tsim Kho" tab. Hauv kab ntawv "Nrhiav chaw nyob rau hauv daim ntawv qhia" nkag mus rau qhov chaw nyob, tom qab ntawd nias lub pob "nrhiav". Daim duab qhia qhia txog lub tsev uas xav tau thiab pom lub qhov rais uas koj tuaj yeem ntxiv txhua cov ntaub ntawv tsim nyog (piv txwv li, "peb lub chaw haujlwm nyob rau theem peb").
Tom qab qhia meej txog cov ciaj ciam ntawm lub tsev ncaj ncees raws li qhov chaw nyob xav tau los ntawm tus neeg siv khoom, thiab nias "OK", koj tuaj yeem xaiv qhov nplai ntawm daim duab qhia thiab nws hom (zoo li qub lossis sib cuam tshuam). Ntawm lwm yam, lub interface tso cai rau koj ntxiv lwm cov khoom rau tib daim ntawv qhia, taw qhia daim ntawv qhia txoj kev, thiab lwm yam. Raws li qhov tshwm sim, Yandex muab ib qho kev cai tshiab ntawm html-code, thaum tso ntxig ntawm uas daim ntawv qhia tshiab tsim nyob rau ntawm qhov chaw.
Daim duab qhia tuaj yeem tso rau hauv txhua qhov chaw ua haujlwm yooj yim. Qee lub sij hawm qhov no tau ua nyob rau hauv qhov chaw cov blocks rau kev tshaj tawm, uas tseem feem ntau tso rau qhov tseeb los ntawm txoj kev ntawm html-code. Rau cov tsim muaj kev paub dhau los, qhov no yuav tsis yooj yim, thiab cov pib tshiab tuaj yeem siv cov qauv tsim hauv lub vev xaib uas muaj cov khoom tshwj xeeb rau ntxig cov html khoom.