locked
A lot of pushpins RRS feed

  • Question

  • I need to add a lot of pushpins, such as 1000 for example.
    When you add 1000 pushpins, VE control starts to act very slowly. Panning and zooming is slowed down a lot.

    I did not see any limitations on the number of pins in API documentation.
    Is there any alternative solution to speed this up?

    Here is a sample code. Using VE v3 control.

    map.DeleteAllPushpins();
    for (var i = 0; i < result.length; i++)
    {
    var pin = new VEPushpin(
    i,
    new VELatLong(result[ i ].Lat, result[ i ].Lon),
    'pushpin.gif',
    'test title',
    'test body'
    );
    map.AddPushpin(pin);
    }

    Tuesday, June 13, 2006 7:39 PM

Answers

  • I've tried the same thing with both pushpins and rss layer. Unfortunately, neither can handle more than a couple of hundred data points before the map is slowed down substantially.

    The one way to get around the problem is to clumping points at low zoom level and graduately unclumping as you zoom in. This requires you to know the latlongRect at end of a zoom or pan event. I can only get browser to return the e.view.latlongRect as a object. Does anyone know the structure of latlongRect?

    Ning

    Wednesday, June 14, 2006 11:39 PM

All replies

  • Hello,

    I would do this importing a GeoRSS file with your points.
    Documentation here:
    http://msdn.microsoft.com/library/en-us/VEMapControl/HTML/M_Namespace_VEMap_AddLayer.asp?frame=true

    Create a file like this:
    <rdf:RDF xmlns:rdfhttp://www.w3.org/1999/02/22-rdf-syntax-ns#"
            xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#">
     <item>
      <title>Example</title>
      <description>Just an example</description>
      <geo:lat>51.782202676</geo:lat>
      <geo:long>-2.35554493586</geo:long>
     </item>
     <item>
      <title>Example 2</title>
      <description>Just another example</description>
      <geo:lat>51.7816745434</geo:lat>
      <geo:long>-2.35453014258</geo:long>
     </item>
     <item>
      <title>Example 3</title>
      <description>Just yet another example</description>
      <geo:lat>51.7816175759</geo:lat>
      <geo:long>-2.35427369461</geo:long>
     </item>
    </rdf:RDF>


    Then in your code do:
    var MyLayer = new VELayerSpecification();
    MyLayer.Type = VELayerType.GeoRSS;
    MyLayer.ID = 1;
    MyLayer.LayerSource = "http://www.yourserver.com/YourGeoRSSFile.xml";
    MyLayer.Method = "get";
    MyLayer.IconUrl = "http://www.yourserver.com/icon.gif";
    map.AddLayer(MyLayer);

    This reads in your xml file and creates a single layer with all the pushpins.
    The <title> & <description> are used in the pop-up for the pushpins.

    It might be quicker than adding individual pushpins, but I would imagine it will still slow down with 1000.

    Wednesday, June 14, 2006 8:43 AM
  • I have the same problem. I wanted several thousand pushpoints. I tried the GeoRSS method but still took ages and timed out. I think the problem is that everything is being executed in the browser. It's basically a huge client-side script. I would appreciate any help on getting it to work with many pushpins.
    Wednesday, June 14, 2006 1:57 PM
  • I've tried the same thing with both pushpins and rss layer. Unfortunately, neither can handle more than a couple of hundred data points before the map is slowed down substantially.

    The one way to get around the problem is to clumping points at low zoom level and graduately unclumping as you zoom in. This requires you to know the latlongRect at end of a zoom or pan event. I can only get browser to return the e.view.latlongRect as a object. Does anyone know the structure of latlongRect?

    Ning

    Wednesday, June 14, 2006 11:39 PM