Service-Component:\
OSGI-INF/mapLayer.xml,\
OSGI-INF/overviewMap.xml
+
+Provide-Capability:\
+cms.publish;pkg=org.djapps.on.openheritage.ui,file="*.png,*.js,*.html"
\ No newline at end of file
--- /dev/null
+package org.argeo.support.openlayers;
+
+import org.argeo.cms.ui.util.CmsUiUtils;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+
+public class OLMap extends Composite {
+ private Label div;
+
+ public OLMap(Composite parent, int style) {
+ super(parent, style);
+ setLayout(CmsUiUtils.noSpaceGridLayout());
+ div = new Label(this, SWT.NONE);
+ CmsUiUtils.markup(div);
+ CmsUiUtils.disableMarkupValidation(div);
+ div.setText("<div id='map'></div>");
+ div.setLayoutData(CmsUiUtils.fillAll());
+ }
+
+}
Query query = context.getSession().getWorkspace().getQueryManager()
.createQuery("SELECT * FROM [" + EntityType.geopoint.get() + "]", Query.JCR_SQL2);
List<Node> geoPoints = JcrUtils.nodeIteratorToList(query.execute().getNodes());
- OpenLayersMap apafMap = new OpenLayersMap(parent, SWT.NONE, getClass().getResource("map-osm.html"));
- apafMap.setLayoutData(CmsUiUtils.fillAll());
+ OpenLayersMap map = new OpenLayersMap(parent, SWT.NONE, getClass().getResource("map-osm.html"));
+ map.setLayoutData(CmsUiUtils.fillAll());
// apafMap.setZoom(7);
// apafMap.setCenter(-2.472, 8.010);
- apafMap.addPoints(geoPoints);
+ map.addPoints(geoPoints);
}
}
--- /dev/null
+var map = new ol.Map({
+ target : 'map',
+ layers : [ new ol.layer.Tile({
+ source : new ol.source.OSM()
+ }) ],
+ view : new ol.View({
+ center : ol.proj.fromLonLat([ 34, 34 ]),
+ zoom : 4
+ })
+});
+
\ No newline at end of file