Search code examples
c#.netgoogle-mapsawesomium

How to use Google Map with Awesomium?


How to call this code in C#?

function initialize() {
  var mapOptions = {
    center: new google.maps.LatLng(-34.397, 150.644),
    zoom: 8
  };

Awesomium v1.7.5.0


Solution

  • You can use WebControl.ExecuteJavascript method to call your JS method from C#.

    yourWebControl.ExecuteJavascript("initialize()");
    

    If you need some result returned from javascript, it may be obtained from ExecuteJavascriptWithResult.

    Global javascript objects that will persist between all loaded pages can be created with CreateGlobalJavascriptObject method.

    See documentation describing Awesomium WebControl methods.