ThinkGeo.com    |     Documentation    |     Premium Support

Adding an unspecified number of dynamic points

I want to add a number of  points to map layer , but the number is not predefined since it depened son the number of rows in a database table and they are dynamic ? thank u ....



Sheree, 
  
 You can first add a blank inMemoryFeatureLayer to the map. Whenever the dynamic data is ready, you can get that layer from map, add the data to it and call overlay.ReDraw to display the data on the map.   
  
 
// Add the inMemoryFeatureLayer to overlay
Map1.DynamicOverlay.Layers.Add("layerKey", inMemoryFeatureLayer);

// Get the inMemoryFeatureLayer from the overlay
InMemoryFeatureLayer inMemoryFeatureLayer = (InMemoryFeatureLayer)Map1.DynamicOverlay.Layers["layerKey"]; 
    
// Refresh the Overlay
Map1.DynamicOverlay.ReDraw()
 
 Thanks, 
  
 Ben