• JavaScript
  • HTML
                  
                  

                  
                
                  
                  
<!DOCTYPE html>
<html>
  <head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=yes">
    <meta http-equiv="Content-type" content="text/html;charset=UTF-8">
    <title>Search for a Location given a Structured Address</title>
    <link rel="stylesheet" type="text/css" href="https://js.api.here.com/v3/3.1/mapsjs-ui.css" />
    <link rel="stylesheet" type="text/css" href="demo.css" />
    <link rel="stylesheet" type="text/css" href="styles.css" />
    <link rel="stylesheet" type="text/css" href="../template.css" />
    <script type="text/javascript" src='../test-credentials.js'></script>
    <script type="text/javascript" src="https://js.api.here.com/v3/3.1/mapsjs-core.js"></script>
    <script type="text/javascript" src="https://js.api.here.com/v3/3.1/mapsjs-service.js"></script>
    <script type="text/javascript" src="https://js.api.here.com/v3/3.1/mapsjs-ui.js"></script>
    <script type="text/javascript" src="https://js.api.here.com/v3/3.1/mapsjs-mapevents.js"></script>
  <script>window.ENV_VARIABLE = 'developer.here.com'</script><script src='../iframeheight.js'></script></head>
  <body id="geocode">
    <div class="page-header">
        <h1>Search for a Location given a Structured Address</h1>
        <p>Request a location from a structured address and display it on the map.</p>
    </div>
    <p>This example makes a geocode request and retrieves the latitude, longitude and complete address details of
      <b>425 Randolph St, Chicago, IL</b> based on partial address information. Two addresses are found -
      <i>425 E Randolph St.</i>, and <i>425 W Randolph St.</i> A clickable marker is placed on each location found.</p>
    <div id="map"></div>
    <div id="panel"></div>
    <h3>Code</h3>
    <p>Access to the geocoding service is obtained from the <code>H.service.Platform</code>
       by calling <code>getSearchService()</code>. The <code>geocode()</code> method is used
       to find a location by passing in the relevant values to the <code>qq</code> parameter (i.e. <code>country</code>, <code>city</code>,
       <code>street</code> and <code>housenumber</code>) as defined in
       <a href="https://www.here.com/docs/bundle/geocoding-and-search-api-v7-api-reference/page/index.html#/paths/~1geocode/get" target="_blank">Geocoding and Search API v7
       </a>.
       The styling and display of the response is under the control of the developer.</p>
    <script type="text/javascript" src='demo.js'></script>
  </body>
</html>