Quantcast
Channel: SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 789

Google Maps library for UI5

$
0
0

There are a number of map providers available to use with UI5, none of them seemed to me to be as simple to use as Google Maps, so I wrote a library.

map1.png

 

Getting Started

Goto OpenUI5 Googlemaps Library Github page, download and install the library


Include the library


sap.ui.getCore().loadLibrary("openui5.googlemaps", "../openui5/googlemaps/");

 

Add a openui5.googlemaps control to your page

 

 

<?xml version="1.0" encoding="UTF-8" ?><mvc:View xmlns:mvc="sap.ui.core.mvc"    xmlns:gmaps="openui5.googlemaps"    controllerName="sampleController">    <gmaps:Map height="250px" zoom="12" lat="-33.895" lng="151.275">        <gmaps:markers>            <gmaps:Marker lat="-33.895" lng="151.275" info="Bondi Beach" />        </gmaps:markers>    </gmaps:Map></mvc:View>

 

Its as simple as that.

 

The openui5.googlemaps library supports Maps, Markers, Polylines and Polygons.

It also has Location detection and the ability to add an API key.

 

Along with the library there are also a number of sample applications to help get you started.

map2.png

The library if FOSS, contributions welcome, any issues please report through sapui5  - Stack Overflow

 

Enjoy


Viewing all articles
Browse latest Browse all 789

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>