Lands ArcGIS Geocode
Lands ArcGIS Geocode
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;
}
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';
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: 'AddressPoint',
placeholder: 'Input Addresses',
url: 'https://landsd.azure-api.net/dev/ags/gc/AddressPoint/GeocodeServer'
}, {
name: 'BuildingName',
placeholder: 'Building Name',
url: 'https://landsd.azure-api.net/dev/ags/gc/BuildingName/GeocodeServer'
}, {
name: 'Geo Community',
placeholder: 'Input community Name',
url: 'https://landsd.azure-api.net/dev/ags/gc/GeoComm/GeocodeServer'
}, {
name: 'Place Name',
placeholder: 'Input Place Name',
url: 'https://landsd.azure-api.net/dev/ags/gc/Placename/GeocodeServer'
}, {
name: 'Site Name',
placeholder: 'Input Site Name (e.g. TAIKOO)',
url: 'https://landsd.azure-api.net/dev/ags/gc/SiteName/GeocodeServer'
},...