Skip to content

dirigiblelabs/building-blocks-map

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Building Blocks - Map

Dirigible Version Run on Dirigible

Overview:

Embeddable Google Maps building block for displaying markers on the map.

Setup:

  1. Retrieve Addresses

    • Update building-blocks-map/api/addresses.js:

      var response = require("http/v3/response");
      var query = require("db/v3/query");
      
      var sql = "SELECT ADDRESSLINE1, CITY from USER_ADDRESSES";
      
      var addresses = query.execute(sql).map(e => {
      	return {
                  address: e.ADDRESSLINE1,
          	    city: e.CITY
      	};
      });
      
      response.println(JSON.stringify(addresses));
  2. Embed into existing application

    • Update building-blocks-map/ui/Map/extensions/view.extension:

      Extension Point = <your-application-extension-point> // e.g: launchpad-demo-Users-view
      
  3. Provide Google API Key

    • Update building-blocks-map/ui/Map/index.html:

      <script async defer src="https://maps.googleapis.com/maps/api/js?callback=initMap&key=YOUR-API-KEY"></script>

      Where e.g: YOUR-API-KEY = BI2aXyCk0xMMEr2LxUYjD73weVv4hQVXD2oPw4q