Question & Answer
Question
How to develop location-aware apps in IBM MobileFirst/Worklight, Part 3?
Answer
On Demand Consulting
Author: Siwen Wang
The part 3 on development of location-aware apps in IBM MobileFirst/Worklight by Hisham Abdel-Hafez shows how to take all location info obtained and display on a map that users can interact with. There are multiple options for doing this, and this article will discuss two of them: using OpenLayers and using Google Maps.
OpenLayers?is a pure JavaScript library for displaying map data in most modern web browsers and mobile devices with no server-side dependencies. OpenLayers makes it easy to put a map in any web page. It can display map tiles and markers loaded from any source.
Dojo?s?dojox.geo.openlayers module provides a mapping component based on the OpenLayers library. This component is mainly a wrapper of the OpenLayers library with some additional features.
Another approach to display maps on mobile apps is to use the Google Maps application programming interface (API) using class?google.maps.Map. To create an object of this class you need to pass to it a DOM element that it will use (typically an HTML div) and a?MapOptions?object to use for configuration. This object will contain parameters for where to center the map, what is the needed zoom level and what is the map type, like in the snippet below. Once the map object is constructed, it will start showing up immediately.
For more detailed procedure, please follow the link below.
Developing location aware applications in IBM MobileFirst/Worklight Part 3
Was this topic helpful?
Document Information
Modified date:
08 December 2018
UID
ibm10771899