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

Method resolveAddress

codebase/sources/dhtmlxscheduler.js:13824–13834  ·  view source on GitHub ↗
(string)

Source from the content-addressed store, hash-verified

13822 this.map.setZoom(zoom);
13823 }
13824 async resolveAddress(string) {
13825 let response = await fetch(`https://api.mapbox.com/geocoding/v5/mapbox.places/${string}.json?access_token=${this.settings.accessToken}`).then((response2) => response2.json());
13826 let position = {};
13827 if (response && response.features.length) {
13828 position.lng = response.features[0].center[0];
13829 position.lat = response.features[0].center[1];
13830 } else {
13831 console.error(`Unable recieve a position of the event's location: ${string}`);
13832 }
13833 return position;
13834 }
13835 }
13836 function map_view(scheduler2) {
13837 let mapAdapter = null;

Callers 2

addEventWithLocationFunction · 0.45
_updateEventLocationFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected