Quantcast
Channel: Developer Express Inc.
Viewing all articles
Browse latest Browse all 2388

DataExplorer - Add maps to your app

$
0
0

iPads are mobile devices and hence a lot of them are used on the go and in the field. In such scenarios location services and maps become essential parts of an app. With version 1.4 of DataExplorer you can now add maps to your apps.

To show a location on a map you need the coordinates of that location or its address. If you have the coordinates the location can be shown immediately, but if you have just an address a geocoding request to the Apple server has to be done to translate this address into its coordinates. To support showing locations by coordinates, we implemented the ability to read the GeographyPoint values (part of the OData v3 specification).

If you want to show just one location on a map, like an address of a person, you can use the value of the GeographyPoint property of an entity (a person object, for example). Alternatively you can choose a String or a ComplexType (representing an address) property and DataExplorer will do a geocoding request to get the coordinates of this location before showing it on a map.



For multiple locations only GeographyPoint properties are supported. Let me explain why. Geocoding requests are rate-based for each app, meaning that an app cannot do many such requests in a short period of time. Usually if an app does more than 10 requests per second it starts receiving errors back from the server instead of coordinates. So the geocoding "speed" is not sufficient for any real usage when there are a lot of locations to process. For now DataExplorer supports the GeographyPoint properties only to show locations for multiple entities. This might change in the future if we find a way to overcome this limitation or use it more efficiently. So if you have several locations that you need to show on a map, then it would be better to geocode all these locations ahead of time and cache the coordinates in your data source. This way you will be able to show them on a map immediately without any need for runtime geocoding.



Locations are represented on a map using pins. Each pin shows a callout with the information about its associated location. You can specify 2 entity properties that will be used to provide data for the title and subtitle of this callout. The optional driving directions button is located on the left side of the pin's callout. Tapping on it will open the standard Maps app; the driving directions from the current user location to the location associated with the pin will be shown as well. We think it's more convenient to use a dedicated navigation app (like the standard Maps app) for the driving directions than a map inside a custom iOS app.

For the maps showing multiple locations, tapping on a pin will not only show a callout but will also change the current entity of the map data source to the entity associated with the pin's location. So all the detail screens linked to the master map screen will get updated with the detail data of the current entity.

As you would expect from an iOS app most of the features you see in the standard Maps app are supported in DataExplorer, including pan, zoom, and rotate. In addition, you can:

  • display the map as Standard, Hybrid, or Satellite and allow the end-user to change the display type;
  • animate the change of location;
  • show the current user location as well.



We hope that the new Maps support in DataExplorer will help you to provide your users a more convenient way to work with the location data in your apps.


Viewing all articles
Browse latest Browse all 2388

Trending Articles