Monday, November 3rd, 2008
Chess Diagram Builder and Maps Library via GWT
<p>Alexander (aka Sasha) Maryanovsky has been hacking away with GWT, and has some come up with a couple of interesting project.The first, is a fun chess diagram builder that lets you build out a chess diagram and export it out:
Also, he has created Sasha Maps, an API that abstracts mapping implementations allowing you to plugin your own system (but Google Maps and WMS are implemented).
The appropriate Hello World could look something like this:
-
-
package com.maryanovsky.mapdemo.client;
-
-
import java.util.Arrays;
-
import java.util.List;
-
import com.google.gwt.core.client.EntryPoint;
-
import com.google.gwt.user.client.ui.RootPanel;
-
import com.maryanovsky.gwtutils.client.UiUtils;
-
import com.maryanovsky.gwtutils.client.UserEventManager;
-
import com.maryanovsky.map.client.*;
-
import com.maryanovsky.map.client.impl.Google;
-
-
/**
-
* The entry point of the Map demo.
-
*/
-
public class TutorialDemo implements EntryPoint {
-
/**
-
* Starts the map demo.
-
*/
-
public void onModuleLoad() {
-
-
LatLng initialLocation = new LatLng(60.050317, 30.350161);
-
int initialZoom = 13;
-
-
MapWidget mapWidget = new MapWidget(
-
new MapLocationModel(0, 17, initialLocation, initialZoom));
-
mapWidget.setMap(map);
-
-
UserEventManager eventManager = mapWidget.getUserEventManager();
-
eventManager.setDragAction(MapWidget.DRAG_MAP_ACTION);
-
eventManager.setDoubleClickAction(MapWidget.ANIMATED_ZOOM_IN_ACTION);
-
eventManager.setWheelAction(MapWidget.ANIMATED_ZOOM_ACTION);
-
eventManager.setRightClickAction(MapWidget.ANIMATED_PAN_MAP_ACTION);
-
-
UiUtils.disableContextMenu(mapWidget.getElement());
-
UiUtils.addFullSize(RootPanel.get(), mapWidget);
-
}
-
}
-
The API gives you interfaces to setup custom maps, actions, overlays, map widgets, and more.
Related Content:












Leave a comment