[OpenMap Users] Show cities in worldmap

From: <Cooldoc_at_gmx.de>
Date: Wed, 21 Oct 2009 10:18:49 +0200

Hi,

I'm new to openmap and created this simple example of a world map (see below).
However I'd like to load and display the cities (cities.csv) on the map.

Can someone please give me a hint how to do this?

Thanks in advance
Markus

My source code:
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.Properties;

import javax.swing.JFrame;

import com.bbn.openmap.MapBean;
import com.bbn.openmap.MapHandler;
import com.bbn.openmap.layer.shape.ShapeLayer;
import com.bbn.openmap.util.Debug;

public class SimpleMap extends JFrame {

public SimpleMap(String name) {
super(name); // set title


setSize(640, 480); // and location

// Create a map handler (map, layer, component container)
MapHandler mapHandler = new MapHandler();

// Create a MapBean
MapBean mapBean = new MapBean();
mapHandler.add(mapBean);

ShapeLayer shapeLayer = new ShapeLayer();

Properties shapeLayerProps = new Properties();
shapeLayerProps.put("prettyName", "Political Solid");
shapeLayerProps.put("lineColor", "000000");
shapeLayerProps.put("fillColor", "BDDE83");
shapeLayerProps.put("shapeFile", "data/shape/dcwpo-browse.shp");
shapeLayerProps.put("spatialIndex", "data/shape/dcwpo-browse.ssx");
shapeLayer.setProperties(shapeLayerProps);

// Add the political layer to the map
mapBean.add(shapeLayer);

// Add the map to the frame
getContentPane().add(mapBean);

}

public static void main(String[] argv) {

Debug.init();
//Debug.put("mousemode");

SimpleMap simpleMap = new SimpleMap ("Simple Map");
simpleMap.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}});


simpleMap.setVisible(true);
}


}

-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Wed Oct 21 2009 - 04:26:07 EDT

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:09 EDT