Tag:Baidu Maps
-
Time:2020-12-9
1. HTML5 gets the current geographic location HTML5 geolocation API (geographic location application program interface) can obtain the current geographic location. The mobile phone uses GPS, and the computer locates according to the network Check whether the browser supports the HTML5 geolocation API <script type=”text/javascript”> if(navigator.geolocation){ Browser (‘geoalert ‘); }else{ Alert (‘the browser does not […]
-
Time:2020-1-13
Question 1:Baidu map applies tile image (the map is made up of pictures). When html2canvas processes pictures under different domain names, the browser will display cross domain error reports and cannot use reverse proxy to solve them. Because the domain name of tile image is uncertain, proxy ﹐ pass cannot be specified Solution: use Baidu […]
-
Time:2019-10-25
Baidu map needs to be used in development, and Baidu map needs two keys:releaseanddebug, you need to use theSHA1Apply on the development platform of Baidu map (http://lbsyun.baidu.com/apiconsole/key).Get signing certificateSHA1The way:CD to.androidDirectory: keytool -list -v -keystore debug.keystore The same wayreleaseSHA1 of the signing certificate.Now we have two Baidu map keys:release-keyanddebug-keyIn general, it is necessary toAndroidManifestThe key […]
-
Time:2019-8-8
I used in micro-mail, custom menu, menu directly linked to this HTML5 page, get the current location, the page to determine the destination, so open the page and go directly to the navigation page. It can save one step by sending location information first, determining the point and then navigating. <!DOCTYPE html> <html lang=”zh-cmn-Hans”> <meta […]
-
Time:2019-5-14
Webpack + Baidu map Create script tags for loading export function MP(ak){ return new Promise(function (resolve, reject){ window.onload = function () { resolve(BMap) } var script = document.createElement(“script”); script.type = “text/javascript”; script.src = “http://api.map.baidu.com/api?v=2.0&ak=”+ak+”&callback=init”; script.onerror = reject; document.head.appendChild(script); }); } Use: import {MP} from ‘./map.js’; MP(“your ak”).then(BMap => { // do something }) Webpack + […]
-
Time:2019-3-8
According to the official explanation of Baidu Map, the following four events can be monitored on the mobile H5 page: touchstart, touchmove, touchend, longpress If the click event is monitored on the map, the code in the event will not be executed on the mobile side. When I did a requirement before, I listened to […]