Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue3-google-map

Package Overview
Dependencies
Maintainers
2
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue3-google-map - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

693

dist/cjs/index.js

@@ -1,8 +0,3 @@

'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var vue = require('vue');
/*! *****************************************************************************
/*
*****************************************************************************
Copyright (c) Microsoft Corporation.

@@ -20,663 +15,23 @@

PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
function __rest(s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
}
/**
* Provides a logical test to see if the passed in event is a LambdaProxy request or just a
* straight JS object response. This is useful when you have both an HTTP event and a Lambda-to-Lambda
* or Step-Function-to-Lambda interaction.
*
* @param message the body of the request (which is either of type T or a LambdaProxy event)
*/
/** provides a friendly way to pause execution when using async/await symantics */
async function wait(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
var HttpStatusCodes;
(function (HttpStatusCodes) {
/**
* The client SHOULD continue with its request. This interim response is used to inform
* the client that the initial part of the request has been received and has not yet
* been rejected by the server. The client SHOULD continue by sending the remainder
* of the request or, if the request has already been completed, ignore this response.
* The server MUST send a final response after the request has been completed.
*/
HttpStatusCodes[HttpStatusCodes["Continue"] = 100] = "Continue";
/** The request has succeeded. */
HttpStatusCodes[HttpStatusCodes["Success"] = 200] = "Success";
/**
* The request has been fulfilled and resulted in a new resource being created. The newly
* created resource can be referenced by the URI(s) returned in the entity of the response,
* with the most specific URI for the resource given by a Location header field. The response
* SHOULD include an entity containing a list of resource characteristics and location(s) from
* which the user or user agent can choose the one most appropriate. The entity format is
* specified by the media type given in the Content-Type header field. The origin server MUST
* create the resource before returning the `201` status code. If the action cannot be carried
* out immediately, the server SHOULD respond with `202` (Accepted) response instead.
*
* A `201` response MAY contain an ETag response header field indicating the current value of
* the entity tag for the requested variant just created.
*/
HttpStatusCodes[HttpStatusCodes["Created"] = 201] = "Created";
/**
* The request has been accepted for processing, but the processing has not been completed.
* The request might or might not eventually be acted upon, as it might be disallowed when
* processing actually takes place. There is no facility for re-sending a status code from an
* asynchronous operation such as this.
*
* The 202 response is intentionally non-committal. Its purpose is to allow a server to accept
* a request for some other process (perhaps a batch-oriented process that is only run once
* per day) without requiring that the user agent's connection to the server persist until the
* process is completed. The entity returned with this response SHOULD include an indication
* of the request's current status and either a pointer to a status monitor or some estimate
* of when the user can expect the request to be fulfilled.
*/
HttpStatusCodes[HttpStatusCodes["Accepted"] = 202] = "Accepted";
/**
* The server has fulfilled the request but does not need to return an entity-body, and might
* want to return updated meta-information. The response MAY include new or updated
* meta-information in the form of entity-headers, which if present SHOULD be associated with
* the requested variant.
*
* If the client is a _user agent_, it **SHOULD NOT** change its document view from that which
* caused the request to be sent. This response is primarily intended to allow input for
* actions to take place without causing a change to the user agent's active document view,
* although any new or updated metainformation **SHOULD** be applied to the document
* currently in the user agent's active view.
*
* The `204` response **MUST NOT** include a `message-body`, and thus is always terminated
* by the first empty line after the header fields.
*/
HttpStatusCodes[HttpStatusCodes["NoContent"] = 204] = "NoContent";
HttpStatusCodes[HttpStatusCodes["MovedPermenantly"] = 301] = "MovedPermenantly";
HttpStatusCodes[HttpStatusCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
/**
* If the client has performed a conditional GET request and access is allowed, but the
* document has not been modified, the server SHOULD respond with this status code. The
* `304` response MUST NOT contain a _message-body_, and thus is always terminated by the
* first empty line after the header fields.
*/
HttpStatusCodes[HttpStatusCodes["NotModified"] = 304] = "NotModified";
/**
* The request could not be understood by the server due to malformed syntax.
* The client SHOULD NOT repeat the request without modifications.
*/
HttpStatusCodes[HttpStatusCodes["BadRequest"] = 400] = "BadRequest";
/**
* The request requires user authentication. The response MUST include a WWW-Authenticate
* header field containing a challenge applicable to the requested resource.
* The client MAY repeat the request with a suitable Authorization header field. If the
* request already included Authorization credentials, then the `401`
* response indicates that authorization has been refused for those credentials. If the `401`
* response contains the same challenge as the prior response, and the user agent has already
* attempted authentication at least once, then the user SHOULD be presented the entity that
* was given in the response, since that entity might include relevant diagnostic information.
*/
HttpStatusCodes[HttpStatusCodes["Unauthorized"] = 401] = "Unauthorized";
HttpStatusCodes[HttpStatusCodes["PaymentRequired"] = 402] = "PaymentRequired";
/**
* The request could not be understood by the server due to malformed syntax. The client
* SHOULD NOT repeat the request without modifications.
*/
HttpStatusCodes[HttpStatusCodes["Forbidden"] = 403] = "Forbidden";
/**
* The server has not found anything matching the Request-URI. No indication is given of
* whether the condition is temporary or permanent. The `410` (Gone) status code SHOULD be
* used if the server knows, through some internally configurable mechanism, that an old
* resource is permanently unavailable and has no forwarding address.
*
* This status code is commonly used when the server does not wish to reveal exactly
* why the request has been refused, or when no other response is applicable.
*/
HttpStatusCodes[HttpStatusCodes["NotFound"] = 404] = "NotFound";
/**
* The method specified in the Request-Line is not allowed for the resource identified
* by the Request-URI. The response MUST include an Allow header containing a list of
* valid methods for the requested resource.
*/
HttpStatusCodes[HttpStatusCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
/**
* The client did not produce a request within the time that the server was
* prepared to wait. The client MAY repeat the request without modifications
* at any later time.
*/
HttpStatusCodes[HttpStatusCodes["RequestTimeout"] = 408] = "RequestTimeout";
/**
* The request could not be completed due to a conflict with the current state of the
* resource. This code is only allowed in situations where it is expected that the
* user might be able to resolve the conflict and resubmit the request. The response
* body SHOULD include enough information for the user to recognize the source of the
* conflict. Ideally, the response entity would include enough information for the
* user or user agent to fix the problem; however, that might not be possible and
* is not required.
*
* Conflicts are most likely to occur in response to a PUT request. For example,
* if versioning were being used and the entity being PUT included changes to a resource
* which conflict with those made by an earlier (third-party) request, the server might
* use the 409 response to indicate that it can't complete the request. In this case,
* the response entity would likely contain a list of the differences between the
* two versions in a format defined by the response Content-Type.
*/
HttpStatusCodes[HttpStatusCodes["Conflict"] = 409] = "Conflict";
/**
* The requested resource is no longer available at the server and no forwarding address
* is known. This condition is expected to be considered permanent. Clients with link
* editing capabilities SHOULD delete references to the Request-URI after user approval.
* If the server does not know, or has no facility to determine, whether or not the
* condition is permanent, the status code 404 (Not Found) SHOULD be used instead.
* This response is cacheable unless indicated otherwise.
*
* The 410 response is primarily intended to assist the task of web maintenance by
* notifying the recipient that the resource is intentionally unavailable and that
* the server owners desire that remote links to that resource be removed. Such an
* event is common for limited-time, promotional services and for resources belonging
* to individuals no longer working at the server's site. It is not necessary to mark
* all permanently unavailable resources as "gone" or to keep the mark for any length
* of time -- that is left to the discretion of the server owner.
*/
HttpStatusCodes[HttpStatusCodes["Gone"] = 410] = "Gone";
/**
* Indicates that the server refuses to brew coffee because it is, permanently, a teapot.
* A combined coffee/tea pot that is temporarily out of coffee should instead return 503.
* This error is a reference to Hyper Text Coffee Pot Control Protocol defined in April
* Fools' jokes in 1998 and 2014.
*/
HttpStatusCodes[HttpStatusCodes["IAmATeapot"] = 418] = "IAmATeapot";
HttpStatusCodes[HttpStatusCodes["UnprocessableEntity"] = 422] = "UnprocessableEntity";
/**
* The 429 status code indicates that the user has sent too many requests in a given
* amount of time ("rate limiting").
*/
HttpStatusCodes[HttpStatusCodes["TooManyRequests"] = 429] = "TooManyRequests";
/**
* The server encountered an unexpected condition which prevented it from fulfilling
* the request.
*/
HttpStatusCodes[HttpStatusCodes["InternalServerError"] = 500] = "InternalServerError";
/**
* The server does not support the functionality required to fulfill the request. This
* is the appropriate response when the server does not recognize the request method
* and is not capable of supporting it for any resource.
*/
HttpStatusCodes[HttpStatusCodes["NotImplemented"] = 501] = "NotImplemented";
/**
* The server, while acting as a gateway or proxy, received an invalid response from
* the upstream server it accessed in attempting to fulfill the request.
*/
HttpStatusCodes[HttpStatusCodes["BadGateway"] = 502] = "BadGateway";
/**
* Indicates that the server is not ready to handle the request.
*
* Common causes are a server that is down for maintenance or that is overloaded.
* This response should be used for temporary conditions and the `Retry-After` HTTP
* header should, if possible, contain the estimated time for the recovery of the
* service.
*/
HttpStatusCodes[HttpStatusCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
HttpStatusCodes[HttpStatusCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
/**
* The 511 status code indicates that the client needs to authenticate to gain
* network access.
*
* The response representation SHOULD contain a link to a resource that allows
* the user to submit credentials (e.g. with a HTML form).
*
* Note that the 511 response SHOULD NOT contain a challenge or the login interface
* itself, because browsers would show the login interface as being associated with
* the originally requested URL, which may cause confusion.
*/
HttpStatusCodes[HttpStatusCodes["AuthenticationRequired"] = 511] = "AuthenticationRequired";
})(HttpStatusCodes || (HttpStatusCodes = {}));
// polyfill Array.isArray if necessary
if (!Array.isArray) {
Array.isArray = function (arg) {
return Object.prototype.toString.call(arg) === "[object Array]";
};
}
const BASE_URL = "https://maps.googleapis.com/maps/api/js";
async function loadNow(library, apiKey) {
if (checkIfScriptTagExists(library)) {
return window.google;
}
await addScriptTagToBrowser(library, apiKey);
return window.google;
}
async function addScriptTagToBrowser(library, apiKey, options = {}) {
if (checkIfScriptTagExists(library)) {
console.info(`Attempt to add script tag for the "${library}" library in Google Maps ignored as this tag already exists in the DOM${apiKey ? " [ " + apiKey + "]" : ""}`);
return;
}
const timeout = async (howLong = 2000) => {
await wait(howLong);
throw new Error(`Timed out waiting for Google API to load [ ${library} / ${howLong} ]`);
};
const waitForLoad = () => {
var script = document.createElement("script");
script.id = `google-maps-${library}-js`;
script.src = getUrl(library, apiKey);
document.querySelector("head").appendChild(script);
return new Promise(resolve => {
window[`${library}LoaderCallback`] = () => {
resolve();
};
});
};
return Promise.race(options.timeout ? [timeout(options.timeout), waitForLoad()] : [waitForLoad()]);
}
function getUrl(library, apiKey, callback = true) {
let url = `${BASE_URL}?libraries=${library}&sensors=false`;
if (apiKey) {
url = `${url}&key=${apiKey}`;
}
if (callback) {
url = `${url}&callback=${library}LoaderCallback`;
}
return url;
}
function checkIfScriptTagExists(library, apiKey) {
const found = document.querySelector(`#google-maps-${library}-js`);
return Boolean(found);
}
const map = vue.ref(null);
const api = vue.ref(null);
const useMap = () => {
return { map, api };
};
const useSetupMapComponent = (componentName, events, options, emit) => {
let _component = null;
const component = vue.ref(null);
const { map, api } = useMap();
vue.watch([map, options], (_, __, onInvalidate) => {
if (map.value && api.value) {
component.value = _component = new api.value[componentName](Object.assign(Object.assign({}, options.value), { map: map.value }));
events.forEach(event => {
_component === null || _component === void 0 ? void 0 : _component.addListener(event, () => emit(event));
});
}
onInvalidate(() => {
var _a;
if (_component) {
(_a = api.value) === null || _a === void 0 ? void 0 : _a.event.clearInstanceListeners(_component);
_component.setMap(null);
}
});
});
return { component };
};
const mapEvents = [
'bounds_changed',
'center_changed',
'click',
'dblclick',
'drag',
'dragend',
'dragstart',
'heading_changed',
'idle',
'maptypeid_changed',
'mousemove',
'mouseout',
'mouseover',
'projection_changed',
'resize',
'rightclick',
'tilesloaded',
'tilt_changed',
'zoom_changed',
];
const markerEvents = [
'animation_changed',
'click',
'dblclick',
'rightclick',
'dragstart',
'dragend',
'drag',
'mouseover',
'mousedown',
'mouseup',
'draggable_changed',
'clickable_changed',
'cursor_changed',
'flat_changed',
'rightclick',
'zindex_changed',
'icon_changed',
'position_changed',
'shape_changed',
'title_changed',
'visible_changed',
];
const polylineEvents = [
'click',
'dblclick',
'drag',
'dragend',
'dragstart',
'mousedown',
'mousemove',
'mouseout',
'mouseover',
'mouseup',
'rightclick',
];
const polygonEvents = polylineEvents;
const rectangleEvents = polylineEvents.concat(['bounds_changed']);
const circleEvents = polylineEvents.concat(['center_changed', 'radius_changed']);
var script = vue.defineComponent({
props: {
apiKey: String,
backgroundColor: String,
center: Object,
clickableIcons: { type: Boolean, default: undefined },
controlSize: Number,
disableDefaultUi: { type: Boolean, default: undefined },
disableDoubleClickZoom: { type: Boolean, default: undefined },
draggable: { type: Boolean, default: undefined },
draggableCursor: String,
draggingCursor: String,
fullscreenControl: { type: Boolean, default: undefined },
fullscreenControlPosition: String,
gestureHandling: String,
heading: Number,
keyboardShortcuts: { type: Boolean, default: undefined },
mapTypeControl: { type: Boolean, default: undefined },
mapTypeControlOptions: Object,
mapTypeId: {
type: [Number, String],
},
maxZoom: Number,
minZoom: Number,
noClear: { type: Boolean, default: undefined },
panControl: { type: Boolean, default: undefined },
panControlPosition: String,
restriction: Object,
rotateControl: { type: Boolean, default: undefined },
rotateControlPosition: String,
scaleControl: { type: Boolean, default: undefined },
scaleControlStyle: Number,
scrollwheel: { type: Boolean, default: undefined },
streetView: Object,
streetViewControl: { type: Boolean, default: undefined },
streetViewControlPosition: String,
styles: Array,
tilt: Number,
zoom: Number,
zoomControl: { type: Boolean, default: undefined },
zoomControlPosition: String,
},
setup(props, { emit }) {
const mapRef = vue.ref(null);
const ready = vue.ref(false);
const { map, api } = useMap();
const resolveOptions = () => {
var _a, _b, _c, _d, _e;
const opts = {
backgroundColor: props.backgroundColor,
center: props.center,
clickableIcons: props.clickableIcons,
controlSize: props.controlSize,
disableDefaultUI: props.disableDefaultUi,
disableDoubleClickZoom: props.disableDoubleClickZoom,
draggable: props.draggable,
draggableCursor: props.draggableCursor,
draggingCursor: props.draggingCursor,
fullscreenControl: props.fullscreenControl,
fullscreenControlOptions: props.fullscreenControlPosition
? {
position: (_a = api.value) === null || _a === void 0 ? void 0 : _a.ControlPosition[props.fullscreenControlPosition],
}
: {},
gestureHandling: props.gestureHandling,
heading: props.heading,
keyboardShortcuts: props.keyboardShortcuts,
mapTypeControl: props.mapTypeControl,
mapTypeControlOptions: props.mapTypeControlOptions,
mapTypeId: props.mapTypeId,
maxZoom: props.maxZoom,
minZoom: props.minZoom,
noClear: props.noClear,
panControl: props.panControl,
panControlOptions: props.panControlPosition
? {
position: (_b = api.value) === null || _b === void 0 ? void 0 : _b.ControlPosition[props.panControlPosition],
}
: {},
restriction: props.restriction,
rotateControl: props.rotateControl,
rotateControlOptions: props.rotateControlPosition
? {
position: (_c = api.value) === null || _c === void 0 ? void 0 : _c.ControlPosition[props.rotateControlPosition],
}
: {},
scaleControl: props.scaleControl,
scaleControlOptions: props.scaleControlStyle
? {
style: props.scaleControlStyle,
}
: {},
scrollwheel: props.scrollwheel,
streetView: props.streetView,
streetViewControl: props.streetViewControl,
streetViewControlOptions: props.streetViewControlPosition
? {
position: (_d = api.value) === null || _d === void 0 ? void 0 : _d.ControlPosition[props.streetViewControlPosition],
}
: {},
styles: props.styles,
tilt: props.tilt,
zoom: props.zoom,
zoomControl: props.zoomControl,
zoomControlOptions: props.zoomControlPosition
? {
position: (_e = api.value) === null || _e === void 0 ? void 0 : _e.ControlPosition[props.zoomControlPosition],
}
: {},
};
// Strip undefined keys. Without this Map.setOptions doesn't behave very well.
Object.keys(opts).forEach(key => opts[key] === undefined && delete opts[key]);
return opts;
};
vue.onBeforeUnmount(() => {
var _a;
if (map.value) {
(_a = api.value) === null || _a === void 0 ? void 0 : _a.event.clearInstanceListeners(map.value);
}
});
// Only run this in a browser env since it needs to use the `document` object
// and would error out in a node env (i.e. vitepress/vuepress SSR)
if (typeof window !== 'undefined') {
loadNow('places', props.apiKey).then(({ maps }) => {
const { Map } = (api.value = maps);
map.value = new Map(mapRef.value, resolveOptions());
mapEvents.forEach(event => {
var _a;
(_a = map.value) === null || _a === void 0 ? void 0 : _a.addListener(event, () => emit(event));
});
ready.value = true;
const otherPropsAsRefs = Object.keys(props)
.filter(key => !['center', 'zoom'].includes(key))
.map(key => vue.toRef(props, key));
vue.watch([() => props.center, () => props.zoom, ...otherPropsAsRefs], ([center, zoom], [oldCenter, oldZoom]) => {
var _a, _b, _c;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const _d = resolveOptions(), otherOptions = __rest(_d, ["center", "zoom"]);
(_a = map.value) === null || _a === void 0 ? void 0 : _a.setOptions(otherOptions);
if (zoom !== undefined && zoom !== oldZoom) {
(_b = map.value) === null || _b === void 0 ? void 0 : _b.setZoom(zoom);
}
if (center) {
if (!oldCenter || center.lng !== oldCenter.lng || center.lat !== oldCenter.lat) {
(_c = map.value) === null || _c === void 0 ? void 0 : _c.panTo(center);
}
}
});
});
}
return { mapRef, ready, map, api };
},
});
const _hoisted_1 = { ref: "mapRef" };
function render(_ctx, _cache, $props, $setup, $data, $options) {
return (vue.openBlock(), vue.createBlock("div", _hoisted_1, [
vue.renderSlot(_ctx.$slots, "default")
], 512 /* NEED_PATCH */))
}
script.render = render;
script.__file = "src/components/GoogleMap.vue";
var Marker = vue.defineComponent({
props: {
options: {
type: Object,
required: true,
},
},
setup(props, { emit }) {
const options = vue.toRef(props, 'options');
const marker = useSetupMapComponent('Marker', markerEvents, options, emit);
return { marker };
},
render: () => null,
});
var Polyline = vue.defineComponent({
props: {
options: {
type: Object,
required: true,
},
},
setup(props, { emit }) {
const options = vue.toRef(props, 'options');
const polyline = useSetupMapComponent('Polyline', polylineEvents, options, emit);
return { polyline };
},
render: () => null,
});
var Polygon = vue.defineComponent({
props: {
options: {
type: Object,
required: true,
},
},
setup(props, { emit }) {
const options = vue.toRef(props, 'options');
const polygon = useSetupMapComponent('Polygon', polygonEvents, options, emit);
return { polygon };
},
render: () => null,
});
var Rectangle = vue.defineComponent({
props: {
options: {
type: Object,
required: true,
},
},
setup(props, { emit }) {
const options = vue.toRef(props, 'options');
const rectangle = useSetupMapComponent('Rectangle', rectangleEvents, options, emit);
return { rectangle };
},
render: () => null,
});
var Circle = vue.defineComponent({
props: {
options: {
type: Object,
required: true,
},
},
setup(props, { emit }) {
const options = vue.toRef(props, 'options');
const circle = useSetupMapComponent('Circle', circleEvents, options, emit);
return { circle };
},
render: () => null,
});
var script$1 = vue.defineComponent({
props: {
position: {
type: String,
required: true,
},
index: Number,
},
setup(props) {
const controlRef = vue.ref(null);
const { map, api } = useMap();
vue.watch([map, () => props.position, () => props.index], (_, oldValues, onInvalidate) => {
if (map.value && api.value) {
if (props.index) {
controlRef.value.index = props.index;
}
if (controlRef.value) {
map.value.controls[api.value.ControlPosition[props.position]].push(controlRef.value);
}
}
onInvalidate(() => {
if (map.value && api.value && controlRef.value) {
let index = undefined;
// Not a native array so we have to iterate using forEach of MVCArray:
// https://developers.google.com/maps/documentation/javascript/reference/event?hl=en#MVCArray
map.value.controls[api.value.ControlPosition[oldValues[1]]].forEach((c, i) => {
if (c === controlRef.value) {
index = i;
}
});
if (index) {
map.value.controls[api.value.ControlPosition[oldValues[1]]].removeAt(index);
}
}
});
});
return { controlRef };
},
});
const _hoisted_1$1 = { ref: "controlRef" };
function render$1(_ctx, _cache, $props, $setup, $data, $options) {
return (vue.openBlock(), vue.createBlock("div", _hoisted_1$1, [
vue.renderSlot(_ctx.$slots, "default")
], 512 /* NEED_PATCH */))
}
script$1.render = render$1;
script$1.__file = "src/components/CustomControl.vue";
exports.Circle = Circle;
exports.CustomControl = script$1;
exports.GoogleMap = script;
exports.Marker = Marker;
exports.Polygon = Polygon;
exports.Polyline = Polyline;
exports.Rectangle = Rectangle;
*****************************************************************************/
'use strict';Object.defineProperty(exports,"__esModule",{value:!0});var vue=require("vue");function __rest(a,b){var e={},c;for(c in a)Object.prototype.hasOwnProperty.call(a,c)&&0>b.indexOf(c)&&(e[c]=a[c]);if(null!=a&&"function"===typeof Object.getOwnPropertySymbols){var d=0;for(c=Object.getOwnPropertySymbols(a);d<c.length;d++)0>b.indexOf(c[d])&&Object.prototype.propertyIsEnumerable.call(a,c[d])&&(e[c[d]]=a[c[d]])}return e}async function wait(a){return new Promise(b=>setTimeout(b,a))}var HttpStatusCodes;
(function(a){a[a.Continue=100]="Continue";a[a.Success=200]="Success";a[a.Created=201]="Created";a[a.Accepted=202]="Accepted";a[a.NoContent=204]="NoContent";a[a.MovedPermenantly=301]="MovedPermenantly";a[a.TemporaryRedirect=307]="TemporaryRedirect";a[a.NotModified=304]="NotModified";a[a.BadRequest=400]="BadRequest";a[a.Unauthorized=401]="Unauthorized";a[a.PaymentRequired=402]="PaymentRequired";a[a.Forbidden=403]="Forbidden";a[a.NotFound=404]="NotFound";a[a.MethodNotAllowed=405]="MethodNotAllowed";
a[a.RequestTimeout=408]="RequestTimeout";a[a.Conflict=409]="Conflict";a[a.Gone=410]="Gone";a[a.IAmATeapot=418]="IAmATeapot";a[a.UnprocessableEntity=422]="UnprocessableEntity";a[a.TooManyRequests=429]="TooManyRequests";a[a.InternalServerError=500]="InternalServerError";a[a.NotImplemented=501]="NotImplemented";a[a.BadGateway=502]="BadGateway";a[a.ServiceUnavailable=503]="ServiceUnavailable";a[a.GatewayTimeout=504]="GatewayTimeout";a[a.AuthenticationRequired=511]="AuthenticationRequired"})(HttpStatusCodes||
(HttpStatusCodes={}));Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)});let BASE_URL="https://maps.googleapis.com/maps/api/js";async function loadNow(a,b){if(checkIfScriptTagExists(a))return window.google;await addScriptTagToBrowser(a,b);return window.google}
async function addScriptTagToBrowser(a,b,e={}){if(checkIfScriptTagExists(a))console.info(`Attempt to add script tag for the "${a}" library in Google Maps ignored as this tag already exists in the DOM${b?" [ "+b+"]":""}`);else{var c=async(b=2E3)=>{await wait(b);throw Error(`Timed out waiting for Google API to load [ ${a} / ${b} ]`);},d=()=>{var c=document.createElement("script");c.id=`google-maps-${a}-js`;c.src=getUrl(a,b);document.querySelector("head").appendChild(c);return new Promise(b=>{window[`${a}LoaderCallback`]=
()=>{b()}})};return Promise.race(e.timeout?[c(e.timeout),d()]:[d()])}}function getUrl(a,b,e=!0){let c=`${BASE_URL}?libraries=${a}&sensors=false`;b&&(c=`${c}&key=${b}`);e&&(c=`${c}&callback=${a}LoaderCallback`);return c}function checkIfScriptTagExists(a,b){return!!document.querySelector(`#google-maps-${a}-js`)}
let map=vue.ref(null),api=vue.ref(null),useMap=()=>({map,api}),useSetupMapComponent=(a,b,e,c)=>{let d=null;const f=vue.ref(null),{map:h,api:g}=useMap();vue.watch([h,e],(p,q,n)=>{h.value&&g.value&&(f.value=d=new g.value[a](Object.assign(Object.assign({},e.value),{map:h.value})),b.forEach(a=>{null===d||void 0===d?void 0:d.addListener(a,()=>c(a))}));n(()=>{var a;d&&(null===(a=g.value)||void 0===a?void 0:a.event.clearInstanceListeners(d),d.setMap(null))})});return{component:f}},mapEvents="bounds_changed center_changed click dblclick drag dragend dragstart heading_changed idle maptypeid_changed mousemove mouseout mouseover projection_changed resize rightclick tilesloaded tilt_changed zoom_changed".split(" "),
markerEvents="animation_changed click dblclick rightclick dragstart dragend drag mouseover mousedown mouseup draggable_changed clickable_changed cursor_changed flat_changed rightclick zindex_changed icon_changed position_changed shape_changed title_changed visible_changed".split(" "),polylineEvents="click dblclick drag dragend dragstart mousedown mousemove mouseout mouseover mouseup rightclick".split(" "),polygonEvents=polylineEvents,rectangleEvents=polylineEvents.concat(["bounds_changed"]),circleEvents=
polylineEvents.concat(["center_changed","radius_changed"]);
var script=vue.defineComponent({props:{apiKey:String,backgroundColor:String,center:Object,clickableIcons:{type:Boolean,default:void 0},controlSize:Number,disableDefaultUi:{type:Boolean,default:void 0},disableDoubleClickZoom:{type:Boolean,default:void 0},draggable:{type:Boolean,default:void 0},draggableCursor:String,draggingCursor:String,fullscreenControl:{type:Boolean,default:void 0},fullscreenControlPosition:String,gestureHandling:String,heading:Number,keyboardShortcuts:{type:Boolean,default:void 0},
mapTypeControl:{type:Boolean,default:void 0},mapTypeControlOptions:Object,mapTypeId:{type:[Number,String]},maxZoom:Number,minZoom:Number,noClear:{type:Boolean,default:void 0},panControl:{type:Boolean,default:void 0},panControlPosition:String,restriction:Object,rotateControl:{type:Boolean,default:void 0},rotateControlPosition:String,scaleControl:{type:Boolean,default:void 0},scaleControlStyle:Number,scrollwheel:{type:Boolean,default:void 0},streetView:Object,streetViewControl:{type:Boolean,default:void 0},
streetViewControlPosition:String,styles:Array,tilt:Number,zoom:Number,zoomControl:{type:Boolean,default:void 0},zoomControlPosition:String},setup(a,{emit:b}){let e=vue.ref(null),c=vue.ref(!1),{map:d,api:f}=useMap(),h=()=>{var b,c,d,e,h;const k={backgroundColor:a.backgroundColor,center:a.center,clickableIcons:a.clickableIcons,controlSize:a.controlSize,disableDefaultUI:a.disableDefaultUi,disableDoubleClickZoom:a.disableDoubleClickZoom,draggable:a.draggable,draggableCursor:a.draggableCursor,draggingCursor:a.draggingCursor,
fullscreenControl:a.fullscreenControl,fullscreenControlOptions:a.fullscreenControlPosition?{position:null===(b=f.value)||void 0===b?void 0:b.ControlPosition[a.fullscreenControlPosition]}:{},gestureHandling:a.gestureHandling,heading:a.heading,keyboardShortcuts:a.keyboardShortcuts,mapTypeControl:a.mapTypeControl,mapTypeControlOptions:a.mapTypeControlOptions,mapTypeId:a.mapTypeId,maxZoom:a.maxZoom,minZoom:a.minZoom,noClear:a.noClear,panControl:a.panControl,panControlOptions:a.panControlPosition?{position:null===
(c=f.value)||void 0===c?void 0:c.ControlPosition[a.panControlPosition]}:{},restriction:a.restriction,rotateControl:a.rotateControl,rotateControlOptions:a.rotateControlPosition?{position:null===(d=f.value)||void 0===d?void 0:d.ControlPosition[a.rotateControlPosition]}:{},scaleControl:a.scaleControl,scaleControlOptions:a.scaleControlStyle?{style:a.scaleControlStyle}:{},scrollwheel:a.scrollwheel,streetView:a.streetView,streetViewControl:a.streetViewControl,streetViewControlOptions:a.streetViewControlPosition?
{position:null===(e=f.value)||void 0===e?void 0:e.ControlPosition[a.streetViewControlPosition]}:{},styles:a.styles,tilt:a.tilt,zoom:a.zoom,zoomControl:a.zoomControl,zoomControlOptions:a.zoomControlPosition?{position:null===(h=f.value)||void 0===h?void 0:h.ControlPosition[a.zoomControlPosition]}:{}};Object.keys(k).forEach(a=>void 0===k[a]&&delete k[a]);return k};vue.onBeforeUnmount(()=>{var a;d.value&&(null===(a=f.value)||void 0===a?void 0:a.event.clearInstanceListeners(d.value))});"undefined"!==typeof window&&
loadNow("places",a.apiKey).then(({maps:g})=>{({Map:g}=f.value=g);d.value=new g(e.value,h());mapEvents.forEach(a=>{var c;null===(c=d.value)||void 0===c?void 0:c.addListener(a,()=>b(a))});c.value=!0;g=Object.keys(a).filter(a=>!["center","zoom"].includes(a)).map(b=>vue.toRef(a,b));vue.watch([()=>a.center,()=>a.zoom,...g],([a,b],[c,e])=>{var f,g,l,m=h();m=__rest(m,["center","zoom"]);null===(f=d.value)||void 0===f?void 0:f.setOptions(m);void 0!==b&&b!==e&&(null===(g=d.value)||void 0===g?void 0:g.setZoom(b));
!a||c&&a.lng===c.lng&&a.lat===c.lat||(null===(l=d.value)||void 0===l?void 0:l.panTo(a))})});return{mapRef:e,ready:c,map:d,api:f}}});let _hoisted_1={ref:"mapRef"};function render(a,b,e,c,d,f){return vue.openBlock(),vue.createBlock("div",_hoisted_1,[vue.renderSlot(a.$slots,"default")],512)}script.render=render;script.__file="src/components/GoogleMap.vue";
var Marker=vue.defineComponent({props:{options:{type:Object,required:!0}},setup(a,{emit:b}){a=vue.toRef(a,"options");return{marker:useSetupMapComponent("Marker",markerEvents,a,b)}},render:()=>null}),Polyline=vue.defineComponent({props:{options:{type:Object,required:!0}},setup(a,{emit:b}){a=vue.toRef(a,"options");return{polyline:useSetupMapComponent("Polyline",polylineEvents,a,b)}},render:()=>null}),Polygon=vue.defineComponent({props:{options:{type:Object,required:!0}},setup(a,{emit:b}){a=vue.toRef(a,
"options");return{polygon:useSetupMapComponent("Polygon",polygonEvents,a,b)}},render:()=>null}),Rectangle=vue.defineComponent({props:{options:{type:Object,required:!0}},setup(a,{emit:b}){a=vue.toRef(a,"options");return{rectangle:useSetupMapComponent("Rectangle",rectangleEvents,a,b)}},render:()=>null}),Circle=vue.defineComponent({props:{options:{type:Object,required:!0}},setup(a,{emit:b}){a=vue.toRef(a,"options");return{circle:useSetupMapComponent("Circle",circleEvents,a,b)}},render:()=>null}),script$1=
vue.defineComponent({props:{position:{type:String,required:!0},index:Number},setup(a){let b=vue.ref(null),{map:e,api:c}=useMap();vue.watch([e,()=>a.position,()=>a.index],(d,f,h)=>{e.value&&c.value&&(a.index&&(b.value.index=a.index),b.value&&e.value.controls[c.value.ControlPosition[a.position]].push(b.value));h(()=>{if(e.value&&c.value&&b.value){let a=void 0;e.value.controls[c.value.ControlPosition[f[1]]].forEach((c,d)=>{c===b.value&&(a=d)});a&&e.value.controls[c.value.ControlPosition[f[1]]].removeAt(a)}})});
return{controlRef:b}}});let _hoisted_1$1={ref:"controlRef"};function render$1(a,b,e,c,d,f){return vue.openBlock(),vue.createBlock("div",_hoisted_1$1,[vue.renderSlot(a.$slots,"default")],512)}script$1.render=render$1;script$1.__file="src/components/CustomControl.vue";exports.Circle=Circle;exports.CustomControl=script$1;exports.GoogleMap=script;exports.Marker=Marker;exports.Polygon=Polygon;exports.Polyline=Polyline;exports.Rectangle=Rectangle

@@ -1,16 +0,1 @@

"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=e(require("vue"));function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var n=t(function(e,o,t){return e(t={path:o,exports:{},require:function(e,o){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==o&&t.path)}},t.exports),t.exports}((function(e,t){var n;Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.Continue=100]="Continue",e[e.Success=200]="Success",e[e.Created=201]="Created",e[e.Accepted=202]="Accepted",e[e.NoContent=204]="NoContent",e[e.MovedPermenantly=301]="MovedPermenantly",e[e.TemporaryRedirect=307]="TemporaryRedirect",e[e.NotModified=304]="NotModified",e[e.BadRequest=400]="BadRequest",e[e.Unauthorized=401]="Unauthorized",e[e.PaymentRequired=402]="PaymentRequired",e[e.Forbidden=403]="Forbidden",e[e.NotFound=404]="NotFound",e[e.MethodNotAllowed=405]="MethodNotAllowed",e[e.RequestTimeout=408]="RequestTimeout",e[e.Conflict=409]="Conflict",e[e.Gone=410]="Gone",e[e.IAmATeapot=418]="IAmATeapot",e[e.UnprocessableEntity=422]="UnprocessableEntity",e[e.TooManyRequests=429]="TooManyRequests",e[e.InternalServerError=500]="InternalServerError",e[e.NotImplemented=501]="NotImplemented",e[e.BadGateway=502]="BadGateway",e[e.ServiceUnavailable=503]="ServiceUnavailable",e[e.GatewayTimeout=504]="GatewayTimeout",e[e.AuthenticationRequired=511]="AuthenticationRequired"}(n||(n={})),Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)});const r="https://maps.googleapis.com/maps/api/js";async function l(e,o){return a(e)||await async function(e,o,t={}){if(a(e))return void console.info(`Attempt to add script tag for the "${e}" library in Google Maps ignored as this tag already exists in the DOM${o?" [ "+o+"]":""}`);const n=async(o=2e3)=>{throw await async function(e){return new Promise((o=>setTimeout(o,e)))}(o),new Error(`Timed out waiting for Google API to load [ ${e} / ${o} ]`)},l=()=>{var t=document.createElement("script");return t.id=`google-maps-${e}-js`,t.src=function(e,o,t=!0){let n=`${r}?libraries=${e}&sensors=false`;o&&(n=`${n}&key=${o}`);t&&(n=`${n}&callback=${e}LoaderCallback`);return n}(e,o),document.querySelector("head").appendChild(t),new Promise((o=>{window[e+"LoaderCallback"]=()=>{o()}}))};return Promise.race(t.timeout?[n(t.timeout),l()]:[l()])}(e,o),window.google}function a(e,o){const t=document.querySelector(`#google-maps-${e}-js`);return Boolean(t)}const i=o.default.ref(null),u=o.default.ref(null),s=()=>({map:i,api:u}),d=(e,t,n,r)=>{let l=null;const a=o.default.ref(null),{map:i,api:u}=s();return o.default.watch([i,n],((o,s,d)=>{i.value&&u.value&&(a.value=l=new u.value[e](Object.assign(Object.assign({},n.value),{map:i.value})),t.forEach((e=>{null==l||l.addListener(e,(()=>r(e)))}))),d((()=>{var e;l&&(null===(e=u.value)||void 0===e||e.event.clearInstanceListeners(l),l.setMap(null))}))})),{component:a}},c=["bounds_changed","center_changed","click","dblclick","drag","dragend","dragstart","heading_changed","idle","maptypeid_changed","mousemove","mouseout","mouseover","projection_changed","resize","rightclick","tilesloaded","tilt_changed","zoom_changed"],p=["animation_changed","click","dblclick","rightclick","dragstart","dragend","drag","mouseover","mousedown","mouseup","draggable_changed","clickable_changed","cursor_changed","flat_changed","rightclick","zindex_changed","icon_changed","position_changed","shape_changed","title_changed","visible_changed"],m=["click","dblclick","drag","dragend","dragstart","mousedown","mousemove","mouseout","mouseover","mouseup","rightclick"],f=m,g=m.concat(["bounds_changed"]),v=m.concat(["center_changed","radius_changed"]);var y=o.default.defineComponent({props:{apiKey:String,backgroundColor:String,center:Object,clickableIcons:{type:Boolean,default:void 0},controlSize:Number,disableDefaultUi:{type:Boolean,default:void 0},disableDoubleClickZoom:{type:Boolean,default:void 0},draggable:{type:Boolean,default:void 0},draggableCursor:String,draggingCursor:String,fullscreenControl:{type:Boolean,default:void 0},fullscreenControlPosition:String,gestureHandling:String,heading:Number,keyboardShortcuts:{type:Boolean,default:void 0},mapTypeControl:{type:Boolean,default:void 0},mapTypeControlOptions:Object,mapTypeId:{type:[Number,String]},maxZoom:Number,minZoom:Number,noClear:{type:Boolean,default:void 0},panControl:{type:Boolean,default:void 0},panControlPosition:String,restriction:Object,rotateControl:{type:Boolean,default:void 0},rotateControlPosition:String,scaleControl:{type:Boolean,default:void 0},scaleControlStyle:Number,scrollwheel:{type:Boolean,default:void 0},streetView:Object,streetViewControl:{type:Boolean,default:void 0},streetViewControlPosition:String,styles:Array,tilt:Number,zoom:Number,zoomControl:{type:Boolean,default:void 0},zoomControlPosition:String},setup(e,{emit:t}){const n=o.default.ref(null),r=o.default.ref(!1),{map:a,api:i}=s(),u=()=>{var o,t,n,r,l;const a={backgroundColor:e.backgroundColor,center:e.center,clickableIcons:e.clickableIcons,controlSize:e.controlSize,disableDefaultUI:e.disableDefaultUi,disableDoubleClickZoom:e.disableDoubleClickZoom,draggable:e.draggable,draggableCursor:e.draggableCursor,draggingCursor:e.draggingCursor,fullscreenControl:e.fullscreenControl,fullscreenControlOptions:e.fullscreenControlPosition?{position:null===(o=i.value)||void 0===o?void 0:o.ControlPosition[e.fullscreenControlPosition]}:{},gestureHandling:e.gestureHandling,heading:e.heading,keyboardShortcuts:e.keyboardShortcuts,mapTypeControl:e.mapTypeControl,mapTypeControlOptions:e.mapTypeControlOptions,mapTypeId:e.mapTypeId,maxZoom:e.maxZoom,minZoom:e.minZoom,noClear:e.noClear,panControl:e.panControl,panControlOptions:e.panControlPosition?{position:null===(t=i.value)||void 0===t?void 0:t.ControlPosition[e.panControlPosition]}:{},restriction:e.restriction,rotateControl:e.rotateControl,rotateControlOptions:e.rotateControlPosition?{position:null===(n=i.value)||void 0===n?void 0:n.ControlPosition[e.rotateControlPosition]}:{},scaleControl:e.scaleControl,scaleControlOptions:e.scaleControlStyle?{style:e.scaleControlStyle}:{},scrollwheel:e.scrollwheel,streetView:e.streetView,streetViewControl:e.streetViewControl,streetViewControlOptions:e.streetViewControlPosition?{position:null===(r=i.value)||void 0===r?void 0:r.ControlPosition[e.streetViewControlPosition]}:{},styles:e.styles,tilt:e.tilt,zoom:e.zoom,zoomControl:e.zoomControl,zoomControlOptions:e.zoomControlPosition?{position:null===(l=i.value)||void 0===l?void 0:l.ControlPosition[e.zoomControlPosition]}:{}};return Object.keys(a).forEach((e=>void 0===a[e]&&delete a[e])),a};return o.default.onBeforeUnmount((()=>{var e;a.value&&(null===(e=i.value)||void 0===e||e.event.clearInstanceListeners(a.value))})),"undefined"!=typeof window&&l("places",e.apiKey).then((({maps:l})=>{const{Map:s}=i.value=l;a.value=new s(n.value,u()),c.forEach((e=>{var o;null===(o=a.value)||void 0===o||o.addListener(e,(()=>t(e)))})),r.value=!0;const d=Object.keys(e).filter((e=>!["center","zoom"].includes(e))).map((t=>o.default.toRef(e,t)));o.default.watch([()=>e.center,()=>e.zoom,...d],(([e,o],[t,n])=>{var r,l,i;const s=
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
function(e,o){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&o.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)o.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(t[n[r]]=e[n[r]])}return t}(u(),["center","zoom"]);null===(r=a.value)||void 0===r||r.setOptions(s),void 0!==o&&o!==n&&(null===(l=a.value)||void 0===l||l.setZoom(o)),e&&(t&&e.lng===t.lng&&e.lat===t.lat||null===(i=a.value)||void 0===i||i.panTo(e))}))})),{mapRef:n,ready:r,map:a,api:i}}});const C={ref:"mapRef"};y.render=function(e,t,n,r,l,a){return o.default.openBlock(),o.default.createBlock("div",C,[o.default.renderSlot(e.$slots,"default")],512)},y.__file="src/components/GoogleMap.vue";var b=o.default.defineComponent({props:{options:{type:Object,required:!0}},setup(e,{emit:t}){const n=o.default.toRef(e,"options");return{marker:d("Marker",p,n,t)}},render:()=>null}),h=o.default.defineComponent({props:{options:{type:Object,required:!0}},setup(e,{emit:t}){const n=o.default.toRef(e,"options");return{polyline:d("Polyline",m,n,t)}},render:()=>null}),w=o.default.defineComponent({props:{options:{type:Object,required:!0}},setup(e,{emit:t}){const n=o.default.toRef(e,"options");return{polygon:d("Polygon",f,n,t)}},render:()=>null}),P=o.default.defineComponent({props:{options:{type:Object,required:!0}},setup(e,{emit:t}){const n=o.default.toRef(e,"options");return{rectangle:d("Rectangle",g,n,t)}},render:()=>null}),O=o.default.defineComponent({props:{options:{type:Object,required:!0}},setup(e,{emit:t}){const n=o.default.toRef(e,"options");return{circle:d("Circle",v,n,t)}},render:()=>null}),k=o.default.defineComponent({props:{position:{type:String,required:!0},index:Number},setup(e){const t=o.default.ref(null),{map:n,api:r}=s();return o.default.watch([n,()=>e.position,()=>e.index],((o,l,a)=>{n.value&&r.value&&(e.index&&(t.value.index=e.index),t.value&&n.value.controls[r.value.ControlPosition[e.position]].push(t.value)),a((()=>{if(n.value&&r.value&&t.value){let e=void 0;n.value.controls[r.value.ControlPosition[l[1]]].forEach(((o,n)=>{o===t.value&&(e=n)})),e&&n.value.controls[r.value.ControlPosition[l[1]]].removeAt(e)}}))})),{controlRef:t}}});const S={ref:"controlRef"};k.render=function(e,t,n,r,l,a){return o.default.openBlock(),o.default.createBlock("div",S,[o.default.renderSlot(e.$slots,"default")],512)},k.__file="src/components/CustomControl.vue",t.Circle=O,t.CustomControl=k,t.GoogleMap=y,t.Marker=b,t.Polygon=w,t.Polyline=h,t.Rectangle=P})));module.exports=n;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,o,t=require("vue");(o=e||(e={}))[o.Continue=100]="Continue",o[o.Success=200]="Success",o[o.Created=201]="Created",o[o.Accepted=202]="Accepted",o[o.NoContent=204]="NoContent",o[o.MovedPermenantly=301]="MovedPermenantly",o[o.TemporaryRedirect=307]="TemporaryRedirect",o[o.NotModified=304]="NotModified",o[o.BadRequest=400]="BadRequest",o[o.Unauthorized=401]="Unauthorized",o[o.PaymentRequired=402]="PaymentRequired",o[o.Forbidden=403]="Forbidden",o[o.NotFound=404]="NotFound",o[o.MethodNotAllowed=405]="MethodNotAllowed",o[o.RequestTimeout=408]="RequestTimeout",o[o.Conflict=409]="Conflict",o[o.Gone=410]="Gone",o[o.IAmATeapot=418]="IAmATeapot",o[o.UnprocessableEntity=422]="UnprocessableEntity",o[o.TooManyRequests=429]="TooManyRequests",o[o.InternalServerError=500]="InternalServerError",o[o.NotImplemented=501]="NotImplemented",o[o.BadGateway=502]="BadGateway",o[o.ServiceUnavailable=503]="ServiceUnavailable",o[o.GatewayTimeout=504]="GatewayTimeout",o[o.AuthenticationRequired=511]="AuthenticationRequired",Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)});let n="https://maps.googleapis.com/maps/api/js";async function r(e,o){return l(e)||await async function(e,o,t={}){if(!l(e)){var r=async(o=2e3)=>{throw await async function(e){return new Promise((o=>setTimeout(o,e)))}(o),Error(`Timed out waiting for Google API to load [ ${e} / ${o} ]`)},i=()=>{var t=document.createElement("script");return t.id=`google-maps-${e}-js`,t.src=function(e,o,t=!0){let r=`${n}?libraries=${e}&sensors=false`;return o&&(r=`${r}&key=${o}`),t&&(r=`${r}&callback=${e}LoaderCallback`),r}(e,o),document.querySelector("head").appendChild(t),new Promise((o=>{window[e+"LoaderCallback"]=()=>{o()}}))};return Promise.race(t.timeout?[r(t.timeout),i()]:[i()])}console.info(`Attempt to add script tag for the "${e}" library in Google Maps ignored as this tag already exists in the DOM${o?" [ "+o+"]":""}`)}(e,o),window.google}function l(e,o){return!!document.querySelector(`#google-maps-${e}-js`)}let i=t.ref(null),a=t.ref(null),s=()=>({map:i,api:a}),d=(e,o,n,r)=>{let l=null;const i=t.ref(null),{map:a,api:d}=s();return t.watch([a,n],((t,s,u)=>{a.value&&d.value&&(i.value=l=new d.value[e](Object.assign(Object.assign({},n.value),{map:a.value})),o.forEach((e=>{null==l||l.addListener(e,(()=>r(e)))}))),u((()=>{var e;l&&(null===(e=d.value)||void 0===e||e.event.clearInstanceListeners(l),l.setMap(null))}))})),{component:i}},u="bounds_changed center_changed click dblclick drag dragend dragstart heading_changed idle maptypeid_changed mousemove mouseout mouseover projection_changed resize rightclick tilesloaded tilt_changed zoom_changed".split(" "),c="animation_changed click dblclick rightclick dragstart dragend drag mouseover mousedown mouseup draggable_changed clickable_changed cursor_changed flat_changed rightclick zindex_changed icon_changed position_changed shape_changed title_changed visible_changed".split(" "),p="click dblclick drag dragend dragstart mousedown mousemove mouseout mouseover mouseup rightclick".split(" "),m=p,g=p.concat(["bounds_changed"]),v=p.concat(["center_changed","radius_changed"]);var C=t.defineComponent({props:{apiKey:String,backgroundColor:String,center:Object,clickableIcons:{type:Boolean,default:void 0},controlSize:Number,disableDefaultUi:{type:Boolean,default:void 0},disableDoubleClickZoom:{type:Boolean,default:void 0},draggable:{type:Boolean,default:void 0},draggableCursor:String,draggingCursor:String,fullscreenControl:{type:Boolean,default:void 0},fullscreenControlPosition:String,gestureHandling:String,heading:Number,keyboardShortcuts:{type:Boolean,default:void 0},mapTypeControl:{type:Boolean,default:void 0},mapTypeControlOptions:Object,mapTypeId:{type:[Number,String]},maxZoom:Number,minZoom:Number,noClear:{type:Boolean,default:void 0},panControl:{type:Boolean,default:void 0},panControlPosition:String,restriction:Object,rotateControl:{type:Boolean,default:void 0},rotateControlPosition:String,scaleControl:{type:Boolean,default:void 0},scaleControlStyle:Number,scrollwheel:{type:Boolean,default:void 0},streetView:Object,streetViewControl:{type:Boolean,default:void 0},streetViewControlPosition:String,styles:Array,tilt:Number,zoom:Number,zoomControl:{type:Boolean,default:void 0},zoomControlPosition:String},setup(e,{emit:o}){let n=t.ref(null),l=t.ref(!1),{map:i,api:a}=s(),d=()=>{var o,t,n,r,l;const i={backgroundColor:e.backgroundColor,center:e.center,clickableIcons:e.clickableIcons,controlSize:e.controlSize,disableDefaultUI:e.disableDefaultUi,disableDoubleClickZoom:e.disableDoubleClickZoom,draggable:e.draggable,draggableCursor:e.draggableCursor,draggingCursor:e.draggingCursor,fullscreenControl:e.fullscreenControl,fullscreenControlOptions:e.fullscreenControlPosition?{position:null===(o=a.value)||void 0===o?void 0:o.ControlPosition[e.fullscreenControlPosition]}:{},gestureHandling:e.gestureHandling,heading:e.heading,keyboardShortcuts:e.keyboardShortcuts,mapTypeControl:e.mapTypeControl,mapTypeControlOptions:e.mapTypeControlOptions,mapTypeId:e.mapTypeId,maxZoom:e.maxZoom,minZoom:e.minZoom,noClear:e.noClear,panControl:e.panControl,panControlOptions:e.panControlPosition?{position:null===(t=a.value)||void 0===t?void 0:t.ControlPosition[e.panControlPosition]}:{},restriction:e.restriction,rotateControl:e.rotateControl,rotateControlOptions:e.rotateControlPosition?{position:null===(n=a.value)||void 0===n?void 0:n.ControlPosition[e.rotateControlPosition]}:{},scaleControl:e.scaleControl,scaleControlOptions:e.scaleControlStyle?{style:e.scaleControlStyle}:{},scrollwheel:e.scrollwheel,streetView:e.streetView,streetViewControl:e.streetViewControl,streetViewControlOptions:e.streetViewControlPosition?{position:null===(r=a.value)||void 0===r?void 0:r.ControlPosition[e.streetViewControlPosition]}:{},styles:e.styles,tilt:e.tilt,zoom:e.zoom,zoomControl:e.zoomControl,zoomControlOptions:e.zoomControlPosition?{position:null===(l=a.value)||void 0===l?void 0:l.ControlPosition[e.zoomControlPosition]}:{}};return Object.keys(i).forEach((e=>void 0===i[e]&&delete i[e])),i};return t.onBeforeUnmount((()=>{var e;i.value&&(null===(e=a.value)||void 0===e||e.event.clearInstanceListeners(i.value))})),"undefined"!=typeof window&&r("places",e.apiKey).then((({maps:r})=>{({Map:r}=a.value=r),i.value=new r(n.value,d()),u.forEach((e=>{var t;null===(t=i.value)||void 0===t||t.addListener(e,(()=>o(e)))})),l.value=!0,r=Object.keys(e).filter((e=>!["center","zoom"].includes(e))).map((o=>t.toRef(e,o))),t.watch([()=>e.center,()=>e.zoom,...r],(([e,o],[t,n])=>{var r,l,a,s=d();s=function(e,o){var t,n={};for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&0>o.indexOf(t)&&(n[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(t=Object.getOwnPropertySymbols(e);r<t.length;r++)0>o.indexOf(t[r])&&Object.prototype.propertyIsEnumerable.call(e,t[r])&&(n[t[r]]=e[t[r]])}return n}(s,["center","zoom"]),null===(r=i.value)||void 0===r||r.setOptions(s),void 0!==o&&o!==n&&(null===(l=i.value)||void 0===l||l.setZoom(o)),!e||t&&e.lng===t.lng&&e.lat===t.lat||null===(a=i.value)||void 0===a||a.panTo(e)}))})),{mapRef:n,ready:l,map:i,api:a}}});let y={ref:"mapRef"};C.render=function(e,o,n,r,l,i){return t.openBlock(),t.createBlock("div",y,[t.renderSlot(e.$slots,"default")],512)},C.__file="src/components/GoogleMap.vue";var f=t.defineComponent({props:{options:{type:Object,required:!0}},setup:(e,{emit:o})=>(e=t.toRef(e,"options"),{marker:d("Marker",c,e,o)}),render:()=>null}),b=t.defineComponent({props:{options:{type:Object,required:!0}},setup:(e,{emit:o})=>(e=t.toRef(e,"options"),{polyline:d("Polyline",p,e,o)}),render:()=>null}),h=t.defineComponent({props:{options:{type:Object,required:!0}},setup:(e,{emit:o})=>(e=t.toRef(e,"options"),{polygon:d("Polygon",m,e,o)}),render:()=>null}),w=t.defineComponent({props:{options:{type:Object,required:!0}},setup:(e,{emit:o})=>(e=t.toRef(e,"options"),{rectangle:d("Rectangle",g,e,o)}),render:()=>null}),P=t.defineComponent({props:{options:{type:Object,required:!0}},setup:(e,{emit:o})=>(e=t.toRef(e,"options"),{circle:d("Circle",v,e,o)}),render:()=>null}),k=t.defineComponent({props:{position:{type:String,required:!0},index:Number},setup(e){let o=t.ref(null),{map:n,api:r}=s();return t.watch([n,()=>e.position,()=>e.index],((t,l,i)=>{n.value&&r.value&&(e.index&&(o.value.index=e.index),o.value&&n.value.controls[r.value.ControlPosition[e.position]].push(o.value)),i((()=>{if(n.value&&r.value&&o.value){let e=void 0;n.value.controls[r.value.ControlPosition[l[1]]].forEach(((t,n)=>{t===o.value&&(e=n)})),e&&n.value.controls[r.value.ControlPosition[l[1]]].removeAt(e)}}))})),{controlRef:o}}});let O={ref:"controlRef"};k.render=function(e,o,n,r,l,i){return t.openBlock(),t.createBlock("div",O,[t.renderSlot(e.$slots,"default")],512)},k.__file="src/components/CustomControl.vue",exports.Circle=P,exports.CustomControl=k,exports.GoogleMap=C,exports.Marker=f,exports.Polygon=h,exports.Polyline=b,exports.Rectangle=w;

@@ -1,4 +0,3 @@

import { ref, watch, defineComponent, onBeforeUnmount, toRef, openBlock, createBlock, renderSlot } from 'vue';
/*! *****************************************************************************
import{ref,watch,defineComponent,onBeforeUnmount,toRef,openBlock,createBlock,renderSlot}from'vue';/*
*****************************************************************************
Copyright (c) Microsoft Corporation.

@@ -16,657 +15,21 @@

PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
function __rest(s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
}
/**
* Provides a logical test to see if the passed in event is a LambdaProxy request or just a
* straight JS object response. This is useful when you have both an HTTP event and a Lambda-to-Lambda
* or Step-Function-to-Lambda interaction.
*
* @param message the body of the request (which is either of type T or a LambdaProxy event)
*/
/** provides a friendly way to pause execution when using async/await symantics */
async function wait(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
var HttpStatusCodes;
(function (HttpStatusCodes) {
/**
* The client SHOULD continue with its request. This interim response is used to inform
* the client that the initial part of the request has been received and has not yet
* been rejected by the server. The client SHOULD continue by sending the remainder
* of the request or, if the request has already been completed, ignore this response.
* The server MUST send a final response after the request has been completed.
*/
HttpStatusCodes[HttpStatusCodes["Continue"] = 100] = "Continue";
/** The request has succeeded. */
HttpStatusCodes[HttpStatusCodes["Success"] = 200] = "Success";
/**
* The request has been fulfilled and resulted in a new resource being created. The newly
* created resource can be referenced by the URI(s) returned in the entity of the response,
* with the most specific URI for the resource given by a Location header field. The response
* SHOULD include an entity containing a list of resource characteristics and location(s) from
* which the user or user agent can choose the one most appropriate. The entity format is
* specified by the media type given in the Content-Type header field. The origin server MUST
* create the resource before returning the `201` status code. If the action cannot be carried
* out immediately, the server SHOULD respond with `202` (Accepted) response instead.
*
* A `201` response MAY contain an ETag response header field indicating the current value of
* the entity tag for the requested variant just created.
*/
HttpStatusCodes[HttpStatusCodes["Created"] = 201] = "Created";
/**
* The request has been accepted for processing, but the processing has not been completed.
* The request might or might not eventually be acted upon, as it might be disallowed when
* processing actually takes place. There is no facility for re-sending a status code from an
* asynchronous operation such as this.
*
* The 202 response is intentionally non-committal. Its purpose is to allow a server to accept
* a request for some other process (perhaps a batch-oriented process that is only run once
* per day) without requiring that the user agent's connection to the server persist until the
* process is completed. The entity returned with this response SHOULD include an indication
* of the request's current status and either a pointer to a status monitor or some estimate
* of when the user can expect the request to be fulfilled.
*/
HttpStatusCodes[HttpStatusCodes["Accepted"] = 202] = "Accepted";
/**
* The server has fulfilled the request but does not need to return an entity-body, and might
* want to return updated meta-information. The response MAY include new or updated
* meta-information in the form of entity-headers, which if present SHOULD be associated with
* the requested variant.
*
* If the client is a _user agent_, it **SHOULD NOT** change its document view from that which
* caused the request to be sent. This response is primarily intended to allow input for
* actions to take place without causing a change to the user agent's active document view,
* although any new or updated metainformation **SHOULD** be applied to the document
* currently in the user agent's active view.
*
* The `204` response **MUST NOT** include a `message-body`, and thus is always terminated
* by the first empty line after the header fields.
*/
HttpStatusCodes[HttpStatusCodes["NoContent"] = 204] = "NoContent";
HttpStatusCodes[HttpStatusCodes["MovedPermenantly"] = 301] = "MovedPermenantly";
HttpStatusCodes[HttpStatusCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
/**
* If the client has performed a conditional GET request and access is allowed, but the
* document has not been modified, the server SHOULD respond with this status code. The
* `304` response MUST NOT contain a _message-body_, and thus is always terminated by the
* first empty line after the header fields.
*/
HttpStatusCodes[HttpStatusCodes["NotModified"] = 304] = "NotModified";
/**
* The request could not be understood by the server due to malformed syntax.
* The client SHOULD NOT repeat the request without modifications.
*/
HttpStatusCodes[HttpStatusCodes["BadRequest"] = 400] = "BadRequest";
/**
* The request requires user authentication. The response MUST include a WWW-Authenticate
* header field containing a challenge applicable to the requested resource.
* The client MAY repeat the request with a suitable Authorization header field. If the
* request already included Authorization credentials, then the `401`
* response indicates that authorization has been refused for those credentials. If the `401`
* response contains the same challenge as the prior response, and the user agent has already
* attempted authentication at least once, then the user SHOULD be presented the entity that
* was given in the response, since that entity might include relevant diagnostic information.
*/
HttpStatusCodes[HttpStatusCodes["Unauthorized"] = 401] = "Unauthorized";
HttpStatusCodes[HttpStatusCodes["PaymentRequired"] = 402] = "PaymentRequired";
/**
* The request could not be understood by the server due to malformed syntax. The client
* SHOULD NOT repeat the request without modifications.
*/
HttpStatusCodes[HttpStatusCodes["Forbidden"] = 403] = "Forbidden";
/**
* The server has not found anything matching the Request-URI. No indication is given of
* whether the condition is temporary or permanent. The `410` (Gone) status code SHOULD be
* used if the server knows, through some internally configurable mechanism, that an old
* resource is permanently unavailable and has no forwarding address.
*
* This status code is commonly used when the server does not wish to reveal exactly
* why the request has been refused, or when no other response is applicable.
*/
HttpStatusCodes[HttpStatusCodes["NotFound"] = 404] = "NotFound";
/**
* The method specified in the Request-Line is not allowed for the resource identified
* by the Request-URI. The response MUST include an Allow header containing a list of
* valid methods for the requested resource.
*/
HttpStatusCodes[HttpStatusCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
/**
* The client did not produce a request within the time that the server was
* prepared to wait. The client MAY repeat the request without modifications
* at any later time.
*/
HttpStatusCodes[HttpStatusCodes["RequestTimeout"] = 408] = "RequestTimeout";
/**
* The request could not be completed due to a conflict with the current state of the
* resource. This code is only allowed in situations where it is expected that the
* user might be able to resolve the conflict and resubmit the request. The response
* body SHOULD include enough information for the user to recognize the source of the
* conflict. Ideally, the response entity would include enough information for the
* user or user agent to fix the problem; however, that might not be possible and
* is not required.
*
* Conflicts are most likely to occur in response to a PUT request. For example,
* if versioning were being used and the entity being PUT included changes to a resource
* which conflict with those made by an earlier (third-party) request, the server might
* use the 409 response to indicate that it can't complete the request. In this case,
* the response entity would likely contain a list of the differences between the
* two versions in a format defined by the response Content-Type.
*/
HttpStatusCodes[HttpStatusCodes["Conflict"] = 409] = "Conflict";
/**
* The requested resource is no longer available at the server and no forwarding address
* is known. This condition is expected to be considered permanent. Clients with link
* editing capabilities SHOULD delete references to the Request-URI after user approval.
* If the server does not know, or has no facility to determine, whether or not the
* condition is permanent, the status code 404 (Not Found) SHOULD be used instead.
* This response is cacheable unless indicated otherwise.
*
* The 410 response is primarily intended to assist the task of web maintenance by
* notifying the recipient that the resource is intentionally unavailable and that
* the server owners desire that remote links to that resource be removed. Such an
* event is common for limited-time, promotional services and for resources belonging
* to individuals no longer working at the server's site. It is not necessary to mark
* all permanently unavailable resources as "gone" or to keep the mark for any length
* of time -- that is left to the discretion of the server owner.
*/
HttpStatusCodes[HttpStatusCodes["Gone"] = 410] = "Gone";
/**
* Indicates that the server refuses to brew coffee because it is, permanently, a teapot.
* A combined coffee/tea pot that is temporarily out of coffee should instead return 503.
* This error is a reference to Hyper Text Coffee Pot Control Protocol defined in April
* Fools' jokes in 1998 and 2014.
*/
HttpStatusCodes[HttpStatusCodes["IAmATeapot"] = 418] = "IAmATeapot";
HttpStatusCodes[HttpStatusCodes["UnprocessableEntity"] = 422] = "UnprocessableEntity";
/**
* The 429 status code indicates that the user has sent too many requests in a given
* amount of time ("rate limiting").
*/
HttpStatusCodes[HttpStatusCodes["TooManyRequests"] = 429] = "TooManyRequests";
/**
* The server encountered an unexpected condition which prevented it from fulfilling
* the request.
*/
HttpStatusCodes[HttpStatusCodes["InternalServerError"] = 500] = "InternalServerError";
/**
* The server does not support the functionality required to fulfill the request. This
* is the appropriate response when the server does not recognize the request method
* and is not capable of supporting it for any resource.
*/
HttpStatusCodes[HttpStatusCodes["NotImplemented"] = 501] = "NotImplemented";
/**
* The server, while acting as a gateway or proxy, received an invalid response from
* the upstream server it accessed in attempting to fulfill the request.
*/
HttpStatusCodes[HttpStatusCodes["BadGateway"] = 502] = "BadGateway";
/**
* Indicates that the server is not ready to handle the request.
*
* Common causes are a server that is down for maintenance or that is overloaded.
* This response should be used for temporary conditions and the `Retry-After` HTTP
* header should, if possible, contain the estimated time for the recovery of the
* service.
*/
HttpStatusCodes[HttpStatusCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
HttpStatusCodes[HttpStatusCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
/**
* The 511 status code indicates that the client needs to authenticate to gain
* network access.
*
* The response representation SHOULD contain a link to a resource that allows
* the user to submit credentials (e.g. with a HTML form).
*
* Note that the 511 response SHOULD NOT contain a challenge or the login interface
* itself, because browsers would show the login interface as being associated with
* the originally requested URL, which may cause confusion.
*/
HttpStatusCodes[HttpStatusCodes["AuthenticationRequired"] = 511] = "AuthenticationRequired";
})(HttpStatusCodes || (HttpStatusCodes = {}));
// polyfill Array.isArray if necessary
if (!Array.isArray) {
Array.isArray = function (arg) {
return Object.prototype.toString.call(arg) === "[object Array]";
};
}
const BASE_URL = "https://maps.googleapis.com/maps/api/js";
async function loadNow(library, apiKey) {
if (checkIfScriptTagExists(library)) {
return window.google;
}
await addScriptTagToBrowser(library, apiKey);
return window.google;
}
async function addScriptTagToBrowser(library, apiKey, options = {}) {
if (checkIfScriptTagExists(library)) {
console.info(`Attempt to add script tag for the "${library}" library in Google Maps ignored as this tag already exists in the DOM${apiKey ? " [ " + apiKey + "]" : ""}`);
return;
}
const timeout = async (howLong = 2000) => {
await wait(howLong);
throw new Error(`Timed out waiting for Google API to load [ ${library} / ${howLong} ]`);
};
const waitForLoad = () => {
var script = document.createElement("script");
script.id = `google-maps-${library}-js`;
script.src = getUrl(library, apiKey);
document.querySelector("head").appendChild(script);
return new Promise(resolve => {
window[`${library}LoaderCallback`] = () => {
resolve();
};
});
};
return Promise.race(options.timeout ? [timeout(options.timeout), waitForLoad()] : [waitForLoad()]);
}
function getUrl(library, apiKey, callback = true) {
let url = `${BASE_URL}?libraries=${library}&sensors=false`;
if (apiKey) {
url = `${url}&key=${apiKey}`;
}
if (callback) {
url = `${url}&callback=${library}LoaderCallback`;
}
return url;
}
function checkIfScriptTagExists(library, apiKey) {
const found = document.querySelector(`#google-maps-${library}-js`);
return Boolean(found);
}
const map = ref(null);
const api = ref(null);
const useMap = () => {
return { map, api };
};
const useSetupMapComponent = (componentName, events, options, emit) => {
let _component = null;
const component = ref(null);
const { map, api } = useMap();
watch([map, options], (_, __, onInvalidate) => {
if (map.value && api.value) {
component.value = _component = new api.value[componentName](Object.assign(Object.assign({}, options.value), { map: map.value }));
events.forEach(event => {
_component === null || _component === void 0 ? void 0 : _component.addListener(event, () => emit(event));
});
}
onInvalidate(() => {
var _a;
if (_component) {
(_a = api.value) === null || _a === void 0 ? void 0 : _a.event.clearInstanceListeners(_component);
_component.setMap(null);
}
});
});
return { component };
};
const mapEvents = [
'bounds_changed',
'center_changed',
'click',
'dblclick',
'drag',
'dragend',
'dragstart',
'heading_changed',
'idle',
'maptypeid_changed',
'mousemove',
'mouseout',
'mouseover',
'projection_changed',
'resize',
'rightclick',
'tilesloaded',
'tilt_changed',
'zoom_changed',
];
const markerEvents = [
'animation_changed',
'click',
'dblclick',
'rightclick',
'dragstart',
'dragend',
'drag',
'mouseover',
'mousedown',
'mouseup',
'draggable_changed',
'clickable_changed',
'cursor_changed',
'flat_changed',
'rightclick',
'zindex_changed',
'icon_changed',
'position_changed',
'shape_changed',
'title_changed',
'visible_changed',
];
const polylineEvents = [
'click',
'dblclick',
'drag',
'dragend',
'dragstart',
'mousedown',
'mousemove',
'mouseout',
'mouseover',
'mouseup',
'rightclick',
];
const polygonEvents = polylineEvents;
const rectangleEvents = polylineEvents.concat(['bounds_changed']);
const circleEvents = polylineEvents.concat(['center_changed', 'radius_changed']);
var script = defineComponent({
props: {
apiKey: String,
backgroundColor: String,
center: Object,
clickableIcons: { type: Boolean, default: undefined },
controlSize: Number,
disableDefaultUi: { type: Boolean, default: undefined },
disableDoubleClickZoom: { type: Boolean, default: undefined },
draggable: { type: Boolean, default: undefined },
draggableCursor: String,
draggingCursor: String,
fullscreenControl: { type: Boolean, default: undefined },
fullscreenControlPosition: String,
gestureHandling: String,
heading: Number,
keyboardShortcuts: { type: Boolean, default: undefined },
mapTypeControl: { type: Boolean, default: undefined },
mapTypeControlOptions: Object,
mapTypeId: {
type: [Number, String],
},
maxZoom: Number,
minZoom: Number,
noClear: { type: Boolean, default: undefined },
panControl: { type: Boolean, default: undefined },
panControlPosition: String,
restriction: Object,
rotateControl: { type: Boolean, default: undefined },
rotateControlPosition: String,
scaleControl: { type: Boolean, default: undefined },
scaleControlStyle: Number,
scrollwheel: { type: Boolean, default: undefined },
streetView: Object,
streetViewControl: { type: Boolean, default: undefined },
streetViewControlPosition: String,
styles: Array,
tilt: Number,
zoom: Number,
zoomControl: { type: Boolean, default: undefined },
zoomControlPosition: String,
},
setup(props, { emit }) {
const mapRef = ref(null);
const ready = ref(false);
const { map, api } = useMap();
const resolveOptions = () => {
var _a, _b, _c, _d, _e;
const opts = {
backgroundColor: props.backgroundColor,
center: props.center,
clickableIcons: props.clickableIcons,
controlSize: props.controlSize,
disableDefaultUI: props.disableDefaultUi,
disableDoubleClickZoom: props.disableDoubleClickZoom,
draggable: props.draggable,
draggableCursor: props.draggableCursor,
draggingCursor: props.draggingCursor,
fullscreenControl: props.fullscreenControl,
fullscreenControlOptions: props.fullscreenControlPosition
? {
position: (_a = api.value) === null || _a === void 0 ? void 0 : _a.ControlPosition[props.fullscreenControlPosition],
}
: {},
gestureHandling: props.gestureHandling,
heading: props.heading,
keyboardShortcuts: props.keyboardShortcuts,
mapTypeControl: props.mapTypeControl,
mapTypeControlOptions: props.mapTypeControlOptions,
mapTypeId: props.mapTypeId,
maxZoom: props.maxZoom,
minZoom: props.minZoom,
noClear: props.noClear,
panControl: props.panControl,
panControlOptions: props.panControlPosition
? {
position: (_b = api.value) === null || _b === void 0 ? void 0 : _b.ControlPosition[props.panControlPosition],
}
: {},
restriction: props.restriction,
rotateControl: props.rotateControl,
rotateControlOptions: props.rotateControlPosition
? {
position: (_c = api.value) === null || _c === void 0 ? void 0 : _c.ControlPosition[props.rotateControlPosition],
}
: {},
scaleControl: props.scaleControl,
scaleControlOptions: props.scaleControlStyle
? {
style: props.scaleControlStyle,
}
: {},
scrollwheel: props.scrollwheel,
streetView: props.streetView,
streetViewControl: props.streetViewControl,
streetViewControlOptions: props.streetViewControlPosition
? {
position: (_d = api.value) === null || _d === void 0 ? void 0 : _d.ControlPosition[props.streetViewControlPosition],
}
: {},
styles: props.styles,
tilt: props.tilt,
zoom: props.zoom,
zoomControl: props.zoomControl,
zoomControlOptions: props.zoomControlPosition
? {
position: (_e = api.value) === null || _e === void 0 ? void 0 : _e.ControlPosition[props.zoomControlPosition],
}
: {},
};
// Strip undefined keys. Without this Map.setOptions doesn't behave very well.
Object.keys(opts).forEach(key => opts[key] === undefined && delete opts[key]);
return opts;
};
onBeforeUnmount(() => {
var _a;
if (map.value) {
(_a = api.value) === null || _a === void 0 ? void 0 : _a.event.clearInstanceListeners(map.value);
}
});
// Only run this in a browser env since it needs to use the `document` object
// and would error out in a node env (i.e. vitepress/vuepress SSR)
if (typeof window !== 'undefined') {
loadNow('places', props.apiKey).then(({ maps }) => {
const { Map } = (api.value = maps);
map.value = new Map(mapRef.value, resolveOptions());
mapEvents.forEach(event => {
var _a;
(_a = map.value) === null || _a === void 0 ? void 0 : _a.addListener(event, () => emit(event));
});
ready.value = true;
const otherPropsAsRefs = Object.keys(props)
.filter(key => !['center', 'zoom'].includes(key))
.map(key => toRef(props, key));
watch([() => props.center, () => props.zoom, ...otherPropsAsRefs], ([center, zoom], [oldCenter, oldZoom]) => {
var _a, _b, _c;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const _d = resolveOptions(), otherOptions = __rest(_d, ["center", "zoom"]);
(_a = map.value) === null || _a === void 0 ? void 0 : _a.setOptions(otherOptions);
if (zoom !== undefined && zoom !== oldZoom) {
(_b = map.value) === null || _b === void 0 ? void 0 : _b.setZoom(zoom);
}
if (center) {
if (!oldCenter || center.lng !== oldCenter.lng || center.lat !== oldCenter.lat) {
(_c = map.value) === null || _c === void 0 ? void 0 : _c.panTo(center);
}
}
});
});
}
return { mapRef, ready, map, api };
},
});
const _hoisted_1 = { ref: "mapRef" };
function render(_ctx, _cache, $props, $setup, $data, $options) {
return (openBlock(), createBlock("div", _hoisted_1, [
renderSlot(_ctx.$slots, "default")
], 512 /* NEED_PATCH */))
}
script.render = render;
script.__file = "src/components/GoogleMap.vue";
var Marker = defineComponent({
props: {
options: {
type: Object,
required: true,
},
},
setup(props, { emit }) {
const options = toRef(props, 'options');
const marker = useSetupMapComponent('Marker', markerEvents, options, emit);
return { marker };
},
render: () => null,
});
var Polyline = defineComponent({
props: {
options: {
type: Object,
required: true,
},
},
setup(props, { emit }) {
const options = toRef(props, 'options');
const polyline = useSetupMapComponent('Polyline', polylineEvents, options, emit);
return { polyline };
},
render: () => null,
});
var Polygon = defineComponent({
props: {
options: {
type: Object,
required: true,
},
},
setup(props, { emit }) {
const options = toRef(props, 'options');
const polygon = useSetupMapComponent('Polygon', polygonEvents, options, emit);
return { polygon };
},
render: () => null,
});
var Rectangle = defineComponent({
props: {
options: {
type: Object,
required: true,
},
},
setup(props, { emit }) {
const options = toRef(props, 'options');
const rectangle = useSetupMapComponent('Rectangle', rectangleEvents, options, emit);
return { rectangle };
},
render: () => null,
});
var Circle = defineComponent({
props: {
options: {
type: Object,
required: true,
},
},
setup(props, { emit }) {
const options = toRef(props, 'options');
const circle = useSetupMapComponent('Circle', circleEvents, options, emit);
return { circle };
},
render: () => null,
});
var script$1 = defineComponent({
props: {
position: {
type: String,
required: true,
},
index: Number,
},
setup(props) {
const controlRef = ref(null);
const { map, api } = useMap();
watch([map, () => props.position, () => props.index], (_, oldValues, onInvalidate) => {
if (map.value && api.value) {
if (props.index) {
controlRef.value.index = props.index;
}
if (controlRef.value) {
map.value.controls[api.value.ControlPosition[props.position]].push(controlRef.value);
}
}
onInvalidate(() => {
if (map.value && api.value && controlRef.value) {
let index = undefined;
// Not a native array so we have to iterate using forEach of MVCArray:
// https://developers.google.com/maps/documentation/javascript/reference/event?hl=en#MVCArray
map.value.controls[api.value.ControlPosition[oldValues[1]]].forEach((c, i) => {
if (c === controlRef.value) {
index = i;
}
});
if (index) {
map.value.controls[api.value.ControlPosition[oldValues[1]]].removeAt(index);
}
}
});
});
return { controlRef };
},
});
const _hoisted_1$1 = { ref: "controlRef" };
function render$1(_ctx, _cache, $props, $setup, $data, $options) {
return (openBlock(), createBlock("div", _hoisted_1$1, [
renderSlot(_ctx.$slots, "default")
], 512 /* NEED_PATCH */))
}
script$1.render = render$1;
script$1.__file = "src/components/CustomControl.vue";
export { Circle, script$1 as CustomControl, script as GoogleMap, Marker, Polygon, Polyline, Rectangle };
*****************************************************************************/
async function b(a){return new Promise(c=>setTimeout(c,a))}var p,q=p||(p={});q[q.Continue=100]="Continue";q[q.Success=200]="Success";q[q.Created=201]="Created";q[q.Accepted=202]="Accepted";q[q.NoContent=204]="NoContent";q[q.MovedPermenantly=301]="MovedPermenantly";q[q.TemporaryRedirect=307]="TemporaryRedirect";q[q.NotModified=304]="NotModified";q[q.BadRequest=400]="BadRequest";q[q.Unauthorized=401]="Unauthorized";q[q.PaymentRequired=402]="PaymentRequired";q[q.Forbidden=403]="Forbidden";
q[q.NotFound=404]="NotFound";q[q.MethodNotAllowed=405]="MethodNotAllowed";q[q.RequestTimeout=408]="RequestTimeout";q[q.Conflict=409]="Conflict";q[q.Gone=410]="Gone";q[q.IAmATeapot=418]="IAmATeapot";q[q.UnprocessableEntity=422]="UnprocessableEntity";q[q.TooManyRequests=429]="TooManyRequests";q[q.InternalServerError=500]="InternalServerError";q[q.NotImplemented=501]="NotImplemented";q[q.BadGateway=502]="BadGateway";q[q.ServiceUnavailable=503]="ServiceUnavailable";q[q.GatewayTimeout=504]="GatewayTimeout";
q[q.AuthenticationRequired=511]="AuthenticationRequired";Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)});async function t(a,c){if(document.querySelector(`#google-maps-${a}-js`))return window.google;await u(a,c);return window.google}
async function u(a,c,f={}){if(document.querySelector(`#google-maps-${a}-js`))console.info(`Attempt to add script tag for the "${a}" library in Google Maps ignored as this tag already exists in the DOM${c?" [ "+c+"]":""}`);else{var d=async(c=2E3)=>{await b(c);throw Error(`Timed out waiting for Google API to load [ ${a} / ${c} ]`);},e=()=>{var e=document.createElement("script");e.id=`google-maps-${a}-js`;e.src=y(a,c);document.querySelector("head").appendChild(e);return new Promise(c=>{window[`${a}LoaderCallback`]=
()=>{c()}})};return Promise.race(f.timeout?[d(f.timeout),e()]:[e()])}}function y(a,c,f=!0){let d=`${"https://maps.googleapis.com/maps/api/js"}?libraries=${a}&sensors=false`;c&&(d=`${d}&key=${c}`);f&&(d=`${d}&callback=${a}LoaderCallback`);return d}
let z=ref(null),A=ref(null),B=(a,c,f,d)=>{let e=null;const g=ref(null),{map:k,api:h}={map:z,api:A};watch([k,f],(v,R,F)=>{k.value&&h.value&&(g.value=e=new h.value[a](Object.assign(Object.assign({},f.value),{map:k.value})),c.forEach(a=>{null===e||void 0===e?void 0:e.addListener(a,()=>d(a))}));F(()=>{var a;e&&(null===(a=h.value)||void 0===a?void 0:a.event.clearInstanceListeners(e),e.setMap(null))})});return{component:g}},C="bounds_changed center_changed click dblclick drag dragend dragstart heading_changed idle maptypeid_changed mousemove mouseout mouseover projection_changed resize rightclick tilesloaded tilt_changed zoom_changed".split(" "),
D="animation_changed click dblclick rightclick dragstart dragend drag mouseover mousedown mouseup draggable_changed clickable_changed cursor_changed flat_changed rightclick zindex_changed icon_changed position_changed shape_changed title_changed visible_changed".split(" "),E="click dblclick drag dragend dragstart mousedown mousemove mouseout mouseover mouseup rightclick".split(" "),G=E.concat(["bounds_changed"]),H=E.concat(["center_changed","radius_changed"]);
var I=defineComponent({props:{apiKey:String,backgroundColor:String,center:Object,clickableIcons:{type:Boolean,default:void 0},controlSize:Number,disableDefaultUi:{type:Boolean,default:void 0},disableDoubleClickZoom:{type:Boolean,default:void 0},draggable:{type:Boolean,default:void 0},draggableCursor:String,draggingCursor:String,fullscreenControl:{type:Boolean,default:void 0},fullscreenControlPosition:String,gestureHandling:String,heading:Number,keyboardShortcuts:{type:Boolean,default:void 0},mapTypeControl:{type:Boolean,
default:void 0},mapTypeControlOptions:Object,mapTypeId:{type:[Number,String]},maxZoom:Number,minZoom:Number,noClear:{type:Boolean,default:void 0},panControl:{type:Boolean,default:void 0},panControlPosition:String,restriction:Object,rotateControl:{type:Boolean,default:void 0},rotateControlPosition:String,scaleControl:{type:Boolean,default:void 0},scaleControlStyle:Number,scrollwheel:{type:Boolean,default:void 0},streetView:Object,streetViewControl:{type:Boolean,default:void 0},streetViewControlPosition:String,
styles:Array,tilt:Number,zoom:Number,zoomControl:{type:Boolean,default:void 0},zoomControlPosition:String},setup(a,{emit:c}){let f=ref(null),d=ref(!1),{map:e,api:g}={map:z,api:A},k=()=>{var c,e,d,f,k;const r={backgroundColor:a.backgroundColor,center:a.center,clickableIcons:a.clickableIcons,controlSize:a.controlSize,disableDefaultUI:a.disableDefaultUi,disableDoubleClickZoom:a.disableDoubleClickZoom,draggable:a.draggable,draggableCursor:a.draggableCursor,draggingCursor:a.draggingCursor,fullscreenControl:a.fullscreenControl,
fullscreenControlOptions:a.fullscreenControlPosition?{position:null===(c=g.value)||void 0===c?void 0:c.ControlPosition[a.fullscreenControlPosition]}:{},gestureHandling:a.gestureHandling,heading:a.heading,keyboardShortcuts:a.keyboardShortcuts,mapTypeControl:a.mapTypeControl,mapTypeControlOptions:a.mapTypeControlOptions,mapTypeId:a.mapTypeId,maxZoom:a.maxZoom,minZoom:a.minZoom,noClear:a.noClear,panControl:a.panControl,panControlOptions:a.panControlPosition?{position:null===(e=g.value)||void 0===e?void 0:
e.ControlPosition[a.panControlPosition]}:{},restriction:a.restriction,rotateControl:a.rotateControl,rotateControlOptions:a.rotateControlPosition?{position:null===(d=g.value)||void 0===d?void 0:d.ControlPosition[a.rotateControlPosition]}:{},scaleControl:a.scaleControl,scaleControlOptions:a.scaleControlStyle?{style:a.scaleControlStyle}:{},scrollwheel:a.scrollwheel,streetView:a.streetView,streetViewControl:a.streetViewControl,streetViewControlOptions:a.streetViewControlPosition?{position:null===(f=g.value)||
void 0===f?void 0:f.ControlPosition[a.streetViewControlPosition]}:{},styles:a.styles,tilt:a.tilt,zoom:a.zoom,zoomControl:a.zoomControl,zoomControlOptions:a.zoomControlPosition?{position:null===(k=g.value)||void 0===k?void 0:k.ControlPosition[a.zoomControlPosition]}:{}};Object.keys(r).forEach(a=>void 0===r[a]&&delete r[a]);return r};onBeforeUnmount(()=>{var a;e.value&&(null===(a=g.value)||void 0===a?void 0:a.event.clearInstanceListeners(e.value))});"undefined"!==typeof window&&t("places",a.apiKey).then(({maps:h})=>
{({Map:h}=g.value=h);e.value=new h(f.value,k());C.forEach(a=>{var d;null===(d=e.value)||void 0===d?void 0:d.addListener(a,()=>c(a))});d.value=!0;h=Object.keys(a).filter(a=>!["center","zoom"].includes(a)).map(c=>toRef(a,c));watch([()=>a.center,()=>a.zoom,...h],([a,c],[d,f])=>{var g,h,w,m=k(),v=["center","zoom"],x={},l;for(l in m)Object.prototype.hasOwnProperty.call(m,l)&&0>v.indexOf(l)&&(x[l]=m[l]);if(null!=m&&"function"===typeof Object.getOwnPropertySymbols){var n=0;for(l=Object.getOwnPropertySymbols(m);n<
l.length;n++)0>v.indexOf(l[n])&&Object.prototype.propertyIsEnumerable.call(m,l[n])&&(x[l[n]]=m[l[n]])}null===(g=e.value)||void 0===g?void 0:g.setOptions(x);void 0!==c&&c!==f&&(null===(h=e.value)||void 0===h?void 0:h.setZoom(c));!a||d&&a.lng===d.lng&&a.lat===d.lat||(null===(w=e.value)||void 0===w?void 0:w.panTo(a))})});return{mapRef:f,ready:d,map:e,api:g}}});let J={ref:"mapRef"};I.render=function(a){return openBlock(),createBlock("div",J,[renderSlot(a.$slots,"default")],512)};I.__file="src/components/GoogleMap.vue";
var K=defineComponent({props:{options:{type:Object,required:!0}},setup(a,{emit:c}){a=toRef(a,"options");return{marker:B("Marker",D,a,c)}},render:()=>null}),L=defineComponent({props:{options:{type:Object,required:!0}},setup(a,{emit:c}){a=toRef(a,"options");return{polyline:B("Polyline",E,a,c)}},render:()=>null}),M=defineComponent({props:{options:{type:Object,required:!0}},setup(a,{emit:c}){a=toRef(a,"options");return{polygon:B("Polygon",E,a,c)}},render:()=>null}),N=defineComponent({props:{options:{type:Object,
required:!0}},setup(a,{emit:c}){a=toRef(a,"options");return{rectangle:B("Rectangle",G,a,c)}},render:()=>null}),O=defineComponent({props:{options:{type:Object,required:!0}},setup(a,{emit:c}){a=toRef(a,"options");return{circle:B("Circle",H,a,c)}},render:()=>null}),P=defineComponent({props:{position:{type:String,required:!0},index:Number},setup(a){let c=ref(null),{map:f,api:d}={map:z,api:A};watch([f,()=>a.position,()=>a.index],(e,g,k)=>{f.value&&d.value&&(a.index&&(c.value.index=a.index),c.value&&f.value.controls[d.value.ControlPosition[a.position]].push(c.value));
k(()=>{if(f.value&&d.value&&c.value){let a=void 0;f.value.controls[d.value.ControlPosition[g[1]]].forEach((d,e)=>{d===c.value&&(a=e)});a&&f.value.controls[d.value.ControlPosition[g[1]]].removeAt(a)}})});return{controlRef:c}}});let Q={ref:"controlRef"};P.render=function(a){return openBlock(),createBlock("div",Q,[renderSlot(a.$slots,"default")],512)};P.__file="src/components/CustomControl.vue";
export{O as Circle,P as CustomControl,I as GoogleMap,K as Marker,M as Polygon,L as Polyline,N as Rectangle}

6

package.json
{
"name": "vue3-google-map",
"version": "0.2.0",
"version": "0.3.0",
"license": "MIT",

@@ -25,3 +25,4 @@ "repository": {

"lint:autofix": "yarn lint --fix",
"build": "run-s clear autoindex build:lib build:types",
"build": "run-s clear autoindex build:closure build:types",
"build:closure": "node ./build/build cjs es --min --closure",
"build:lib": "node ./build/build cjs es --min",

@@ -36,2 +37,3 @@ "build:types": "echo - Building types && tsc -P tsconfig.es.json --outDir dist/types --declaration",

"devDependencies": {
"@ampproject/rollup-plugin-closure-compiler": "^0.26.0",
"@rollup/plugin-commonjs": "^16.0.0",

@@ -38,0 +40,0 @@ "@rollup/plugin-node-resolve": "^10.0.0",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc