public void ShowPushPin(LatLong position, PushPin pin)
 {
     // Show pushpin
     object[] args = new object[] { pin.Identity
                                    , position.Latitude
                                    , position.Longitude
                                    , pin.Title
                                    , pin.Description };
     browser.InvokeScript("ShowPushPin", args);
 }
        private void ShowPolylineInternal(IList <MapLocation> locations)
        {
            // Can only show polyline if there are more than one location
            if (locations.Count > 1)
            {
                // Create polyline
                foreach (MapLocation location in locations)
                {
                    object[] args = new object[] { location.Position.Latitude
                                                   , location.Position.Longitude };
                    browser.InvokeScript("AddLinePoint", args);
                }

                // Show polyline
                {
                    object[] args = new object[] { "aMapId" };
                    browser.InvokeScript("ShowPolyline", args);
                }
            }

            // Add pushpins in reverse order
            // TODO implement this in javascript instead
            for (int i = locations.Count; i > 0; i--)
            {
                if (locations[i - 1].PushPin != null)
                {
                    LatLong position = locations[i - 1].Position;
                    PushPin pin      = locations[i - 1].PushPin;
                    ShowPushPin(position, pin);
                }
            }

            {
                object[] args = new object[] { "aMapId" };
                browser.InvokeScript("SetMapView", args);
            }
        }