• 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>Data Matching with the Advanced Data Sets</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="markers-on-the-map">

    <div class="page-header">
        <h1>Data Matching with the Advanced Data Sets</h1>
        <p>Match routing result with the Advanced Data Set.</p>
    </div>
    <p>
        This example displays a movable map that contains the route polyline and the data about the location
        of electric vehicle charging stations provided by the <a href="https://www.here.com/docs/bundle/fleet-telematics-api-developer-guide/page/README.html" target="_blank">Fleet Telematics Advanced Data Sets REST API</a>.
        The search for the nearest charging stations is made by the polyline's bounding box. Stations that are adjacent to the route itself are marked with green.
    </p>
    <div id="map"></div>
    <h3>Code</h3>
    <p>
      The example uses <code>H.service.extension.platformData.SearchRequest</code>
      class to fetch data from the Advanced Data Sets service. The <code>data</code> event listener matches the provided array of
      <code>LINK_IDs</code> from the routing service and search results from the Advanced Data Sets layer
      to apply correct colour to the <code>H.map.Marker</code>.</p>
    <script type="text/javascript" src='demo.js'></script>
  </body>
</html>