Search in sources :

Example 1 with LonLat

use of org.gwtopenmaps.openlayers.client.LonLat in project opennms by OpenNMS.

the class OpenLayersMapPanel method toLonLat.

private static LonLat toLonLat(final GWTLatLng latLng) {
    final LonLat ll = new LonLat(latLng.getLongitude(), latLng.getLatitude());
    ll.transform(PROJECTION_LAT_LON.getProjectionCode(), PROJECTION_SPHERICAL_MERCATOR.getProjectionCode());
    return ll;
}
Also used : LonLat(org.gwtopenmaps.openlayers.client.LonLat)

Example 2 with LonLat

use of org.gwtopenmaps.openlayers.client.LonLat in project opennms by OpenNMS.

the class OpenLayersMapPanel method createMarker.

private Marker createMarker(final GWTMarkerState marker) {
    final LonLat lonLat = toLonLat(marker.getLatLng());
    final Icon icon = createIcon(marker);
    final Marker m = new Marker(lonLat, icon);
    m.addBrowserEventListener("click", new DefaultMarkerClickHandler(marker));
    return m;
}
Also used : LonLat(org.gwtopenmaps.openlayers.client.LonLat) Icon(org.gwtopenmaps.openlayers.client.Icon) Marker(org.gwtopenmaps.openlayers.client.Marker)

Aggregations

LonLat (org.gwtopenmaps.openlayers.client.LonLat)2 Icon (org.gwtopenmaps.openlayers.client.Icon)1 Marker (org.gwtopenmaps.openlayers.client.Marker)1