Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] Basic help using uDig in Eclipse RCP

Jody

2009/5/27 Jody Garnett <jody.garnett@xxxxxxxxx>
<snip>
My general advice for people starting out is here:
- http://udig.refractions.net/confluence/display/ADMIN/Welcome+New+Eclipse+RCP+Developers

many thanks for your tips -  spent yesterday doing much reading/learning/playing and am starting to get more of a grip on what's what.

I've decided to go even more basic than PostGIS for an initial stab at things and am using a shapefile as a source for my map (the countries.shp file).  I've successfully opened this and extracted a ShpGeoResource from it.  Where I'm having problems now is in displaying this on a map - all I'm getting is an empty box.  The contents of the box do change from grey to white but I can't see the countries.  Do I need to do anything to the Map or MapViewer to initialize the displaying of the map?

The code I'm using in my ViewPart is as follows (where the getDataHandles() method returns a list contining the ShpGeoResource from the shape file).

public class MapView extends ViewPart implements MapPart {
 
  ..............
 
  public void createPartControl(Composite parent) {
    FillLayout layout = new FillLayout();
    parent.setLayout(layout);

    mapviewer = new MapViewer(parent);
    map = ProjectFactory.eINSTANCE.createMap();

    List<IGeoResource> dataHandles = getDataHandles();
   if( !dataHandles.isEmpty() ) {
   map.sendCommandASync( new AddLayersCommand(dataHandles));
    }
     
    mapviewer.setMap(map);
  }

 ..............

}

Again thanks in advance for any help and sorry to be asking such basic questions.

All the best

Rupert 

Back to the top