MCPcopy Create free account
hub / github.com/DHTMLX/scheduler / initialize

Method initialize

codebase/dhtmlxscheduler.es.js:4969–4989  ·  view source on GitHub ↗
(i, t)

Source from the content-addressed store, hash-verified

4967 }
4968 }
4969 initialize(i, t) {
4970 this.settings = t;
4971 let n = this.scheduler, s = { center: { lat: t.initial_position.lat, lng: t.initial_position.lng }, zoom: t.initial_zoom, mapId: i.id, scrollwheel: !0, mapTypeId: t.type };
4972 if (this.map === null)
4973 this.map = new google.maps.Map(i, s);
4974 else {
4975 let a = this.map;
4976 i.appendChild(this.map.__gm.messageOverlay), i.appendChild(this.map.__gm.outerContainer), setTimeout(function() {
4977 a.setOptions({ container: i.id });
4978 }, 500);
4979 }
4980 google.maps.event.addListener(this.map, "dblclick", function(a) {
4981 const o = new google.maps.Geocoder();
4982 if (!n.config.readonly && n.config.dblclick_create) {
4983 let _ = a.latLng;
4984 o.geocode({ latLng: _ }, function(r, d) {
4985 d == google.maps.GeocoderStatus.OK ? (_ = r[0].geometry.location, n.addEventNow({ lat: _.lat(), lng: _.lng(), event_location: r[0].formatted_address, start_date: n.getState().date, end_date: n.date.add(n.getState().date, n.config.time_step, "minute") })) : console.error("Geocode was not successful for the following reason: " + d);
4986 });
4987 }
4988 });
4989 }
4990 destroy(i) {
4991 for (google.maps.event.clearInstanceListeners(window), google.maps.event.clearInstanceListeners(document), google.maps.event.clearInstanceListeners(i); i.firstChild; )
4992 i.firstChild.remove();

Callers 1

Calls 3

addEventNowMethod · 0.65
getStateMethod · 0.65
addMethod · 0.65

Tested by

no test coverage detected