EZMapdesign
EZMapdesign

Reputation: 203

Is it possible to use Tilestache with HERE maps Javascript API?

I have been browsing the HERE Maps API for Javascript docs for a while now and found no information whther it was possible to use custom tiles from Tilestache in HERE Maps API for Javascript.

My question to you who are more experienced with this API than me: Is it possible to use custom tiles at all in HERE Maps API for Javascript?

Many thanks in advance!

Upvotes: 0

Views: 134

Answers (1)

SirBif
SirBif

Reputation: 305

It's possible to use custom map tiles with here maps. You can find an example of how to do it here:

https://developer.here.com/api-explorer/maps-js/v3.0/infoBubbles/custom-tile-overlay

I recommend checking the full example, but in any case the key points are these:

1) create a tile provider and specify the url format

var tileProvider = new H.map.provider.ImageTileProvider({
    // We have tiles only for zoom levels 12–15,
    // so on all other zoom levels only base map will be visible
    min: 12,
    max: 15,
    getURL: function (column, row, zoom) {
        ... omitted
        
        // The Old Berlin Map Tiler follows the TMS URL specification.
        // By specification, tiles should be accessible in the following format:
        // http://server_address/zoom_level/x/y.png
        return 'tiles/'+ zoom+ '/'+ row + '/'+ column+ '.png';
      }
    }
  });

2) Create a layer and add it to the map

// Now let's create a layer that will consume tiles from our provider
  var overlayLayer = new H.map.layer.TileLayer(tileProvider, {
    // Let's make it semi-transparent
    opacity: 0.5
  });

  // Finally add our layer containing old Berlin to a map
  map.addLayer(overlayLayer);

Upvotes: 1

Related Questions