void CreateMarker(double lat, double lng, string name, int k) { GLatLng latLng = new GLatLng(lat, lng, true); GMarker marker = new GMarker(latLng); Script.Literal("{0}.k = {1};", marker, k); Script.Literal("{0}.name = {1};", marker, name); GEvent.addListener(marker, "click", delegate() { this.view.uiPlacesMultiSelector.AddItem(name, k.ToString()); }); GEvent.addListener(marker, "mouseover", delegate() { Script.Literal("stt({0});", name); }); GEvent.addListener(marker, "mouseout", delegate() { try { Script.Literal("htm();"); } catch (Exception e) { } }); this.view.uiMap.Gmap2.addOverlay(marker); markers[markers.Length] = marker; }
public Controller(View view) { this.view = view; Gmap2 = new GMap2(view.map); Gmap2.addControl(new GLargeMapControl()); double north = Number.ParseFloat(view.uiNorth.Value); double south = Number.ParseFloat(view.uiSouth.Value); double west = Number.ParseFloat(view.uiWest.Value); double east = Number.ParseFloat(view.uiEast.Value); double deltaLat = north - south; double delatLng = east - west; GLatLng ne = new GLatLng(north + deltaLat / 20, east + delatLng / 20, true); GLatLng sw = new GLatLng(south - deltaLat / 20, west - delatLng / 20, true); GLatLngBounds bounds = new GLatLngBounds(sw, ne); bounds.extend(sw); bounds.extend(ne); int zoom = Gmap2.getBoundsZoomLevel(bounds); if (zoom > 12) zoom = 12; GLatLng centre = new GLatLng((north + south) / 2, (east + west) / 2, true); Gmap2.enableScrollWheelZoom(); Gmap2.setCenter(centre, zoom); Gmap2.enableContinuousZoom(); Gmap2.enableDoubleClickZoom(); Gmap2.enableGoogleBar(); Gmap2.checkResize(); }
public GMarker(GLatLng gLatLng, GMarkerOptions options) { }
//public static class GEvents //{ // public const string click = "click"; // public const string dblclick = "dblclick"; // public const string mousedown = "mousedown"; // public const string mouseup = "mouseup"; // public const string mouseover = "mouseover"; // public const string mouseout = "mouseout"; // public const string infowindowopen = "infowindowopen"; // public const string infowindowbeforeclose = "infowindowbeforeclose"; // public const string infowindowclose = "infowindowclose"; // public const string remove = "remove"; // public const string dragstart = "dragstart"; // public const string drag = "drag"; // public const string dragend = "dragend"; // public const string visibilitychanged = "visibilitychanged"; //} public GMarker(GLatLng gLatLng) { }
public GLatLngBounds(GLatLng sw, GLatLng ne) { }
public void extend(GLatLng bound) { }
public void panTo(GLatLng gLatLng) { }
public GPoint fromLatLngToContainerPixel(GLatLng latLng) { return null; }
public void setCenter(GLatLng latLng, int zoom) { throw new Exception(""); }