internal void FireMarkerDoubleClick(GeographicLocation location) { if (DoubleClick != null) { DoubleClick(this, location); } }
internal void FirePolygonClick(GeographicLocation location) { if (Click != null) { Click(this, location); } }
public GeographicLocation ComputeOffset(GeographicLocation from, double distance, double heading) { string jsonFrom = JsonConvert.SerializeObject(from); var result = (string)_host.InvokeScript("computeOffset", jsonFrom, distance, heading); return(JsonConvert.DeserializeObject <GeographicLocation>(result)); }
public double ComputeHeading(GeographicLocation from, GeographicLocation to) { string jsonFrom = JsonConvert.SerializeObject(from); string jsonTo = JsonConvert.SerializeObject(to); return((double)_host.InvokeScript("computeHeading", jsonFrom, jsonTo)); }
internal void FireMarkerRightClick(GeographicLocation location) { if (RightClick != null) { RightClick(this, location); } }
internal void FireMarkerDragEnd(GeographicLocation location) { if (DragEnd != null) { DragEnd(this, location); } }
internal void FireGroundOverlayDoubleClick(GeographicLocation location) { if (DoubleClick != null) { DoubleClick(this, location); } }
internal void FireCircleClick(GeographicLocation location) { if (Click != null) { Click(this, location); } }
public MapOptions() { Zoom = 5; Center = new GeographicLocation(-26.68, 25.27); //South Africa MapType = MapTypeId.Roadmap; AllowScrollWheel = true; KeyboardShortcutsEnabled = true; DraggingEnabled = true; DisableDoubleClickZoom = false; ShowStreetViewControl = true; ShowZoomControl = true; ShowScaleControl = false; ShowRotateControl = false; ShowPanControl = true; ShowOverviewMapControl = false; ShowMapTypeControl = true; ShowMapMakers = false; ZoomControlOptions = new ZoomControlOptions(); StreetViewControlOptions = new StreetViewControlOptions(); ScaleControlOptions = new ScaleControlOptions(); RotateControlOptions = new RotateControlOptions(); PanControlOptions = new PanControlOptions(); OverviewControlOptions = new OverviewControlOptions(); MapTypeControlOptions = new MapTypeControlOptions(); }
internal void FirePolylineRightClick(GeographicLocation location) { if (RightClick != null) { RightClick(this, location); } }
internal void FireRectangleDoubleClick(GeographicLocation location) { if (DoubleClick != null) { DoubleClick(this, location); } }
internal void FireRectangleRightClick(GeographicLocation location) { if (RightClick != null) { RightClick(this, location); } }
public void FireMapCenterChanged(double latitude, double longitude) { _center = new GeographicLocation(latitude, longitude); if (CenterChanged != null) { CenterChanged(_center); } }
public GeographicLocation Interpolate(GeographicLocation from, GeographicLocation to, double fraction) { string jsonFrom = JsonConvert.SerializeObject(from); string jsonTo = JsonConvert.SerializeObject(to); var result = (string)_host.InvokeScript("interpolate", jsonFrom, jsonTo, fraction); return(JsonConvert.DeserializeObject <GeographicLocation>(result)); }
public IMarker AddMarker(GeographicLocation location, MarkerOptions markerOptions, bool hideOthers = false) { string jsonLocation = JsonConvert.SerializeObject(location); string jsonMarkerOptions = JsonConvert.SerializeObject(markerOptions); int markerId = (int)_browser.InvokeScript("addMarker", jsonLocation, jsonMarkerOptions, hideOthers, false); _markers[markerId] = new Marker(_browser, markerId); return(_markers[markerId]); }
public ICircle DrawCircle(GeographicLocation center, double radius, CircleOptions circleOptions, bool hideOthers = false) { string jsonLocation = JsonConvert.SerializeObject(center); string jsonCircleOptions = JsonConvert.SerializeObject(circleOptions); int circleId = (int)_browser.InvokeScript("drawCircle", jsonLocation, radius, jsonCircleOptions, hideOthers); _circles[circleId] = new Circle(_browser, circleId); return(_circles[circleId]); }
public IInfoWindow ShowInfoWindow(string contentString, GeographicLocation location, InfoWindowOptions infoWindowOptions, bool hideOthers = false) { string jsonLocation = JsonConvert.SerializeObject(location); string jsonInfoWindowOptions = JsonConvert.SerializeObject(infoWindowOptions); int infoWindowId = (int)_browser.InvokeScript("showInfoWindow", contentString, jsonLocation, null, jsonInfoWindowOptions, hideOthers, false); _infoWindows[infoWindowId] = new InfoWindow(_browser, infoWindowId); return(_infoWindows[infoWindowId]); }
internal GoogleMapWrapper(IGoogleMapHost browser, MapOptions mapOptions, StreetViewOptions streetViewOptions, string apiKey = null, bool sensor = false, string regionString = null) { _markers = new Dictionary <int, Marker>(); _polygons = new Dictionary <int, Polygon>(); _circles = new Dictionary <int, Circle>(); _infoWindows = new Dictionary <int, InfoWindow>(); _polylines = new Dictionary <int, Polyline>(); _groundOverlays = new Dictionary <int, GroundOverlay>(); _rectangles = new Dictionary <int, Rectangle>(); _browser = browser; ApiKey = apiKey; Sensor = sensor; RegionString = regionString; _mapOptions = mapOptions; _streetViewOptions = streetViewOptions; _zoom = mapOptions.Zoom; _center = mapOptions.Center; StringBuilder documentBuilder = new StringBuilder(); using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(String.Format("{0}.Map.html", this.GetType().Namespace))) { using (StreamReader reader = new StreamReader(stream)) { while (!reader.EndOfStream) { var line = reader.ReadLine(); documentBuilder.AppendLine(line); if (line == "<head>") { //Inject JQuery scripts documentBuilder.AppendLine(GetScriptText()); } } } } _browser.SetHostDocumentText(documentBuilder.ToString()); _browser.RegisterScriptingObject(this); _documentLoaded = true; _streetView = new StreetView(_browser); _geometry = new Geometry(_browser); }
public bool IsLocationOnEdge(IPolyline polyline, GeographicLocation location, double?tolerance) { return((bool)_host.InvokeScript("isLocationOnEdge", location.Latitude, location.Longitude, polyline.PolylineId, false, tolerance)); }
public GeocodingResponse RunGeocoder(GeographicLocation location) { return(GeocodingService.GetResponse(location)); }
public void PanTo(GeographicLocation location) { string jsonLocation = JsonConvert.SerializeObject(location); _browser.InvokeScript("panToLocation", jsonLocation); }
public bool ContainsLocation(IPolygon polygon, GeographicLocation location) { return((bool)_host.InvokeScript("containsLocation", location.Latitude, location.Longitude, polygon.PolygonId)); }
public static GeocodingResponse GetResponse(GeographicLocation location) { var url = new Uri(String.Format("{0}json?latlng={1},{2}&sensor=false", ApiUrl, location.Latitude, location.Longitude)); return(Http.Get(url).As <GeocodingResponse>()); }
public bool IsLocationOnEdge(IPolygon polygon, GeographicLocation location, double?tolerance) { return((bool)_host.InvokeScript("isLocationOnEdge", location.Latitude, location.Longitude, polygon.PolygonId, true, tolerance)); }