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 int getBoundsZoomLevel(GLatLngBounds bounds) { return -1; }