Skip to content

Enable support language customization

Compare
Choose a tag to compare
@aashari aashari released this 13 Mar 11:02
· 12 commits to main since this release
5d1e880

Default (en):

geocoding.encode("jalan merdeka utara no.3 jakarta").then(result => {
    console.log(result);
    /*[
        {
            formatted_address: 'Jalan Medan Merdeka Utara No.3, RT.3/RW.2, Gambir, Central Jakarta City, Jakarta',
            latitude: -6.1715111,
            longitude: 106.8269598
        },
        {
            formatted_address: 'Jalan Medan Merdeka Utara, RT.3/RW.2, Gambir, Central Jakarta City, Jakarta',
            latitude: -6.1715111,
            longitude: 106.8269598
        }
    ]*/
});

Customized (id):

geocoding.encode("jalan merdeka utara no.3 jakarta", "id").then(result => {
    console.log(result);
    /*[
        {
            latitude: -6.175308299999999,
            longitude: 106.8281502,
            formatted_address: 'Jalan Medan Merdeka Utara No.3, RT.3/RW.2, Gambir, Kota Jakarta Pusat, Jakarta'
        },
        {
            latitude: -6.1714815,
            longitude: 106.8269598,
            formatted_address: 'Jalan Medan Merdeka Utara, RT.3/RW.2, Gambir, Kota Jakarta Pusat, Jakarta'
        }
    ]*/
});