html – HERE Maps嵌入代码

有人能告诉我如何从这里的地图中获得一个简单的嵌入代码吗?我根本无法找到我认为应该在任何地图网站上的嵌入按钮.具有讽刺意味的是我在这里制作一个网站所以我不允许得到一个谷歌地图.谢谢

最佳答案
对于一个简单的静态HERE贴图,您应该看一下Map Image API – 这将嵌入一个简单的图像.但是,如果您想要一张可移动的地图,可以在IFrame中使用HERE Maps API for JavaScript并传递您选择的纬度,经度和缩放级别,例如:就像是:

Meta name="viewport" content="initial-scale=1.0,width=device-width" />
  aram  {String} name key in the query string
 * @return {String}      value
 */
function getParameterByName(name) {
  name = name.replace(/[\[]/,'\\\[').replace(/[\]]/,'\\\]');
  var regex = new RegExp('[\\?&]'  + name + '=([^&#]*)'),results = regex.exec(location.search);
  return results === null ? '' :
    decodeURIComponent(results[1].replace(/\+/g,' '));
}

/**
 * Moves the map to display at  agiven location
 * @param  {H.Map} map      A HERE Map instance within the application
 */
function moveMap(map,location,zoom){
    var lat = getParameterByName('lat'),lng = getParameterByName('lng');
    zoom = getParameterByName('zoom');

  map.setCenter({lat: lat,lng: lng});
  map.setZoom(zoom);
}


/**
 * Boilerplate map initialization code starts below:
 */

//Step 1: initialize communication with the platform
var platform = new H.service.Platform({
  app_id: 'normal.map);

//Step 3: make the map interactive
// MapEvents enables the event system
// Behavior implements default interactions for pan/zoom (also on mobile touch environments)
var behavior = new H.mapevents.Behavior(new H.mapevents.MapEvents(map));

// Create the default UI components
var ui = H.ui.UI.createDefault(map,defaultLayers);

// Now use the map as required...
moveMap(map);


  

可以调用iframe指定高度和宽度: