• CommentAuthorMattR
    • CommentTimeMay 12th 2014
     
    I am adding around 2000 markers to the map but it is very slow around 20 seconds. I have tried using the preloadImages function but that makes no difference.

    I am adding markers to an array of objects and using this code to draw them

    this.icon = new Telogis.GeoBase.MapLayers.ImageObject({
    anchorPoint: new Point(0.5, 0.5),
    dragEnabled: false,
    layer: layer,
    location: new LatLon(lat, lon),
    src: this.iconImgUrl
    });

    is there a better way of adding a large number of markers?
  1.  
    Hi MattR,

    Have you looked into our XSLTObjectLayer class?
    http://docs.geobase.info/?topic=html/f7373dad-4347-4ec8-8860-4161b72cac79.htm

    It is designed to contain a large number of objects that are read from an XML file and displayed. It uses XSLT for handling object clipping to the viewport, which loads more quickly than the RTree used in MapLayers.ObjectLayer at the cost of flexibility.

    You could find an example of the XSLTObjectLayer in your GeoStream\server\scripts folder. The example consists of three files:
    tutorial.xslt-objects.js
    tutorial.xslt-objects.aspx
    tutorial.xslt-markers.xml

    To test the tutorial page, hit the following URL in a browser:
    http://localhost/GeoStream/scripts/tutorial.xslt-objects.aspx

    Any further questions, please feel free to drop us a line at gbsupport@telogis.com.

    Thanks,

    April