Hi all,
I'm looking for a way to set the scale-unit to "Meters" for the Print-widget. Any help in the right direction appreaciated 🙂
Thanks,
Vincent
Hi Richard, thanks for the solution 🙂 This is what I was looking for, it would indeed be good to have this property on the Print widget itself.Â
Â
Have a good Christmas!
Hi Vincent,Â
I came across this issue as well. I wish the ESRI Dev team will add this as a property to the widget: "scaleBarOptions". My work around was to use interceptors in esriConfig and add the print service URL you are using for printing. here is the code snippet Â
const addInterceptor = () => { // call this function before initializing the Print widget esriConfig.request.interceptors.push({ urls: printServiceUrl, // the URL of the print service and make sure it is the same url as the one used in the Print widget before: (params: any) => { if (params.requestOptions.query.Web_Map_as_JSON) { const jsonRequest = JSON.parse(params.requestOptions.query.Web_Map_as_JSON); jsonRequest.layoutOptions.scaleBarOptions = { metricLabel: 'm', metricUnit: 'esriMeters', nonMetricLabel: 'ft', nonMetricUnit: 'esriFeet', }; params.requestOptions.query.Web_Map_as_JSON = JSON.stringify(jsonRequest); } }, }); };
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.