简体   繁体   English

诺基亚在这里地图和移动捏缩放

[英]Nokia here map and mobile pinch zoom

I used Nokia here map (version 2.5.4) within my web application, but if I open my web site on mobile device (Tested on Android 4.x Nexus 7 ,IOS7 IPhone5c ) it is unable pinch-to-zoom. 我在Web应用程序中使用了诺基亚此处的地图(版本2.5.4),但是如果我在移动设备上打开网站(在Android 4.x Nexus 7上测试,IOS7 IPhone5c进行了测试),则无法放大。 I also found a similar issue: Nokia Here JavaScript API disables pinch zoom in iOS 我还发现了一个类似的问题: Nokia Here JavaScript API在iOS中禁用捏缩放

I also try downgrade here map API version to 2.2.3, pinch-to-zoom is working but I cannot use the built-in marker function in 2.2.3 version. 我也尝试在此处将地图API版本降级到2.2.3,“捏到缩放”功能正常,但是我无法在2.2.3版本中使用内置的标记功能。

Any solution/suggest? 任何解决方案/建议?

I found the solution! 我找到了解决方案! First we detect client , if client device is mobile/tablet Than load 2.2.1 here map , otherwise load newly version 首先我们检测客户端,如果客户端设备是移动设备/平板电脑,则在此处加载2.2.1映射,否则重新加载版本

In my case , i also need use custom icon marker with overlay text . 就我而言,我还需要使用带有覆盖文字的自定义图标标记。

In newly version , i can use https://github.com/heremaps/examples/tree/master/maps_api_for_javascript/demos/text-on-icon-marker to meet the requirement. 在新版本中,我可以使用https://github.com/heremaps/examples/tree/master/maps_api_for_javascript/demos/text-on-icon-marker来满足要求。

Unfortunately , in 2.2.1 above solution is not working, but we can referring to http://api.maps.nokia.com/en/playground/examples/maps/map_objects/customsvgmarker.html using SVG image instead of bitmap . 不幸的是,在2.2.1中,上述解决方案不起作用,但是我们可以使用SVG图像而不是bitmap来引用http://api.maps.nokia.com/en/playground/examples/maps/map_objects/customsvgmarker.html

But this solution only working on Android 4.x . 但是此解决方案仅适用于Android4.x。 IOS is not working iOS不起作用

Please use the newest Here Maps API for JavaScript 3.0, you can find more information on developer.here.com , this Version is optimized for mobile usage. 请使用最新的JavaScript 3.0 Here Maps API,您可以在developer.here.com上找到更多信息,此版本针对移动使用进行了优化。

An extensive set of examples for the API can be found on the API Explorer . 可以在API Explorer中找到有关该API的大量示例。 There is also a migration guide available to help your upgrade from 2.x to 3.x 还有一个迁移指南可帮助您从2.x升级到3.x

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM