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); }
/// <summary> /// Creates a new Google Map /// </summary> /// <param name="host">Browser host to host Google Maps i</param> /// <param name="mapOptions">Customize the look of the map</param> /// <param name="streetViewOptions">Customize the look of the street view panormama</param> /// <param name="apiKey">API key (Optional, but if required visit this site: "https://code.google.com/apis/console/")</param> /// <param name="sensor">Whether calling from a sensor. Defaults to false.</param> /// <param name="regionString">Country code (ie. "za"). Defaults to NULL</param> /// <returns>Interface to interact with Google Maps</returns> public static IGoogleMapWrapper Create(IGoogleMapHost host, MapOptions mapOptions, StreetViewOptions streetViewOptions, string apiKey = null, bool sensor = false, string regionString = null) { return(new GoogleMapWrapper(host, mapOptions, streetViewOptions, apiKey, sensor, regionString)); }
/// <summary> /// Creates a new Google Map /// </summary> /// <param name="host">Browser host to host Google Maps in</param> /// <returns>Interface to interact with Google Maps</returns> public static IGoogleMapWrapper Create(IGoogleMapHost host) { return(new GoogleMapWrapper(host, new MapOptions(), new StreetViewOptions())); }
internal GroundOverlay(IGoogleMapHost host, int groundOverlayId) { GroundOverlayId = groundOverlayId; _host = host; }
internal InfoWindow(IGoogleMapHost host, int infoWindowId) { InfoWindowID = infoWindowId; _host = host; }
internal Circle(IGoogleMapHost host, int circleId) { CircleId = circleId; _host = host; }
internal Marker(IGoogleMapHost host, int markerId) { MarkerId = markerId; _host = host; }
internal Polyline(IGoogleMapHost host, int polylineId) { PolylineId = polylineId; _host = host; }
internal Rectangle(IGoogleMapHost host, int rectangleId) { RectangleId = rectangleId; _host = host; }
public Geometry(IGoogleMapHost host) { _host = host; }
internal Polygon(IGoogleMapHost host, int polygonId) { PolygonId = polygonId; _host = host; }
public StreetView(IGoogleMapHost host) { _host = host; _markers = new Dictionary<int, Marker>(); _infoWindows = new Dictionary<int, InfoWindow>(); }