only prefix with grafana public path if relative url
This commit is contained in:
@@ -78,9 +78,11 @@ export const geojsonLayer: MapLayerRegistryItem<GeoJSONMapperConfig> = {
|
||||
|
||||
// Interpolate variables in the URL
|
||||
const interpolatedUrl = getTemplateSrv().replace(config.src || '');
|
||||
const isAbsoluteUrl = interpolatedUrl.startsWith('http');
|
||||
const layerUrl = isAbsoluteUrl ? interpolatedUrl : `${window.__grafana_public_path__}${interpolatedUrl.replace(/^(public\/)/, '')}`;
|
||||
|
||||
const source = new VectorSource({
|
||||
url: `${window.__grafana_public_path__}build/${interpolatedUrl.replace(/^(public\/)/, '')}`,
|
||||
url: layerUrl,
|
||||
format: new GeoJSON(),
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user