gwt: add vtm-web-js project
This commit is contained in:
22
vtm-web-js/src/org/oscim/web/js/JsBitmapTileLayer.java
Normal file
22
vtm-web-js/src/org/oscim/web/js/JsBitmapTileLayer.java
Normal file
@@ -0,0 +1,22 @@
|
||||
package org.oscim.web.js;
|
||||
|
||||
import org.oscim.layers.tile.bitmap.BitmapTileLayer;
|
||||
import org.oscim.map.Map;
|
||||
import org.oscim.tiling.TileSource;
|
||||
import org.timepedia.exporter.client.Export;
|
||||
import org.timepedia.exporter.client.ExportOverlay;
|
||||
import org.timepedia.exporter.client.ExportPackage;
|
||||
|
||||
@ExportPackage("vtm")
|
||||
@Export("BitmapTileLayer")
|
||||
public class JsBitmapTileLayer extends BitmapTileLayer implements ExportOverlay<BitmapTileLayer> {
|
||||
|
||||
public JsBitmapTileLayer(Map map, TileSource tileSource) {
|
||||
super(map, tileSource);
|
||||
}
|
||||
|
||||
// @ExportConstructor
|
||||
// public static BitmapTileLayer constructor(Map map, TileSource tileSource) {
|
||||
// return new JsBitmapTileLayer(map, tileSource);
|
||||
// }
|
||||
}
|
||||
27
vtm-web-js/src/org/oscim/web/js/JsBitmapTileSource.java
Normal file
27
vtm-web-js/src/org/oscim/web/js/JsBitmapTileSource.java
Normal file
@@ -0,0 +1,27 @@
|
||||
package org.oscim.web.js;
|
||||
|
||||
import org.oscim.tiling.ITileDataSource;
|
||||
import org.oscim.tiling.source.bitmap.BitmapTileSource;
|
||||
import org.timepedia.exporter.client.Export;
|
||||
import org.timepedia.exporter.client.ExportOverlay;
|
||||
import org.timepedia.exporter.client.ExportPackage;
|
||||
|
||||
@ExportPackage("vtm")
|
||||
@Export("BitmapTileSource")
|
||||
public class JsBitmapTileSource extends BitmapTileSource implements
|
||||
ExportOverlay<BitmapTileSource> {
|
||||
|
||||
public JsBitmapTileSource(String url, int zoomMin, int zoomMax) {
|
||||
super(url, zoomMin, zoomMax);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ITileDataSource getDataSource() {
|
||||
return null;
|
||||
}
|
||||
// @ExportConstructor
|
||||
// public static BitmapTileSource constructor(String url, int zoomMin, int zoomMax) {
|
||||
// return new JsBitmapTileSource(url, zoomMin, zoomMax);
|
||||
// }
|
||||
|
||||
}
|
||||
60
vtm-web-js/src/org/oscim/web/js/JsMap.java
Normal file
60
vtm-web-js/src/org/oscim/web/js/JsMap.java
Normal file
@@ -0,0 +1,60 @@
|
||||
package org.oscim.web.js;
|
||||
|
||||
import org.oscim.core.MapPosition;
|
||||
import org.oscim.layers.Layer;
|
||||
import org.oscim.map.Layers;
|
||||
import org.oscim.map.Map;
|
||||
import org.oscim.theme.IRenderTheme;
|
||||
import org.oscim.theme.ThemeLoader;
|
||||
import org.oscim.theme.VtmThemes;
|
||||
import org.timepedia.exporter.client.Export;
|
||||
import org.timepedia.exporter.client.ExportPackage;
|
||||
import org.timepedia.exporter.client.Exportable;
|
||||
import org.timepedia.exporter.client.NoExport;
|
||||
|
||||
@ExportPackage("")
|
||||
@Export("map")
|
||||
public class JsMap implements Exportable {
|
||||
|
||||
static Map mMap;
|
||||
|
||||
@Export
|
||||
public static Map map() {
|
||||
return mMap;
|
||||
}
|
||||
|
||||
@Export
|
||||
public static Layers layers() {
|
||||
return mMap.layers();
|
||||
}
|
||||
|
||||
@Export
|
||||
public static boolean addLayer(Layer l) {
|
||||
return mMap.layers().add(l);
|
||||
}
|
||||
|
||||
@Export
|
||||
public static boolean getPosition(MapPosition pos) {
|
||||
return mMap.getMapPosition(pos);
|
||||
}
|
||||
|
||||
@Export
|
||||
public static void setPosition(MapPosition pos) {
|
||||
mMap.setMapPosition(pos);
|
||||
}
|
||||
|
||||
@Export
|
||||
public static IRenderTheme loadTheme(String theme) {
|
||||
return ThemeLoader.load(VtmThemes.valueOf(theme));
|
||||
}
|
||||
|
||||
@NoExport
|
||||
public static void init(Map map) {
|
||||
mMap = map;
|
||||
}
|
||||
|
||||
// @ExportInstanceMethod("foo")
|
||||
// public static String instanceMethod(Map instance, String surname) {
|
||||
// return instance.getName() + "-" + surname;
|
||||
// }
|
||||
}
|
||||
144
vtm-web-js/src/org/oscim/web/js/JsOverlays.java
Normal file
144
vtm-web-js/src/org/oscim/web/js/JsOverlays.java
Normal file
@@ -0,0 +1,144 @@
|
||||
package org.oscim.web.js;
|
||||
|
||||
import org.oscim.core.MapPosition;
|
||||
import org.oscim.layers.GenericLayer;
|
||||
import org.oscim.layers.Layer;
|
||||
import org.oscim.layers.TileGridLayer;
|
||||
import org.oscim.layers.tile.vector.BuildingLayer;
|
||||
import org.oscim.layers.tile.vector.OsmTileLayer;
|
||||
import org.oscim.layers.tile.vector.VectorTileLayer;
|
||||
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
||||
import org.oscim.map.Layers;
|
||||
import org.oscim.map.Map;
|
||||
import org.oscim.renderer.LayerRenderer;
|
||||
import org.oscim.theme.IRenderTheme;
|
||||
import org.oscim.tiling.TileSource;
|
||||
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
||||
import org.timepedia.exporter.client.Export;
|
||||
import org.timepedia.exporter.client.ExportOverlay;
|
||||
import org.timepedia.exporter.client.ExportPackage;
|
||||
|
||||
public final class JsOverlays {
|
||||
@ExportPackage("vtm")
|
||||
@Export("Layers")
|
||||
public interface XLayers extends ExportOverlay<Layers> {
|
||||
void add(Layer layer);
|
||||
}
|
||||
|
||||
@ExportPackage("vtm")
|
||||
@Export("Map")
|
||||
public interface XMap extends ExportOverlay<Map> {
|
||||
public abstract Layers layers();
|
||||
|
||||
public abstract void setMapPosition(MapPosition pos);
|
||||
|
||||
public abstract MapPosition getMapPosition();
|
||||
|
||||
}
|
||||
|
||||
@ExportPackage("vtm")
|
||||
@Export("MapPosition")
|
||||
public static class XMapPosition implements ExportOverlay<MapPosition> {
|
||||
public XMapPosition(double latitude, double longitude, double scale) {
|
||||
};
|
||||
|
||||
public XMapPosition() {
|
||||
};
|
||||
|
||||
public void setPosition(double latitude, double longitude) {
|
||||
}
|
||||
|
||||
public void setScale(double scale) {
|
||||
}
|
||||
}
|
||||
|
||||
@ExportPackage("vtm")
|
||||
@Export("GenericLayer")
|
||||
public abstract class XGenericLayer implements ExportOverlay<GenericLayer> {
|
||||
public XGenericLayer(Map map, LayerRenderer renderer) {
|
||||
}
|
||||
}
|
||||
|
||||
@ExportPackage("vtm")
|
||||
@Export("TileGridLayer")
|
||||
public static class XTileGridLayer implements ExportOverlay<TileGridLayer> {
|
||||
public XTileGridLayer(Map map) {
|
||||
}
|
||||
}
|
||||
|
||||
@ExportPackage("vtm")
|
||||
@Export("VectorTileLayer")
|
||||
public static class XVectorTileLayer implements ExportOverlay<VectorTileLayer> {
|
||||
public XVectorTileLayer(Map map, TileSource tileSource) {
|
||||
}
|
||||
|
||||
public boolean setTileSource(TileSource tileSource) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setRenderTheme(IRenderTheme theme) {
|
||||
}
|
||||
}
|
||||
|
||||
@ExportPackage("vtm")
|
||||
@Export("OsmTileLayer")
|
||||
public static class XOsmTileLayer implements ExportOverlay<OsmTileLayer> {
|
||||
public XOsmTileLayer(Map map) {
|
||||
}
|
||||
|
||||
public boolean setTileSource(TileSource tileSource) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setRenderTheme(IRenderTheme theme) {
|
||||
}
|
||||
}
|
||||
|
||||
// @ExportPackage("vtm")
|
||||
// @Export("OsmLanduseJsonTileSource")
|
||||
// public static class XOsmLanduseJsonTileSource implements
|
||||
// ExportOverlay<OsmLanduseJsonTileSource> {
|
||||
// public XOsmLanduseJsonTileSource() {
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @ExportPackage("vtm")
|
||||
// @Export("HighroadJsonTileSource")
|
||||
// public static class XHighroadJsonTileSource implements
|
||||
// ExportOverlay<HighroadJsonTileSource> {
|
||||
// public XHighroadJsonTileSource() {
|
||||
// }
|
||||
// }
|
||||
|
||||
@ExportPackage("vtm")
|
||||
@Export("OSciMap4TileSource")
|
||||
public static class XOSciMap4TileSource implements
|
||||
ExportOverlay<OSciMap4TileSource> {
|
||||
public XOSciMap4TileSource(String url) {
|
||||
}
|
||||
|
||||
public XOSciMap4TileSource() {
|
||||
}
|
||||
}
|
||||
|
||||
@ExportPackage("vtm")
|
||||
@Export("LabelLayer")
|
||||
public static class XLabelLayer implements
|
||||
ExportOverlay<LabelLayer> {
|
||||
public XLabelLayer(Map map, VectorTileLayer l) {
|
||||
}
|
||||
}
|
||||
|
||||
@ExportPackage("vtm")
|
||||
@Export("BuildingLayer")
|
||||
public static class XBuildingLayer implements
|
||||
ExportOverlay<BuildingLayer> {
|
||||
public XBuildingLayer(Map map, VectorTileLayer l) {
|
||||
}
|
||||
}
|
||||
|
||||
// @ExportPackage("vtm")
|
||||
// @Export("Viewport")
|
||||
// public interface XViewport extends ExportOverlay
|
||||
//
|
||||
}
|
||||
Reference in New Issue
Block a user