Sample Widget

The sample of google map widget definition allows rendering the google map in the specified container.

com.tibco.mdm.uibuilder.WidgetBuilder.createMywid =
function(selector, config){
// Set property values
if(config.width) {
$(selector).width(config.width);
}
if(config.height) {
$(selector).height(config.height);
}
var url = 'https://www.google.com/jsapi';
$.getScript(url, function(){
var container = $(selector).get(0);
google.load('maps', '3',
{
other_params: 'sensor=false',
callback: function(){
var mapOptions = {
zoom: 8,
center: new google.maps.LatLng(-34.397, 150.644)
};
var map = new google.maps.Map(container, mapOptions);
}
});
});
}