title: adding marker to map in NativeScript app
body: <p>I'm building a <code>NativeScript</code> app using the <a href="https://www.npmjs.com/package/nativescript-google-maps-sdk" rel="nofollow noreferrer"><code>nativescript-google-maps-sdk</code></a>.</p>
  
  <p>I have added an eventlistener for the <code>coordinateTapped</code> event and now that it is <strong>working</strong> I want to plot a marker on the map at the position at which I tap.</p>
  
  <p>I cannot find an example of this online or in the sdk documentation.
  I feel I am very close and just have a few minor corrections to make.</p>
  
  <pre><code>var mapsModule = require("nativescript-google-maps-sdk");
  
  function onCoordinateTapped(args) {
      console.log("coordinate tapped!");
      var mapView = args.object;
      var marker = new mapsModule.Marker();
      marker.position = mapsModule.Position.positionFromLatLng(args.latitude,args.longitude);
      mapView.addMarker(marker);
  }
  </code></pre>
  
  <p><strong>Note:</strong> I've labelled this question with the <code>google-maps</code> tag as there is no <code>nativescript-google-maps</code> tag.</p>