Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

GeoMap AttachClick Doesn't Fire Events

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>

Tags:
Former Member
replied

So I have debugged VBI libs and managed to get mouse position on mouse click. See here - JS Bin - Collaborative JavaScript Debugging

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question