当draw:editvertex
事件触发时,如何获取有关触发它的多边形的信息?
this.map.on('draw:editvertex', function (e) { debugger;
var layers = e.layers;
// I want to get current polygon latLng here
}.bind(this));
Run Code Online (Sandbox Code Playgroud) 我在我的网站上有一个注册表单,我在其中保存字段,当用户再次返回到该注册表单时保存表单后,我希望以前的字段值保存在浏览器自动填充中.下面是我的代码片段 -
<form class="clearfix">
<input autocomplete="given-name" name="firstName" type="text" placeholder="Enter First Name" class="form-control" value="">
<input autocomplete="family-name" name="lastName" type="text" placeholder="Enter Last Name" class="form-control" value="">
<input autocomplete="email" name="email" type="text" placeholder="Enter Email" class="form-control" value="">
<input autocomplete="tel" name="phoneNumber" type="text" placeholder="Enter Number" class="form-control contactMask" value="">
<input autocomplete="address-line1" name="addressLine1" type="text" placeholder="Street 1" class="form-control">
<input autocomplete="address-line2" name="addressLine2" type="text" placeholder="Street 2" class="form-control" value="">
<a href="javascript:void(0);" className="btn baseBtn primeBtn" onClick={this.signupUser}>Sign Up</a>
</form>
Run Code Online (Sandbox Code Playgroud)
在这个代码onClick of anchor tag我正在通过注册用户函数进行ajax调用.之后,我希望用户数据在Chrome浏览器自动填充地址中自动填充.
我试过以下方法: -
1.很少有人建议使用表单"提交"按钮功能来保存自动填充中的数据,而不是使用ajax调用表单锚标签onClick事件.但这也不适用于我的情况.
我已经通过了几个帖子,他们告诉我们使用正确的名称和字段的自动完成属性.但通过使用该浏览器只能猜出正确的字段值.
我正在发送从服务器下载 zip 文件夹的请求,这将在响应下方发送给我 - (以字节为单位的 Zip 文件夹)
PK?s?H test.txt~???T*-N-R?R*I-.Q???PK?/[?PK?s?Htest.txt???T*-N- R?R*I-.Q???PK?/[?PK?s?H?/[? test.txt~PK?s?H?/[?Ltest.txtPKm?
Run Code Online (Sandbox Code Playgroud)
在反应中,我写了下面的函数来下载 zip 文件夹。我在提取 zip 文件夹时出错。
downloadUtmFile: function() {
function download(text, name, type) {
var a = document.createElement("a");
var file = new Blob([text], {type: type});
a.href = URL.createObjectURL(file);
a.download = name;
a.click();
}
DashboardStore.downloadFile(API_ENDPOINT.utmFileDownload).then(function(result) {
download(result,'', 'application/zip');
}.bind(this), function(error) {
this.setState({
message: error
});
}.bind(this));
},
Run Code Online (Sandbox Code Playgroud)
我正在使用 Blob 并将其类型作为“应用程序/zip”传递。在提取 zip 文件夹时,它抛出了我的错误。
我的网络应用程序中有 PDF 下载功能。它适用于所有浏览器和 iOS11,但不适用于移动或 iod pro 上的 safari 浏览器和 ios12。我收到以下错误 - WebKitBlobResource 错误 1
export const downloadPDF = (downloadLink, fileName, trackId, productId, historyId) => {
return (dispatch) => {
return request.doGetAuth(downloadLink).then(response => {
let contentType = response.headers.get('content-type');
if (_.includes(contentType, 'application/json')) {
return response.json();
} else {
return response.blob();
}
}).then(blobby => {
if (!blobby.message) {
const blob = new Blob([blobby], {
type: 'application/pdf'
});
if (isIos()) {
if (!isCriOs()) {
// For ios
let url = window.URL.createObjectURL(blob);
dispatch(downloadReadyAction(url, fileName));
} …
Run Code Online (Sandbox Code Playgroud) 下面是一个数组,我必须在每个对象中分组3个值
var xyz = {"name": ["hi","hello","when","test","then","that","now"]};
Run Code Online (Sandbox Code Playgroud)
输出应低于数组 -
["hi","hello","when"]["test","then","that"]["now"]
Run Code Online (Sandbox Code Playgroud) 我正在尝试以 hh:mm:ss 格式转换秒。我使用下面的代码将秒转换为小时,分钟。但我不想做这一切。是否可以在 moment.js 中将秒转换为 HH:MM:SS 格式。而不是手动完成。
var x = 43000
var durationValue = moment.duration(x, 'milliseconds');
var hours = Math.floor(durationValue.asHours());
var mins = Math.floor(durationValue.asMinutes()) - hours * 60;
console.log("hours:" + hours + " mins:" + mins);
Run Code Online (Sandbox Code Playgroud) javascript ×6
jquery ×3
reactjs ×3
leaflet ×2
mapbox ×2
autocomplete ×1
autofill ×1
blob ×1
geojson ×1
ios12 ×1
leaflet.draw ×1
momentjs ×1
react-redux ×1
zip ×1