简体   繁体   中英

How can I get latitude & longitude by using address from google geocode API in Configure.IT API flow

How can I get latitude & longitude values by using address from below geocode API inside Configure.IT API flow.

https://maps.googleapis.com/maps/api/geocode/json?address=XXXXX&key=XXXXX

In below flow chart, before insert customer data I need to fetch lat & lng values and store those values into customer table.

在此输入图像描述

ConfigureIT provides API Connector block for connecting to external datasources and fetching data. You need to insert API Connector block before INSERT_CUSTOMER_DATA block.

Follow the steps and example screenshots given below :-

1) Add an input parameter for supplying address.

在此输入图像描述

2) Save your changes and in next step double-click API Connector block, to add in to your API configuration flow chart.

在此输入图像描述

3) In API Connector block configuration dialog, select Custom for API Type

在此输入图像描述

4) And then enter " https://maps.googleapis.com/maps/api/geocode/json " in API URL field and in input parameters section add and input parameter, address and link it to API input Parameter(we added in step 1) address and then click Save & Next to proceed to next step.

在此输入图像描述

5) Now you need to set up API output. Enter test input and then for getting whole result from google api in result select Current Format and for specific part of the response, select Specific Result

在此输入图像描述

6) Save all your API changes and then Execute to check the result

在此输入图像描述

Hope this helps..

https://maps.googleapis.com/maps/api/geocode/json?address= &key= You have to pass your Google service API key to above URL then you will get
the result in json format as:

{
   "results" : [
      {
         "address_components" : [
            {
               "long_name" : "Mumbai",
               "short_name" : "Mumbai",
               "types" : [ "locality", "political" ]
            },
            {
               "long_name" : "Maharashtra",
               "short_name" : "MH",
               "types" : [ "administrative_area_level_1", "political" ]
            },
            {
               "long_name" : "India",
               "short_name" : "IN",
               "types" : [ "country", "political" ]
            },
            {
               "long_name" : "400093",
               "short_name" : "400093",
               "types" : [ "postal_code" ]
            }
         ],
         "formatted_address" : "Udyog Sarathi, Mahakali Caves Road, Marol Industrial Area, Andheri East, Mumbai, Maharashtra 400093, India",
         "geometry" : {
            "location" : {
               "lat" : 19.1254233,
               "lng" : 72.8665118
            },
            "location_type" : "GEOMETRIC_CENTER",
            "viewport" : {
               "northeast" : {
                  "lat" : 19.1267722802915,
                  "lng" : 72.86786078029151
               },
               "southwest" : {
                  "lat" : 19.1240743197085,
                  "lng" : 72.8651628197085
               }
            }
         },
         "place_id" : "ChIJ02N9eyPI5zsRMEB_9ivO_B0",
         "types" : [ "establishment", "point_of_interest" ]
      }
   ],
   "status" : "OK"
}

The geometry contains location as lat lon format.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM