protected void Page_Load(object sender, EventArgs e)
        {
            DragZoomControl dragZoomControl = new DragZoomControl();

            DragZoomOtherOptions dragZoomOtherOptions = new DragZoomOtherOptions();
            dragZoomOtherOptions.backButtonEnabled = true;
            dragZoomOtherOptions.backButtonHTML = "Go back";
            dragZoomOtherOptions.buttonHTML = "Zoom";
            dragZoomOtherOptions.minDragSize = 5;
            dragZoomControl.dragZoomOtherOptions = dragZoomOtherOptions;
            dragZoomControl.dragZoomOtherOptions = dragZoomOtherOptions;

            DragZoomCallbacks dragZoomCallbacks = new DragZoomCallbacks();
            dragZoomCallbacks.buttonclick = "function(){alert('Button Click')}";
            dragZoomControl.dragZoomCallbacks = dragZoomCallbacks;

            DragZoomBoxStyleOptions dragZoomBoxStyleOptions = new DragZoomBoxStyleOptions();
            dragZoomBoxStyleOptions.opacity = 0.5;
            dragZoomBoxStyleOptions.fillColor = Color.Red;
            dragZoomControl.dragZoomBoxStyleOptions = dragZoomBoxStyleOptions;

            GControl dragzoom = new GControl(dragZoomControl, new GControlPosition(GControlPosition.position.Top_Left));

            GMap1.Add(dragzoom);
        }
Beispiel #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            // Habilitando o zoom no mapa
            GoogleMaps.enableHookMouseWheelToZoom = true;
            GoogleMaps.enableGoogleBar            = false;
            GoogleMaps.enableDragging             = false;
            GoogleMaps.enableDoubleClickZoom      = false;
            GoogleMaps.Version = "3";

            // Definir o tipo do mapa
            // Satellite, Hybrid, Physical, Normal

            GoogleMaps.mapType = GMapType.GTypes.Normal;

            //GLatLng latitudeLongitude = new GLatLng("Recife Brasil");

            GoogleMaps.setCenter(GoogleMaps.getGeoCodeRequest("Recife Pernambuco").Placemark.coordinates, 10);
            //mudando o tamanho do mapa
            //GoogleMaps.Height = 200;
            //GoogleMaps.Width = 800;

            // Ver imagem para entender quais sao os controles adicionados
            GControl mapType  = new GControl(GControl.preBuilt.MapTypeControl);
            GControl overview = new GControl(GControl.preBuilt.GOverviewMapControl);
            GControl small    = new GControl(GControl.preBuilt.SmallMapControl);
            //GoogleMaps.addControl(mapType); // Ver imagem
            //GoogleMaps.addControl(overview); // Ver imagem
            GoogleMaps.addControl(small); // Ver imagem
        }
    }
Beispiel #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DragZoomControl dragZoomControl = new DragZoomControl();

            DragZoomOtherOptions dragZoomOtherOptions = new DragZoomOtherOptions();

            dragZoomOtherOptions.backButtonEnabled = true;
            dragZoomOtherOptions.backButtonHTML    = "Go back";
            dragZoomOtherOptions.buttonHTML        = "Zoom";
            dragZoomOtherOptions.minDragSize       = 5;
            dragZoomControl.dragZoomOtherOptions   = dragZoomOtherOptions;
            dragZoomControl.dragZoomOtherOptions   = dragZoomOtherOptions;

            DragZoomCallbacks dragZoomCallbacks = new DragZoomCallbacks();

            dragZoomCallbacks.buttonclick     = "function(){alert('Button Click')}";
            dragZoomControl.dragZoomCallbacks = dragZoomCallbacks;

            DragZoomBoxStyleOptions dragZoomBoxStyleOptions = new DragZoomBoxStyleOptions();

            dragZoomBoxStyleOptions.opacity         = 0.5;
            dragZoomBoxStyleOptions.fillColor       = Color.Red;
            dragZoomControl.dragZoomBoxStyleOptions = dragZoomBoxStyleOptions;

            GControl dragzoom = new GControl(dragZoomControl, new GControlPosition(GControlPosition.position.Top_Left));

            GMap1.Add(dragzoom);
        }
Beispiel #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            GControl extMapType = new GControl(new ExtMapTypeControl(true, true, true, true, true));
            GMap1.Add(extMapType);

            GMap1.setCenter(new GLatLng(47, -122));
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            GControl extMapType = new GControl(new ExtMapTypeControl(true, true, true, true, true));

            GMap1.Add(extMapType);

            GMap1.setCenter(new GLatLng(47, -122));
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            GControl control = new GControl(GControl.extraBuilt.NumericalZoomControl);
            GMap1.Add(control);

            GMap1.Add(new GControl(GControl.extraBuilt.TextualCoordinatesControl, new GControlPosition(GControlPosition.position.Top_Right)));
            GMap1.Add(new GControl(GControl.extraBuilt.TextualOnClickCoordinatesControl, new GControlPosition(GControlPosition.position.Bottom_Right)));
        }
Beispiel #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            GControl control = new GControl(GControl.extraBuilt.NumericalZoomControl);

            GMap1.Add(control);

            GMap1.Add(new GControl(GControl.extraBuilt.TextualCoordinatesControl, new GControlPosition(GControlPosition.position.Top_Right)));
            GMap1.Add(new GControl(GControl.extraBuilt.TextualOnClickCoordinatesControl, new GControlPosition(GControlPosition.position.Bottom_Right)));
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            GControl control = new GControl(GControl.preBuilt.LargeMapControl);
            GControl control2 = new GControl(GControl.preBuilt.MenuMapTypeControl, new GControlPosition(GControlPosition.position.Top_Right));

            GMap1.Add(control);
            GMap1.Add(control2);
            GMap1.Add(new GControl(GControl.preBuilt.NavLabelControl, new GControlPosition(GControlPosition.position.Bottom_Left)));
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            GControl control  = new GControl(GControl.preBuilt.LargeMapControl);
            GControl control2 = new GControl(GControl.preBuilt.MenuMapTypeControl, new GControlPosition(GControlPosition.position.Top_Right));

            GMap1.Add(control);
            GMap1.Add(control2);
            GMap1.Add(new GControl(GControl.preBuilt.StreetViewControl, new GControlPosition(GControlPosition.position.Bottom_Right)));
        }
Beispiel #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // Habilitando o zoom no mapa
            GoogleMaps.enableHookMouseWheelToZoom = true;

            // Definir o tipo do mapa
            // Satellite, Hybrid, Physical, Normal
            GoogleMaps.mapType = GMapType.GTypes.Normal;

            // Define a Latitude e Logitude inicial do Mapa
            // Como moro em Brasília, coloquei o Congresso Nacional
            GLatLng latitudeLongitude = new GLatLng(-25.366085, -49.220698);

            // Definimos onde será o ponto inicial do nosso mapa
            // e o numero é o ZOOM inicial
            GoogleMaps.setCenter(latitudeLongitude, 17);

            GIcon icon = new GIcon();

            icon.image            = "/img/3gsaticon.png";
            icon.iconSize         = new GSize(32, 32);
            icon.shadowSize       = new GSize(22, 20);
            icon.iconAnchor       = new GPoint(6, 20);
            icon.infoWindowAnchor = new GPoint(5, 1);

            GMarkerOptions mOpts = new GMarkerOptions();

            mOpts.icon = icon;

            // Acionando os controles
            GControl overview   = new GControl(GControl.preBuilt.GOverviewMapControl);
            GControl MapControl = new GControl(GControl.preBuilt.LargeMapControl3D);

            GoogleMaps.addControl(overview);
            GoogleMaps.addControl(MapControl);

            GMarker     marker = new GMarker(latitudeLongitude, mOpts);
            GInfoWindow window = new GInfoWindow(marker, "<center><b>Teste 3GSat<BR>Teste linha<BR>" + latitudeLongitude + "</b></center>");

            GoogleMaps.addGMarker(marker);
            GoogleMaps.addInfoWindow(window);
        }
        private void InitializeGoogleMaps()
        {
            GMap1.Add(new GMapUI());

            GMapUIOptions options = new GMapUIOptions();
            options.maptypes_hybrid = false;
            options.keyboard = false;
            options.maptypes_physical = false;
            options.zoom_scrollwheel = true;

            GMap1.Add(new GMapUI(options));

            GControl control = new GControl(GControl.preBuilt.LargeMapControl);
            GControl control2 = new GControl(GControl.preBuilt.MenuMapTypeControl, new GControlPosition(GControlPosition.position.Top_Right));

            GMap1.Add(control);
            GMap1.Add(control2);

            GMap1.Add(new GControl(GControl.preBuilt.GOverviewMapControl, new GControlPosition(GControlPosition.position.Bottom_Left)));
        }
Beispiel #12
0
        private void InitializeGoogleMaps()
        {
            GMap1.Add(new GMapUI());

            GMapUIOptions options = new GMapUIOptions();

            options.maptypes_hybrid   = false;
            options.keyboard          = false;
            options.maptypes_physical = false;
            options.zoom_scrollwheel  = true;

            GMap1.Add(new GMapUI(options));

            GControl control  = new GControl(GControl.preBuilt.LargeMapControl);
            GControl control2 = new GControl(GControl.preBuilt.MenuMapTypeControl, new GControlPosition(GControlPosition.position.Top_Right));

            GMap1.Add(control);
            GMap1.Add(control2);

            GMap1.Add(new GControl(GControl.preBuilt.GOverviewMapControl, new GControlPosition(GControlPosition.position.Bottom_Left)));
        }
Beispiel #13
0
		public void addControl(GControl gControl)
        {
			throw new Exception("");
        }
Beispiel #14
0
 void Awake()
 {
     instance = this;
 }
Beispiel #15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            MarkerManager mManager = new MarkerManager();
            double lat = 0.0;
            double longi = 0.0;

            //reset listeners, necessary for marker listener to work between postback
            GMap1.resetListeners();

            //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;

            //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)));

            //Add all stops to GMAP
            var stops =
                from s in JUTCLinq.Stops
                select s;

            foreach (var s in stops)
            {
                lat = s.Lattitude;
                longi = s.Longitude;
                GMarker mkr = new GMarker(new GLatLng(lat, longi));
                //GMap1.addGMarker(mkr);
                mManager.Add(mkr, 10);
                GMap1.Add(new GListener(mkr.ID, GListener.Event.click,
                                         "function(){prompt('Stop #: " + s.StopNo
                                             + ",  Location: " + s.Location + ",  Coordinates:"
                                             + "','" + s.Lattitude + "," + s.Longitude
                                             + "');"
                                             + "var hsn = document.getElementById('hidStopNo');"
                                             + "hsn.value = '" + s.StopNo + "';"
                                             + "}"));
            }

            GMap1.markerManager = mManager;

            if (!IsPostBack)
            {
                GMap1.setCenter(hwttc, 18);
            }
        }
Beispiel #16
0
        internal void addControl(GControl gControl)
        {
			Exception.Create();
        }
Beispiel #17
0
        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'>");
        }