MCPcopy Create free account
hub / github.com/Maps4HTML/MapML.js / resolve

Method resolve

src/map-link.js:1057–1080  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1055
1056 // Resolve the templated URL with info from the sibling map-input's
1057 resolve() {
1058 if (this.tref) {
1059 let obj = {};
1060 const inputs = this.parentElement.querySelectorAll('map-input');
1061 if (this.rel === 'image') {
1062 // image/map
1063 for (let i = 0; i < inputs.length; i++) {
1064 const inp = inputs[i];
1065 obj[inp.name] = inp.value;
1066 }
1067 console.log(obj); // DEBUGGING
1068 return LeafletUtil.template(this.tref, obj);
1069 } else if (this.rel === 'tile') {
1070 // TODO. Need to get tile coords from moveend
1071 // should be done/called from the TemplatedTilelayer.js file
1072 return obj;
1073 } else if (this.rel === 'query') {
1074 // TODO. Need to get the click coords from click event
1075 // should be done/called from the templatedlayer.js file
1076 } else if (this.rel === 'features') {
1077 // TODO.
1078 }
1079 }
1080 }
1081 whenReady() {
1082 return new Promise((resolve, reject) => {
1083 let interval, failureTimer, ready;

Callers 3

hrefMethod · 0.95
loadFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected