|
POST
|
I'm going to try getting a HAR capture, if I do I'll attach it.
... View more
09-23-2020
10:05 AM
|
0
|
0
|
2790
|
|
POST
|
Good Day This issue disappeared for months but now it's popping up, but I can't seem to figure out any pattern. Would it be possible to edit the error message to show what's happening to help debugging, or catch the error in dojo-lite and discard it? I haven't been able to make a source repo that demonstrates the problem. Thanks
... View more
09-23-2020
09:59 AM
|
0
|
3
|
2434
|
|
POST
|
Okay, I have a potential workaround on my end but it's less then ideal. If there's no simple / non-hackish ways to pull this off then I see about editing my code. Thanks!
... View more
09-17-2020
03:29 PM
|
1
|
0
|
1040
|
|
POST
|
Good Day Is there a way to build in a custom legend with the Print Task output? Assuming I have the following output Can I have only one set of data per geometry shown in the legend, without restructuring how our data is broken down by feature layer? Ideally I'd want to change the legend based on the condition at the time the printMap function is executed. My Print Code: printMap() {
const printTask = this.PrintTask({
url: 'https://utility.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task'
});
const template = new this.PrintTemplate({
format: 'jpg',
layout: 'a4-landscape',
layoutOptions: {
titleText: '',
authorText: 'Infrasol'
}
});
const params = new this.PrintParameters({
view: this._view,
template: template
});
this.printProgress = true;
printTask.execute(params).then( (result) => {
this.printProgress = false;
window.open(result.url);
}, (err) => {
this.printProgress = false;
console.log('ESRI Print Task Error: ', err);
});
} Thanks
... View more
09-15-2020
12:37 PM
|
0
|
2
|
1087
|
|
POST
|
Good Day Thanks for the suggestions, that was the problem! When I changed it to simple-line the problem went away. I removed the style: null, it wasn't relevant for our actual code base and the same problem persisted on 4.16. Thanks for your help.
... View more
09-12-2020
09:50 AM
|
1
|
1
|
3111
|
|
POST
|
GitHub - docmur/esri-printtask-issue If you run that project and press the print button you'll get:
... View more
08-27-2020
08:28 AM
|
0
|
0
|
3111
|
|
POST
|
Thanks for the reply: API Version: 4.14 Example Print Task: Example using the Print Widget Example using the screenshot (Works but doesn't have the template) I generate the polyline geoJSON with this: if (coordinateText) {
const _temp = WKT.parse(coordinateText);
if (_temp) {
let geometry;
switch (_temp.type) {
case 'LineString':
geometry = {
type: 'polyline',
paths: 'coordinates' in _temp ? _temp.coordinates : null,
}
break;
case 'Polygon':
geometry = {
type: 'polygon',
rings: 'coordinates' in _temp ? _temp.coordinates : null,
}
break;
default:
break;
}
return {
geometry: _.cloneDeep(geometry),
attributes: {
ObjectID: randomObjectID,
colour: _.cloneDeep(entry.colour),
}
};
}
} Then I build the Feature Layers with: buildFeatureSettings(geometryType, data, colour) {
return {
source: data,
renderer: this.buildRenderSettings(data, colour, geometryType.toString().includes('point')),
fields: this._fields,
objectIdField: 'ObjectID',
geometryType: geometryType,
spatialReference: {
wkid: 4326
},
title: 'Random Title'
};
}
buildRenderSettings(data, colour: string, marker = false) {
return {
type: 'simple',
symbol: {
style: marker ? 'circle' : null,
type: marker ? 'simple-marker' : 'simple-fill',
size: marker ? 12 : 30,
color: _.cloneDeep(colour),
outline: {
width: 4,
color: _.cloneDeep(colour),
}
},
}
} Thanks for you assistance, I can try throwing together a code sample a bit later. Thanks
... View more
08-26-2020
03:03 PM
|
0
|
2
|
3111
|
|
POST
|
I got this working, must have forgotten to update this thread. We actually ran into a new issue where the polylines don't have colour but the points do: https://community.esri.com/thread/257431-printtemplate-polylines-show-with-no-colour-points-are-fine Not really sure what's going on, I can't see anywhere to set a colour on the Feature Layer. As for this thread it's completed as I can the Print Task generating a printable document. Thanks
... View more
08-26-2020
02:10 PM
|
2
|
0
|
6736
|
|
POST
|
Found a good enough workaround, if you call window.location.reload() inside ngOnDestroy of any page that hosts the maps, the memory will be freed, which is what we're doing.
... View more
08-26-2020
09:57 AM
|
0
|
1
|
3725
|
|
POST
|
Good Afternoon I'll give this a try and let you know how it works.
... View more
08-13-2020
11:53 AM
|
0
|
0
|
3725
|
|
POST
|
Good Day Solid name Do you have an example of how to use a service to maintain the same view across several maps? I wrote this function, which lives in a service (esri-service.ts), which is separate from the esri-map-controller.ts: initMap(mapContainer: ElementRef) {
return new Promise( (r, j) => {
loadModules([
'esri/Map',
'esri/views/MapView',
]).then(([
EsriMap,
EsriMapView,
]) => {
if (this._map === null && this._view === null) {
console.log('\n\nAllocating new Map!!!\n\n');
const mapProperties: esri.MapProperties = {
basemap: this._basemap,
};
this._map = new EsriMap(mapProperties);
const mapViewProperties: esri.MapViewProperties = {
container: mapContainer.nativeElement,
center: this._center,
zoom: this._zoom,
map: this._map
};
this._view = new EsriMapView(mapViewProperties);
r({
map: this._map,
view: this._view
});
} else {
console.log('\n\nUsing Existing!!!\n\n');
const reAllocateMap = false;
if (reAllocateMap) {
const mapProperties: esri.MapProperties = {
basemap: this._basemap,
};
this._map = new EsriMap(mapProperties);
this._view.map = this._map;
}
this._view.container = mapContainer.nativeElement;
r({
map: this._map,
view: this._view
});
}
});
})
} The first time I call this I get a map and view and everything works fine, but when I call it a second time to get the view, then swap the ElementRef, the map appears but I can't interact with it. If I change the code and allocate a new map object then assign it into the view, I get a fully interactive view and map back, but the memory usage goes way up again, which is the problem I'm trying to work around. When I look at the detached memory, I see a bunch of references to MapView.js and engine.js from an arcgis 4.15 / 4.14 url, which I think is coming from EsriMapView and EsriMap, but I can't do anything with them except set them to null in the ngOnDestroy, because if I try to call .destroy() an exception is thrown that the function doesn't exist. Could there be an issue with EsriMapView getting properly destroyed? If you reference the sample project I made, it has this same issue, and I noticed the same problem on the angular-cli-map project.
... View more
08-12-2020
03:19 PM
|
0
|
4
|
3725
|
|
POST
|
This is still an issue, if we navigate away from the maps the memory isn't getting free'd, it looks like the MapView isn't destroying itself properly.
... View more
08-12-2020
02:52 PM
|
1
|
7
|
4538
|
|
POST
|
Good Day I've noticed a memory issue where, at least in Angular 9, once your destroy the view / map objects, the memory usage is extremely high, ~100 MB / map. I’ve Prepared a test repo, that initializes a map and allows you to jump to another page, when I run this code and jump between the pages the memory isn't being freed correctly, hopefully this helps: GitHub - docmur/angular-esri-memory-test My destroy functions, of our main application is: nullifyComponents() {
console.log('Destroying the ESRI View and ESRI Map');
if (this._map) {
this._map.removeAll();
this._map.destroy();
this._map = null;
delete this._map;
} else {
console.log('Map is NULL');
}
if (this._view) {
this._view.map = null;
this._view.container = null;
this._view.destroy();
this._view = null;
delete this._view;
} else {
console.log('View is NULL');
}
this._BasemapGallery.destroy();
this._BasemapGallery = null;
this.EsriMap = null;
this.EsriMapView = null;
this.FeatureLayer = null;
this.SimpleMarkerSymbol = null;
this.SimpleFillSymbol = null;
this.SimpleLineSymbol = null;
this.Color = null;
this.Graphic = null;
this.WatchUtil = null;
this.BasemapGallery = null;
this.Home = null;
this.Expand = null;
this.Print = null;
this.PrintTask = null;
this.PrintTemplate = null;
this.PrintParameters = null;
this._BasemapGallery = null;
}
removeByTag(tag) {
const element = document.getElementById(tag);
while (element[0]) {
element[0].parentNode.removeChild(element[0])
}
}
@HostListener('window:beforeunload')
async ngOnDestroy() {
try {
/* Get rid over everything else */
this.removeAll();
/* Destroy and remove memory references to the maps */
this.nullifyComponents();
this.mapViewEl = null;
delete this.mapViewEl;
this.removeByTag('mapElement');
} catch (error) {
console.log(error);
}
} When I look at the memory tab I see: When I run a heap stack trace I see: Among another objects. Is there another way to assure the memory is getting freed? If I navigate back to the maps and away, it will add another 100 MB / map, until all the memory is used up. The function removeAll is setting all internal variables to null to assure they don't reference any of the ESRI components. The version of the library in use is 4.14. I’ve tried everything I can think of to free the memory including deleting the DOM elements in ngOnDestroy, and after they’re removed, the memory still remains. I've seen this across Windows, Linux and Firefox / Chromium based browsers. Thanks
... View more
08-10-2020
08:10 AM
|
0
|
7
|
3992
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 04-25-2025 07:33 AM | |
| 1 | 03-18-2025 11:15 AM | |
| 1 | 10-07-2022 08:14 AM | |
| 1 | 08-25-2023 10:47 AM | |
| 1 | 02-23-2023 08:22 AM |
| Online Status |
Offline
|
| Date Last Visited |
10-24-2025
07:12 AM
|