Lands ArcGIS Geocode 2 (DEV)

Lands ArcGIS Geocode 2

by LandsD Map API

HTML

<link rel="stylesheet" href="https://js.arcgis.com/3.20/esri/css/esri.css">
<link rel="stylesheet" href="https://js.arcgis.com/3.20/dijit/themes/nihilo/nihilo.css">
<script src="https://js.arcgis.com/3.20/"></script>
<div id="search"></div>
<div id="map-area"></div>
<div id="landsdlogo" class="landsdlogo"></div>

CSS

html,
 body,
 #map-area {
   //height: 100%;
   //width: 100%;
   margin: 2;
   padding: 2;
 }
 
 #search {
   display: block;
   position: absolute;
   z-index: 2;
   top: 30px;
   left: 75px;
 }

.logo-med {
    width: 46px !important;
    height: 22px !important;
    background-image: url(https://js.arcgis.com/3.20/esri/images/map/logo-sm.png) !important;
    }

#landsdlogo {
  display: inline-block;
  vertical-align: bottom;
  width: 25px;
  height: 25px;
  background: url(https://mapapis01.blob.core.windows.net/images/landsdlogo.jpg);
  background-repeat: no-repeat;
  background-size: 25px 25px;
}

.esriAttribution {
  background: transparent;
}

JavaScript

// resize map
const mapdiv = window['map-area'];
var margin;
if (document.all) {
  margin = parseInt(document.body.currentStyle.marginTop, 10) + parseInt(document.body.currentStyle.marginBottom, 10);
} else {
  margin = parseInt(document.defaultView.getComputedStyle(document.body, '').getPropertyValue('margin-top')) + parseInt(document.defaultView.getComputedStyle(document.body, '').getPropertyValue('margin-bottom'));
}
mapdiv.style.height = (window.innerHeight - margin) + 'px';

/////
var map

var apikey = 'f4d3e21d4fc14954a1d5930d4dde3809' //landsd.azure-api.net starter key

require([
  "dojo/dom",
  "esri/tasks/locator",
  "esri/dijit/Search",
  "esri/symbols/PictureMarkerSymbol",
  "esri/InfoTemplate",
  "esri/layers/ArcGISTiledMapServiceLayer",
  "esri/SpatialReference",
  "esri/geometry/Point",
  "esri/dijit/Popup",
  "esri/dijit/PopupTemplate",
  "esri/layers/FeatureLayer",
  "esri/map",
  "esri/dijit/Scalebar",
  "dijit/layout/BorderContainer",
  "dijit/layout/ContentPane",
  "dijit/TitlePane",
  "dijit/form/CheckBox",
  'dojo/_base/json',
  "dojo/domReady!"
], function(
  dom, Locator, Search, PictureMarkerSymbol, InfoTemplate,
  ArcGISTiledMapServiceLayer, SpatialReference, Point,
  Popup,
  PopupTemplate,
  FeatureLayer, Map, 
  Scalebar
) {

  var locatorUrls = [{
    name: 'Address',
    placeholder: 'Input Addresses',
    url: 'https://landsd.azure-api.net/dev/ags/gc/loc/address'
  }, {
    name: 'Building',
    placeholder: 'Building Name',
    url: 'https://landsd.azure-api.net/dev/ags/gc/ib1000/buildings/building'
  }, {
    name: 'Building Licence',
    placeholder: 'e.g BL 1/11',
    url: 'https://landsd.azure-api.net/dev/ags/gc/ic1000/buildinglicence'
  }, 
  {
    name: 'Geo Community',
    placeholder: 'Input community Name',
    url: 'https://landsd.azure-api.net/dev/ags/gc/loc/geocomm'
  }, {
    name: 'Place Point',
    placeholder: 'e.g Tsim Sha Tsui',
    url: 'https://landsd.azure-api.net/dev/ags/gc/ib5000/poi/placepoint'
  }, {
   ...