Adding maps to DominoKit

Originally posted on 2020-11-04

Want to add a map to a DominoKit project? If OpenLayers meets your needs check out domino-ui-map-addon. Take a look at the to see what's involved in getting it set up.

And don't forget to add the necessary inherits tag to your gwt.xml file:

<inherits name='org.dominokit.addons.ol.OLMapAddon'/>

Here's the code for the simplest map on a card implementation I could come up with in DominoKit:

package com.awslabs.iatt.spe.serverless.gwt.client;

import org.dominokit.addons.ol.presets.MapPresets;
import org.dominokit.addons.ol.ui.MapCard;
import org.dominokit.domino.ui.icons.Icons;
import org.dominokit.domino.ui.layout.Layout;
import org.dominokit.domino.ui.tabs.Tab;
import org.dominokit.domino.ui.tabs.TabsPanel;

public class IotEntryPoint implements EntryPoint {
    public static final String MAP_ID = "mapId";

    public void onModuleLoad() {
        Layout layout = Layout.create("Map test")

        TabsPanel tabsPanel = TabsPanel.create();
        Tab mapTab = Tab.create(Icons.ALL.bug_check_mdi(), "Map card");
        MapCard mapCard = new MapCard(MAP_ID, "Map in a card");