Keeping TOC layers unchecked on first load in ArcGIS JavaScript API - dojo

I am using NLiu's TOC widget for displaying the layers. It is working perfectly, however, I wanted to keep all layers unchecked when it is loading on the browser (for performance reason). I tried to find a way on its javascript files but not succeed.
Any clue to do so?

Set the layer's visible layers to none:
layer.setVisibleLayers([])

Related

Cloudinary upload image widget does not work as expected

I am using the upload image widget without success.
1) result.info.path returns invalid url.
2) There is no preview of the uploaded images due to no.1
3) No images are were uploaded to my media folder at Cloudinary.
Fiddle:
https://jsfiddle.net/7uqb83t1/
These are my preset settings:
Can someone share a working version of this widget + preset settings?
On successful upload, you need to check result.info.secure_url for a link to the asset. Currently, in your preset, you're using Async which means the incoming transformation is performed in the background (asynchronously), and as such, you will get a pending result. Async assumes you're using a Notification URL as a webhook where you'll receive the Upload API response when the processing is complete. In your case, I'd recommend turning the Async off.
Also, your incoming transformation configured in the preset is not valid and because of that, you will be getting an error on upload. Please console.log this in your JSFiddle to see it. Essentially, it'll be -
Auto gravity can only be used with crop, fill, lfill, fill_pad or
thumb
'auto' gravity (g_auto) implies cropping (automatically selecting the most interesting part of the image to focus on) and therefore you need to use an appropriate crop mode. 'scale' keeps all image data and no cropping is made so that is why g_auto can't work with it. Please see the following section of the documentation for details on the different crop modes - https://cloudinary.com/documentation/image_transformation_reference#crop_parameter - which will help you decide which one you want to use.
Lastly, you should also consider updating your incoming transformation so that it only resizes once, since currently, resizing it three times with the same crop mode is redundant. For example, you can use c_scale,q_auto,w_687 only, or if you want with 'auto' gravity you can try c_fill,g_auto,q_auto,w_687.

Incorrect Visualization of Geojson using Vue2-Leaflet

I'm having a problem when visualizing my GeoJSON files on the web using Vue2Leaflet.
The user uploads files in the form of .dxf, then the Django backend process it into various layers and send it back to the front end. I received all the layers in the form of GeoJSON object, and I use l-map of Vue2Leaflet to visualize whichever layer is selected.
Could you please tell me what's happening here? The same code works perfectly with the example API given by the developer themselves, but not with my GeoJSON.
Reference Example
Note: My GeoJSON if visualized in QGIS shows a map shape, or at least not such a straight line for the layer.

How to load a local shape or geojson file in to leaflet in Asymmetrik/ngx-leaflet?

I am using Asymmetrik/ngx-leaflet to build a map based application which can load and view external shape files. Is there any way to show local shape files?
It looks like there's a Leaflet plugin for shapefiles. I don't know if it's up to date, but you might start there.
There's also a tutorial on how to integrate third party plugins with #asymmetrik/ngx-leaflet.
Read through the examples to get a sense of how to get the plugin loaded into your Angular app. Then, you probably just need to create your shapefile layer and add it to the layers array that is bound to ngx-leaflet just like any other layer.

Create PDF layers using DomPDF

I'm trying to create a PDF with layers, one for the texts and the other for a background image so user can print only the text layer.
Does anyone knows if it's possible and if so, how can I do that ?
I'm using version 0.8.2.
Thanks
Finally it looks like layers or the Optional Content Groups are not supported by DomPDF. So my solution was to change to TCPDF, it's not great for CSS but it offers the option to create layers and change the visibility of objects in the PDF.
So you can set objects to show only in screen or print.
I hope this can help if someone has the same issue.
Here's the link to TCPDF

Fine Uploader: resizing large files before upload?

I'm evaluating Fine Uploader compared to various other options, specifically JQuery File Upload.
I generally prefer the Fine Uploader approach as it's more lightweight, compared to JQuery File Uploader which has dependencies on Bootstrap and JQuery UI.
However it's important to be able to resize images: e.g., a user may select a large file from their camera and this may be very large - uploading the full resolution photo may take a very long time. JQuery File Upload doe this.
Additionally we don't have much use for very high resolution files.
If possible (I'm aware some browsers may not support this), I'd like to be able to resize images client size.
Is this possible?
Fine Uploader does not currently have any native support for image manipulation. This is a feature in our backlog, but we have not had many users tell us they are interested in this. This is one of the reasons why such a feature has yet to be implemented natively. There is a case, #707 that marks the start of native image-editing support for Fine Uploader. It is tentatively scheduled for 4.0.
However, you can certainly make use of FileReader and Canvas to resize the image. You can then submit this resized image as a Blob to Fine Uploader via the addFiles API method. At that point, the file has been submitted and Fine Uploader is ready to upload the item.
Essentially, the steps you would follow to handle this specific scenario, before Fine Uploader natively supports image manipulation:
Provide your own file input element(s) or make use of Fine Uploader's file/folder drag and drop support to get a handle on some files selected by the user.
Use FileReader to read the contents of the image.
FileReader will provide you with a URL for the image, assign that to the src attribute of an img element.
Draw the img onto a canvas element. This is where the resizing occurs.
Grab the URL of the resized image from the canvas element (canvas.toDataURL(...)).
Convert the URL to a Blob.
Pass the Blob to the addFiles API method of Fine Uploader.
The intent is to take care of most if not all of this for integrators such as yourself in the future by adding native image manipulation support to Fine Uploader.
Hope this helps.