Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Inhalt:

Achtung: Für die Verwendung der XdevGeoChart oder XdevMapChart ist ein Google API-Key erforderlich. Dieser API-Key kann hier angefordert werden.

Optimale Datenstruktur (Datenbank):

LatLongBeschriftung
37.4232-122.0853"Work"
37.4289-122.1697"University"
37.6153-122.3900"Airport"
...

oder

AdresseBeschriftung
"Musterweg 16 92225 Musterndorf""Work"

Optimale Objektstruktur (Java)

public class MapChartObject {
	private Double longitude;
	private Double latitude;
	private String name;

	public Double getLongitude() {
		return longitude;
	}

	public void setLongitude(Double longitude) {
		this.longitude = longitude;
	}

	public Double getLatitude() {
		return latitude;
	}

	public void setLatitude(Double latitude) {
		this.latitude = latitude;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
}

Beispiel: Füllen der Daten

//Beim Instanziieren muss das DataMapFormat definiert werden
//DataMapFormat.Latitude --> Definition der Orte über "Long" and "Lat"
//DataMapFormat.Address --> Definition der Orte die Adresse z.B. "Mustersweg 16 92224 Musterndorf"
final ChartModel model = ChartModel.New()
	.addColumn(Column.New(Column.Type.NUMBER, "longitude"))
	.addColumn(Column.New(Column.Type.NUMBER, "latitude"))
	.addColumn(Column.New(Column.Type.STRING, "Beschriftung"));
		
model.addRow(37.4232, -122.0853, "Work");
model.addRow(37.4289, -122.1697, "University");
model.addRow(37.6153, -122.3900, "Airport");
model.addRow(37.4422, -122.1731, "Shopping");

mapChart.setModel(model);

API und Methoden:

Properties
API Key

For some charts a API Key from Goofle is nessesary. You can get a key here: https://developers.google.com/maps/documentation/javascript/get-api-key

geoChart.setMapsApiKey("123456789wertzuiopü");
MapType

Color to assign to regions with no associated data.

geoChart.setDatalessRegionColor("white");
ShowInfoWindow

The color to use when for data points in a geochart when the location (e.g., 'US' ) is present but the value is either null or unspecified. This is distinct from datalessRegionColor, which is the color used when data is missing.

geoChart.setDefaultColor("white");
ShowLine

Which type of geochart this is. The DataTable format must match the value specified. The following values are supported:

  • 'auto' - Choose based on the format of the DataTable.
  • 'regions' - Color the regions on the geochart.
  • 'markers' - Place markers on the regions.
  • 'text' - Label the regions with text from the DataTable.

    geoChart.setDisplayMode(DisplayMode.MARKERS);
ShowTooltip

The opacity of the markers, where 0.0 is fully transparent and 1.0 is fully opaque.

geoChart.setMarkerOpacity(0.8);
UseMapTypeControl

The resolution of the geochart borders. Choose one of the following values:

  • 'countries' - Supported for all regions, except for US state regions.
  • 'provinces' - Supported only for country regions and US state regions. Not supported for all countries; please test a country to see whether this option is supported.
  • 'metros' - Supported for the US country region and US state regions only.
geoChart.setResolution(Resolution.COUNTRIES);
ZoomLevel

If true, when the user lingers over a cluttered marker, a magnifiying glass will be opened.

Note: this feature is not supported in browsers that do not support SVG, i.e. Internet Explorer version 8 or earlier.

geoChart.setMagnifyingGlass(MagnifyingGlass.New(true, 5));
EnableScrollWheel
geoChart.setMagnifyingGlass(MagnifyingGlass.New(true, 5));
  • No labels