src/main/webapp/resources/js/bootstrap.AMapPositionPicker.js
(开头部分) 26KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
/**
* BootstrapAMapPositionPicker v0.8.3
* @author: Kinegratii
*/
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
define(['jquery', 'AMap'], factory);
} else if (typeof exports === 'object') {
module.exports = factory(require('jquery'), require('AMap'));
} else {
if (typeof jQuery === 'undefined') {
throw 'AMapPositionPicker requires jQuery to be loaded first';
}
if (typeof AMap == 'undefined') {
throw 'AMapPositionPicker requires AMap to be loaded first';
}
factory(jQuery, AMap);
}
}(function ($, AMap) {
// Global tool functions
String.prototype.format = function (data) {
var result = this;
for (var key in data) {
if (data[key] != undefined) {
var reg = new RegExp("({" + key + "})", "g");
result = result.replace(reg, data[key]);
}
}
return result;
};
if (typeof String.prototype.startsWith != 'function') {
String.prototype.startsWith = function (prefix) {
return this.slice(0, prefix.length) === prefix;
};
}
function wrapFormat(formatter, data) {
if (typeof formatter == 'function') {
return formatter(data);
} else if (typeof formatter == 'string') {
return formatter.format(data);
} else {
return '';
}
}
// Data Structure Start
var Position = (function () {
function Position(longitude, latitude, address, label) {
this.longitude = longitude;
this.latitude = latitude;
this.address = address || '';
this.label = label || '';
}
Position.prototype.isValid = function () {
return this.longitude != undefined && this.longitude != null && this.latitude != undefined && this.latitude != null;
};
Position.prototype.copy = function (data) {
后面还有 647 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
