Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
sourceParams.DPI = dpi;
sourceParams.MAP_RESOLUTION = dpi;
sourceParams.FORMAT_OPTIONS = 'dpi:' + dpi;
if (options.refreshIntervalSec && options.refreshIntervalSec > 0) {
setInterval(() => {
this.refresh();
}, options.refreshIntervalSec * 1000); // Convert seconds to MS
}
let fieldNameGeometry = defaultFieldNameGeometry;
// #### START if paramsWFS
if (options.paramsWFS) {
const wfsCheckup = checkWfsParams(options, 'wms');
ObjectUtils.mergeDeep(options.paramsWFS, wfsCheckup.paramsWFS);
fieldNameGeometry =
options.paramsWFS.fieldNameGeometry || fieldNameGeometry;
options.download = Object.assign({}, options.download, {
dynamicUrl: this.buildDynamicDownloadUrlFromParamsWFS(options)
});
} // #### END if paramsWFS
if (!options.sourceFields || options.sourceFields.length === 0) {
options.sourceFields = [];
} else {
options.sourceFields.forEach(sourceField => {
sourceField.alias = sourceField.alias
? sourceField.alias
: sourceField.name;
positionHComment += 20;
} else {
// Don't cut last part
newContext.fillText(
comment.substr(positionFirstCutChar),
width / 2,
positionHComment
);
}
}
}
}
// Add map to new canvas
newContext.drawImage(context.canvas, 0, positionHCanvas);
let status = SubjectStatus.Done;
try {
// Save the canvas as file
if (!doZipFile) {
this.saveCanvasImageAsFile(newCanvas, 'map', format);
} else if (format.toLowerCase() === 'tiff') {
// Add the canvas to zip
this.generateCanvaFileToZip(
newCanvas,
'map' + map.projection.replace(':', '_') + '.' + format
);
} else {
// Add the canvas to zip
this.generateCanvaFileToZip(newCanvas, 'map' + '.' + format);
}
} catch (err) {
status = SubjectStatus.Error;
private handleLoadStart(event: any) {
// This is to avoid increasing
// the number of loaded tiles if a tile was loading
// before subscribing to this watcher
if (!event.tile.__watchers__) {
event.tile.__watchers__ = [];
}
event.tile.__watchers__.push(this.id);
this.loading += 1;
this.status = SubjectStatus.Working;
}
public handleFormSubmit(value) {
let inputs = Object.assign({}, value);
inputs = ObjectUtils.removeNull(inputs);
inputs.uri = inputs.uri.replace(' ', '');
if (inputs.uri) {
inputs.uri = this.prefix + '-' + inputs.uri;
} else {
inputs.uri = this.prefix;
}
this.submitForm.emit(inputs);
}
public handleFormSubmit(value) {
let inputs = Object.assign({}, value);
inputs = ObjectUtils.removeNull(inputs);
inputs.uri = inputs.uri.replace(' ', '');
if (inputs.uri) {
inputs.uri = this.prefix + '-' + inputs.uri;
} else {
inputs.uri = this.prefix;
}
this.submitForm.emit(inputs);
}
const geometry = olFormat.writeGeometryObject(olFeature.getGeometry(), {
dataProjection: projectionOut,
featureProjection: projectionIn
});
if (olLayer) {
title = olLayer.get('title');
if (olLayer.get('sourceOptions')) {
exclude = olLayer.get('sourceOptions').excludeAttribute;
excludeOffline = olLayer.get('sourceOptions').excludeAttributeOffline;
}
} else {
title = olFeature.get('_title');
}
const mapTitle = olFeature.get('_mapTitle');
const id = olFeature.getId() ? olFeature.getId() : uuid();
return {
type: FEATURE,
projection: projectionOut,
extent: olFeature.get('_extent'),
meta: {
id,
title: title ? title : mapTitle ? mapTitle : id,
mapTitle,
revision: olFeature.getRevision(),
style: olFeature.get('_style'),
excludeAttribute: exclude,
excludeAttributeOffline: excludeOffline
},
properties,
geometry,
const shownProperties = {};
this.allowedProperties.forEach(key => {
if (properties.hasOwnProperty(key)) {
const aliasProperty = this.propertiesAlias.filter(f => f.name === key)[0];
shownProperties[aliasProperty.alias] = properties[key];
}
});
delete properties.id;
delete properties.recherche;
delete properties.type;
delete properties.coord_x;
delete properties.coord_y;
delete properties.cote;
return {
id: uuid(),
source: ReseauTransportsQuebecSearchSource._name,
sourceType: SourceFeatureType.Search,
order: 1,
zoomMaxOnSelect,
type: FeatureType.Feature,
format: FeatureFormat.GeoJSON,
title: properties.title,
titleHtml,
icon,
projection: 'EPSG:4326',
properties: shownProperties,
geometry: result.geometry,
extent: result.bbox
};
}
}
private buildForm(): void {
const id = uuid();
let title = 'Partage ';
title += this.userId ? `(${this.userId}-${id})` : `(${id})`;
this.form = this.formBuilder.group({
title: [title],
uri: [id]
});
}
}
protected generateId() {
if (!this.options.url) {
return uuid();
}
const chain = 'feature' + this.options.url;
return Md5.hashStr(chain) as string;
}
protected generateId() {
return uuid();
}