How to use source loader-factory
See original GitHub issueHello @ghettovoice,
I hope you are fine. I am updating vuelayers. I was using 0.11.5-beta.8. In that version, the method loader-factory had a parameter which was the source, but now this is not the case anymore.
How should it be used now? This was my code, in which you can see I used the URL from the source:
loaderFactory(vm) {
return (extent, resolution, projection) => {
let url = vm.$source.getUrl()
if (typeof url === 'function') {
url = url(extent, resolution, projection)
}
if (!url) {
return []
}
return fetch(url, {
credentials: 'same-origin',
mode: 'cors',
}).then(response => response.text())
.then(async text => {
if (!vm.$source) {
return []
}
// Some extra things I did for offline mode were here using the url
return vm.$source.getFormat().readFeatures(text, {
featureProjection: vm.viewProjection,
dataProjection: vm.resolvedDataProjection,
})
})
.catch(async error => {
// Some extra things I did for offline mode were here using the url
return vm.$source.getFormat().readFeatures(text, {
featureProjection: vm.viewProjection,
dataProjection: vm.resolvedDataProjection,
})
})
}
},
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Document in the `loaderFactory` in the docs · Issue #9 - GitHub
While perusing the docs, I noticed that the loaderFactory static method is not documented in the batchLoader docs.
Read more >tensorflow::serving::CachingManager::LoaderFactory Class ...
Creates servable data consisting of the loader corresponding to the servable-id. GetServableVersion(const string & servable_name, ...
Read more >Enabling cache loaders and cache writers - IBM
You can use a CacheLoader to fetch data from an external source to cache. ... Example 2: Use a loader factory --> <backingMap...
Read more >jsonLoader.go - external/github.com/xeipuuv/gojsonschema - Git at ...
New creates a new JSON loader for the given source. New(source string) JSONLoader. } // DefaultJSONLoaderFactory is the default JSON loader factory.
Read more >5.3. Table Loader Factory Classes
File Loader Factory¶ ... TableFileLoaderFactory(source, encoding=None)[source]¶. Parameters ... Built with Sphinx using a theme provided by Read the Docs.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In this case each source should use it’s own loader factory with enclosed context variables. I would make this like this:
Then int template
I don’t actually know how you add layers/source on the map. I guess you load layers configuration from somewhere and then adds them with v-for
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.