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
- 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 componentonchange
Action, 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!
-------------------- Get the latest information YIDA, welcome to follow US--------------------