• 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>Marker Clustering with Custom Theme</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 type="text/javascript" src="https://js.api.here.com/v3/3.1/mapsjs-clustering.js"></script>
    <script type="text/javascript" src="./data/photos.js"></script>
    <style type="text/css">
      .bubble {
          font-size: 11px;
          line-height: 15px;
          color: white;
      }
      .bubble-image {
          width: 300px;
          height: 100px;
          background-size: cover;
          background-position: center;
          display: block;
      }
      .bubble-logo {
          float: left;
          margin-right: 1em;
          margin-bottom: 4px;
      }
      .bubble-footer {
          display: table;
      }
      .bubble-desc {
          display: table-cell;
          vertical-align: middle;
      }
      .bubble a {
          text-decoration: none;
          color: white !important;
      }
      .bubble a:hover {
          text-decoration: underline;
      }
      
      .bubble hr {
          margin: 5px 0px;
      }
      </style>
  <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>Marker Clustering with Custom Theme</h1>
        <p>Cluster multiple markers and customize the theme</p>
    </div>
    <p>This example displays a map showing geo-tagged clusters of photographs 
      taken from locations around the world. The <a href="http://commons.wikimedia.org/wiki/Main_Page" target="_blank">Wikimedia Commons</a>
      website was used to provide a source of data of geo-tagged images.</p>
    <div id="map"></div>
    <h3>Code</h3>
    <p>Marker clustering requires the presence of the <code>mapsjs-clustering</code> module of the API. The 
      <code>H.clustering.Provider</code> class is used to load in data points and prepare them for clustering. </p>
    <p>Customizing the default look-and-feel of the <code>clusters</code> and <code>noise</code> points is 
      very easy. When instantiating the <code>H.clustering.Provider</code>, a <code>theme</code> object holding two methods - 
      <code>getClusterPresentation()</code> and <code>getNoisePresentation()</code> - is passed as an additional parameter 
      into the constructor. Both <code>theme</code> methods must return an <code>H.map.Object</code> such as a marker or polygon etc. 
      More information can be found in the API Reference.</p>
    <script type="text/javascript" src='demo.js'></script>
  </body>
</html>