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

Set Location on Google Map, just by providing an Address - UI5 Custom Control

$
0
0

Hii

 

This is a simple custom control that creates a Google Map and sets the location based on the address provided ! The control can be instantiated in a simpler way just like this,

 

var oMap = new ref.google.Map({ address:"Bangalore" });

This will produce,

 

Capture.JPG

The Address just doesn't have to be a city, it can be any valid address.

 

Don't forget to check out this snippet, http://jsbin.com/zetel/1/edit where i have done some sample implementations with various address by creating a JSON Model.

 

The custom control code is avail - https://gist.github.com/ikiw/775a2a438571ba4e00d3

 

This control requires Google maps library which can be loaded next to the sapui5 bootstrap script

 

<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>

 

Let me know if you've got something to collaborate/enhance this.

 

 

Regards

Sakthivel


Viewing all articles
Browse latest Browse all 789

Trending Articles



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