protected void Page_Load(object sender, EventArgs e) { GDirection gdirection = new GDirection(true); gdirection.errorMessage = "Ups"; GMap1.Add(gdirection); }
// Use this for initialization void Start() { gravity = Mathf.Abs(Physics2D.gravity.y + Physics2D.gravity.x); gravityDown = new Vector2(0, -gravity); gravityUp = new Vector2(0, gravity); gravityLeft = new Vector2(-gravity, 0); gravityRight = new Vector2(gravity, 0); gDirection = GDirection.DOWN; currentGDir = GDirection.DOWN; UpdateGravity(); }
public void findeMap() { GMap1.setCenter(new GLatLng(x, y)); GMap1.enableHookMouseWheelToZoom = true; GDirection direction = new GDirection(true); //direction.clearMap = true; //direction.avoidHighways = true; direction.travelMode = GDirection.GTravelModeEnum.G_TRAVEL_MODE_WALKING; direction.locale = "en"; GMap1.Add(direction); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { GDirection direction = new GDirection(); direction.autoGenerate = false; direction.buttonElementId = "bt_Go"; direction.fromElementId = tb_fromPoint.ClientID; direction.toElementId = tb_endPoint.ClientID; direction.divElementId = "div_directions"; direction.clearMap = true; direction.travelMode = GDirection.GTravelModeEnum.G_TRAVEL_MODE_DRIVING; GMap1.Add(direction); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { GDirection direction = new GDirection(); direction.autoGenerate = false; direction.buttonElementId = "bt_Go"; direction.fromElementId = tb_fromPoint.ClientID; direction.toElementId = tb_endPoint.ClientID; direction.divElementId = "div_directions"; direction.clearMap = true; // Optional // direction.locale = "es-ES"; GMap1.Add(direction); } }
void UpdateGravity() { if (gDirection == GDirection.LEFT) { Physics2D.gravity = gravityLeft; currentGDir = GDirection.LEFT; } if (gDirection == GDirection.RIGHT) { Physics2D.gravity = gravityRight; currentGDir = GDirection.RIGHT; } if (gDirection == GDirection.UP) { Physics2D.gravity = gravityUp; currentGDir = GDirection.UP; } if (gDirection == GDirection.DOWN) { Physics2D.gravity = gravityDown; currentGDir = GDirection.DOWN; } }
protected void Page_Load(object sender, EventArgs e) { //reset listeners, necessary for marker listener to work between postback GMap1.resetListeners(); //hide objects to be hidden lblDistancesError.Visible = false; lblStopsError.Visible = false; //Create default marker GIcon icon = new GIcon(); icon.image = "http://labs.google.com/ridefinder/images/mm_20_red.png"; icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png"; icon.iconSize = new GSize(20, 28); icon.shadowSize = new GSize(30, 28); icon.iconAnchor = new GPoint(10, 18); icon.infoWindowAnchor = new GPoint(5, 1); GMap1.mapType = GMapType.GTypes.Hybrid; GMarkerOptions mOpts = new GMarkerOptions(); mOpts.clickable = false; mOpts.icon = icon; GMarker marker = new GMarker(hwttc, mOpts); //End create default marker /*//Begin Listener for click map marker.javascript_GLatLng = "point"; GListener listener = new GListener(marker.ID, GListener.Event.dragend, "alertame"); System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append("function(overlay, point) {"); sb.Append("if (overlay){"); sb.Append("alert(overlay.id);"); sb.Append("}"); sb.Append("else{"); sb.Append(marker.ToString(GMap1.GMap_Id)); sb.Append(listener.ToString()); sb.Append("lastclick.lat = marker.point.lat;"); sb.Append("lastclick.lng = marker.point.lng;"); sb.Append("txtLat.text = Convert.ToToString(lastclick.lat);"); sb.Append("txtLong.text = Convert.ToString(lastclick.lng);"); sb.Append("}"); sb.Append("}"); GListener listener2 = new GListener(GMap1.GMap_Id, GListener.Event.click, sb.ToString()); GMap1.addListener(listener2); //End Listener*/ //GMap1.GZoom = 3; //set zoom level GMap1.Key = ConfigurationSettings.AppSettings["GoogleMapKey"]; GMap1.enableDragging = true; GMap1.enableGoogleBar = false; GMap1.Language = "en"; GMap1.BackColor = Color.White; //GMap1.enableHookMouseWheelToZoom = true; GMap1.enableGKeyboardHandler = true; //Add built-in control for selecting map type GMap1.addControl(new GControl(GControl.preBuilt.MapTypeControl)); //Add built-in control for zoom and pan //GMap1.addControl(new GControl(GControl.preBuilt.SmallZoomControl3D)); GMap1.addControl(new GControl(GControl.preBuilt.LargeMapControl3D)); //Custom cursor GCustomCursor customCursor = new GCustomCursor(cursor.crosshair, cursor.text); GMap1.addCustomCursor(customCursor); //Mark centre with a "+" GControl control = new GControl(GControl.extraBuilt.MarkCenter); //Adds a textbox which gives the coordinates of the last click GMap1.addControl(new GControl(GControl.extraBuilt.TextualOnClickCoordinatesControl, new GControlPosition(GControlPosition.position.Bottom_Right))); if (!IsPostBack) { //Set centre position of map GMap1.setCenter(hwttc, 18); //Add InfoWindow greeting //GInfoWindow window = new GInfoWindow(hwttc, "<b>Welcome to the HWT Transport Centre</b>"); //GMap1.addInfoWindow(window); //Set up google direction capabalities GDirection direction = new GDirection(); direction.autoGenerate = false; direction.buttonElementId = "btnPlot"; direction.fromElementId = txtStopA.ClientID; direction.toElementId = txtStopB.ClientID; direction.divElementId = "divDirections"; direction.clearMap = true; // Optional // direction.locale = "en-En; GMap1.Add(direction); } //Page.RegisterClientScriptBlock("GoogleDistance", "<script language=javascript src='googleDistance.js'>"); }
void OnLevelWasLoaded() { gDirection = GDirection.DOWN; currentGDir = GDirection.DOWN; }