MapX画点

 

  float screenX,screenY ;
 double mapX,mapY ;
 CMapXPoints pts ;
 CMapXPoint pt ;
 CMapXLayer layer ;
 pts.CreateDispatch( pts.GetClsid() );
 pt.CreateDispatch( pt.GetClsid() );
 
 screenX = X;
 
 screenY = Y; 
 m_pMap->ConvertCoord(&screenX,&screenY,&mapX,&mapY,miScreenToMap);
 pt.Set( mapX , mapY ) ;
 pts.Add(pt);
 if ( !m_pMap->LayerExist("tmpLayer")  ) {
  layer = m_pMap->GetLayers().CreateLayer("tmpLayer");
 }
 else{
  layer = m_pMap->GetLayers().Item("tmpLayer");
 }
 
 CMapXFeatureFactory ff = m_pMap->GetFeatureFactory();
 
 COleVariant vtPoints;
 vtPoints.vt = VT_DISPATCH;
 vtPoints.pdispVal = pts.m_lpDispatch;
 vtPoints.pdispVal->AddRef();
  
 CMapXFeature fe = ff.CreateMultipoint( vtPoints );
 layer.AddFeature( fe ) ;

你可能感兴趣的:(map)