Quantcast
Channel: SCN : All Content - SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 6178

GeoMap AttachClick Doesn't Fire Events

$
0
0

I haven't been able to get the GeoMap to fire a click events. Has anyone been able to get this to work or is this a bug? See simple MVC example below:

 

Thx

 

//** ScnMain.controller.js

sap.ui.controller("scn.ScnMain", { });

 

//** ScnMain.view.js

function clickFunction(ev) {

  console.log("clickFunction ev="+ev);

};

sap.ui.jsview("scn.ScnMain", {

  getControllerName : function() {  return "scn.ScnMain"; },

  createContent : function(oController) {

  var oLayout = sap.ui.commons.layout.VerticalLayout("appLayout", { width: "100%" });

  oLayout.addContent(new sap.ui.commons.ApplicationHeader("appHeader"));

  var gm = new sap.ui.vbm.GeoMap();

  gm.attachClick(clickFunction);

  oLayout.addContent(gm);

  return oLayout;

  }

});

//** index.html

<!DOCTYPE HTML>

<html>

<head>

<meta http-equiv="X-UA-Compatible" content="IE=edge">

<meta http-equiv='Content-Type' content='text/html;charset=UTF-8' />

<script src="resources/sap-ui-core.js" id="sap-ui-bootstrap"

        data-sap-ui-libs="sap.ui.commons" data-sap-ui-theme="sap_bluecrystal"></script>

<script>

  sap.ui.localResources("scn");

  var view = sap.ui.view({id:"idScnMain1", viewName:"scn.ScnMain", type:sap.ui.core.mvc.ViewType.JS});

  view.placeAt("content");

  }

</script>

</head>

<body class="sapUiBody" role="application">

  <div id="content"></div>

</body>

</html>


Viewing all articles
Browse latest Browse all 6178

Trending Articles



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