JavaScript API V2可用于在网站中加入交互性强的街景、地图,能很好地支持PC及手机设备,身材小巧,动画效果顺滑流畅,动感十足,提供地图操作、标注、地点搜索、出行规划、地址解析、街景等接口,功能丰富,并免费开放各种附加工具库。JavaScript API V2是免费服务,任何提供免费访问的网站都可以调用,请参见使用条款。
//创建Marker覆盖物 createMarker (map, lat, lng, callback, txt = "塞纳春天大家好") { //http://lbs.qq.com/javascript_v2/doc/markeroptions.html 定义覆盖物图片 //http://lbs.qq.com/javascript_v2/doc/markerimage.html let center = new qq.maps.LatLng(lat, lng) let anchor = new qq.maps.Point(0, 58/4), size = new qq.maps.Size(52, 58), origin = new qq.maps.Point(0, 0), scaleSize = new qq.maps.Size(52/2, 58/2) let markerIcon = new qq.maps.MarkerImage( "//wq.360buyimg.com/fd/h5/wx/home_v2/images/homev2_map_icon_b00aa33e.png", size, origin, anchor, scaleSize )
let marker = new qq.maps.Marker({ position: center, //animation:qq.maps.MarkerAnimation.DROP, 动画类型,需设置阴影,如果没则出现关闭叉 map: map })
this.createMarkerLable(map, lat, lng, txt, function(){ callback && callback() }) }
//创建标签,通过样式控制居中 createMarkerLable (map, lat, lng, txt, callback) { //http://lbs.qq.com/javascript_v2/doc/label.html //http://lbs.qq.com/javascript_v2/doc/labeloptions.html文字设置 let center = new qq.maps.LatLng(lat, lng)
input.addEventListener("change", function(){ var file = this.files[0];
// 接受 jpeg, jpg, png 类型的图片 // if (!/\/(?:jpeg|jpg|png)/i.test(file.type)) return;
var reader = new FileReader(); var compressCanvas = document.querySelector(".babyhappy_compressimg_con"); compressCtx = compressCanvas.getContext("2d");
reader.onload = function(event) { var result = this.result; var image = new Image(); image.src = reader.result;
Note that accepting HTTP/2 connections over TLS requires the “Application-Layer Protocol Negotiation” (ALPN) TLS extension support, which is available only since OpenSSL version 1.0.2. Using the “Next Protocol Negotiation” (NPN) TLS extension for this purpose (available since OpenSSL version 1.0.1) is not guaranteed.