Has anyone created an export to KML widget? I have a dashboard and would like to create a custom widget that allows non-GIS users to be able to select features and be able to automatically export to KML file.
Such a widget would be very helpful to have in Experience Builder, too. Given the apparent glacial progress in essential enhancements to EB, I doubt this will happen 😞
My personal preference would be to create a GP tool (python) to perform the conversion, publish it as a GP Service and make requests to it from your web application (whatever form that may be). Just build it off the Layer To KML tool and publish it out as a GP service.
You can run thru the gauntlet of possible Javscript solutions but I don't believe there's any ESRI Javascript api options available. You would probably need to format any input as GeoJSON first then perhaps need to hit other api's that could do the conversion for you (some are free but may have frequency limits on the number of requests).
It looks like there'a generateKML option available on Enterprise services? Not sure about that tho.
@JamesCrandall I am very new to creating geoprocessing services, but I attempted this building off the Layer to KML tool, as you suggested.
When I use the service in a widget and try to select features, the server returns an error saying: ERROR 000840: The value is not a Layer.
As I said, I am extremely new to this process and I'm sure I made a novice mistake when setting up the service. Could you possibly provide additional information on the best way to set up this service?
Thank you so much!
Hi Katherine!
What is the output parameter of your GP tool? I'm unsure what the application is expecting to render it as or what would be appropriate. I think my comments above to the original post were more about generating an output of a zipped up kml that would end up in a the user's downloads folder. If that's the case, your python script source would need to execute the "Layer To KML" tool then implement code to zip that up and send via the output parameter.
I had created an "export to KMZ" widget for web appbuilder which allowed users to export the graphics to the KMZ file. It was a combination of c# and JavaScript.
could you please share theexport to kmz widget
Could you please share
The widget (Draw.zip) and the C# controller, Model (KMZFileGISController.zip) is attached. I am unable to attach the entire C# project since it has other rest api implementation. You will have to replace the url within config.json with your desired REST service.
"KMZExportService": "https://localhost/GISUtilRestService/api"