Nokia Here JavaScript API disables pinch zoom in iOS

时光怂恿深爱的人放手 提交于 2019-12-11 11:53:37

问题


I've just started using the Nokia Here API and it works great, but I've noticed that the maps disable pinch zoom on iOS, on both iPhone and iPad.

Here's an example: http://seemann.com/mapsample/

Works fine across most browsers on a desktop, but pinch zooming is not possible on iOS. (Haven't tested on Android.) This happens even when I turn off the Behavior component.

Thoughts?


回答1:


A basic pinch zoom functionality does exist in the HERE Maps API for Javascript - you just need to include the Behavior component as shown.

var map = new nokia.maps.map.Display(mapContainer, {
    // initial center and zoom level of the map
    center: [52.51, 13.4],
    zoomLevel: 10,
    components: [
        // We add the behavior component to allow panning / zooming of the map
        new nokia.maps.map.component.Behavior()]
});

To take a couple of examples

  • Basic Map Components on developer.here.net
  • Headline news story from CNN News

If you don't include Behavior zoom will not work - here is an example

  • Basic Map - no Behavior on developer.here.net

I've just tested the examples using an iPad and they work fine for me.

According to the browser support matrix the API will work on Safari 5+ and iOS 4+



来源:https://stackoverflow.com/questions/14304282/nokia-here-javascript-api-disables-pinch-zoom-in-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!