Select to view content in your preferred language

performance kml vs api

663
3
11-12-2012 03:26 AM
PetreCojocea
New Contributor
Hi,  I'm working on showing a large number of  placemarks on a map in browser,
I have some questions:

1. to show them faster, which way to go - KML files or api javascript ? performance matters. on google earth kml was better.
2. when using KML,  is there a way to avoid publicy visible urls?

Regards,
Peter
0 Kudos
3 Replies
__Rich_
Regular Contributor

  1. That's not really comparing eggs with eggs - KML is a format for (geographic) data exchange, the JS API is a programming framework.  That's like asking which is better - comma separated text or Visual Basic?  (perhaps I have misunderstood your question?)

  2. You can either purchase Esri's Portal product or write your own converter for translating KML to JSON for consumption by the API classes.  (or you could write your own KML layer class to consume the KML directly)

0 Kudos
PetreCojocea
New Contributor

  1. That's not really comparing eggs with eggs - KML is a format for (geographic) data exchange, the JS API is a programming framework.  That's like asking which is better - comma separated text or Visual Basic?  (perhaps I have misunderstood your question?)

  2. You can either purchase Esri's Portal product or write your own converter for translating KML to JSON for consumption by the API classes.  (or you could write your own KML layer class to consume the KML directly)




Thanks for quick answer,

on 1:  rephrase: If I want to display 1000 placemarks/markers/PictureMarker in arcgis browser map, do I get that faster by using a KMl/kmz generated on server or by adding one by one in arcgis javascript api (we having only 5 types of markers == 5 different icon) ?  

we did some testing on google earth:  using KML we load much faster (10x) than using api.
I'm aware of having a different model here (network+severs) but I asked the question just in case somebody else  done this test in the past and it's a know issue, and I can work in best direction and avoid slower path.

on 2: thanks
0 Kudos
__Rich_
Regular Contributor
on 1:  rephrase: If I want to display 1000 placemarks/markers/PictureMarker in arcgis browser map, do I get that faster by using a KMl/kmz generated on server or by adding one by one in arcgis javascript api (we having only 5 types of markers == 5 different icon) ?


That still looks like the same question 🙂

Whether you choose KML or some other format if you want to render on the client then you're still going to have to add features to the map one by one.

As a rule of thumb, for those kind of numbers you'd probably want to render things server-side e.g. using a WMS-like service through, perhaps, ArcGIS Server.

If you're going to be putting 1000 placemarks in a KML file and sending it to the browser then:

a) you're sending reasonably (subjectively of course) large files over the wire (potentially, depends how much data beyond just the location you're sending)
b) you're asking a browser to parse that file (memory/CPU)
c) you're asking the browser (via the API) to loop through many items rendering them on the map (also resource hungry)

The above doesn't really change whether you're using KML or JSON..although the former is more verbose, and I'd argue, more resource-intensive.
0 Kudos