Skip to main content

Locate the component to obtain latitude and longitude

1. Use background

If the positioning component needs to obtain the longitude and latitude in the current location information for subsequent calculation, you can refer to this document for configuration to obtain all data, longitude and latitude.

2. Procedure

2.1 Step 1: form page design

  1. Create a form page and drag and drop the positioning component, multi-line text component, and two single-line text components.

Page design

2.2 Step 2: Locate the binding action of the component

Bind to the advanced properties of the positioning componentonchangeAction, and write the data code in the JS panel.

Locate component binding actions

Component unique identifier corresponding location


The following code can be directly copied in the JS panel,Note: You need to change the unique identifier of the component to the identifier of the component on the page.

export function onChange({ value }) {
console.log('onChange', value);
this.$("textareaField_kspgdcvk").setValue(JSON.stringify(value))
this.$("textField_kspgdcvl").setValue(value.longitude)
this.$("textField_kspgdcvn").setValue(value.latitude)
}

3. Effect demonstration

Effect demonstration

YIDA in order to better optimize the content and quality of YIDA user manual, it takes you 3-5 minutes to fill in the document feedback questionnaire. The document feedback questionnaire is submitted anonymously, and the questionnaire information is only used for YIDA document experience feedback collection. Thank you for your support for YIDA!

Click this link to fill in the questionnaire

-------------------- Get the latest information YIDA, welcome to follow US--------------------

This doc is generated using machine translation. Any discrepancies or differences created in the translation are not binding and have no legal effect for compliance or enforcement purposes.
Copyright © 2024钉钉(中国)信息技术有限公司和/或其关联公司浙ICP备18037475号-4