Export map layer to KMZ and keep resolution Javascript API

1188
2
07-06-2017 07:41 AM
ConnorWilliams
New Contributor II

Hey,

I am trying to write an application that takes the current extent of my map and exports the map service to KMZ. I have achieved this functionality however, the KMZ layer LOOKS AWFUL. Its effectively a useless blob of pixels that looks nothing like my map service.

To achieve this, currently I am using: 

https://<MAP SERVICE ROOT>/MapServer/export?bbox<EXTENT>&f=kmz

And just using JavaScript to open a window with this url and its downloads the kmz. The query string accepts a lot of other arguments that I have been manipulating but nothing is seeming to produce a viable result.

Anyone have any experience with this or thoughts?

0 Kudos
2 Replies
FC_Basson
MVP Regular Contributor

Is the spatial reference properly defined for your bounding box?  And what other parameters are you modifying for the export?  Combinations of DPI and Map Scale can have unexpected effects on the resulting KML.

0 Kudos
ConnorWilliams
New Contributor II

I actually solved this - there are two arguments that I was not specifying that control for this.

1) Image Size (size)

2) DPI (dpi)

So for the export, I just ramped these up and got the quality I wanted.

This is what I added to my query string:

"&size=3000,3000&dpi700"