Home > Article > Web Front-end > (JS implementation) Script for encryption and decryption of coordinates in MapBar_javascript skills
Because a friend asked about this question, I looked it up and posted it today to see if it is correct.
However, I personally think that Mapbar’s method of processing is worth learning, at least it won’t give you explicit coordinates.
I don’t know if my Mapbar friends will tell me about it after reading it, haha, but it doesn’t matter. I recently wanted to write an article to give you some personal suggestions. I think it doesn’t matter if it’s not good. I'll write it after I've been busy for a while.
The following is the JS for the encryption and decryption parts in Mapbar. I gave a brief explanation. What are the 36-digit and 16-digit numbers? It made me dizzy.
The result of the example is as follows:
The decrypted value of IJSDSBWVJABFA: 121.46979, 31.23245
31.23245, 121.46979 The encrypted value: IJSDSBZVJABFA
Of course you can also use other coordinates to test and verify.
Friendly reminder: The constant value in Mapbar may have changed, and the value solved by the current method is different from Baidu's value.
Copy the code below and save it as a web page to see the effect.
Encryption and decryption (JS) in Mapbar