Пример #1
1
        protected void Page_Load(object sender, EventArgs e)
        {
            GLatLng latlng = new GLatLng(46, 21);
            GMap1.setCenter(latlng, 4);

            List<GLatLng> puntos = new List<GLatLng>();
            puntos.Add(latlng + new GLatLng(0, 8));
            puntos.Add(latlng + new GLatLng(-0.5, 4.2));
            puntos.Add(latlng);
            puntos.Add(latlng + new GLatLng(3.5, -4));
            puntos.Add(latlng + new GLatLng(4.79, +2.6));
            GPolygon poligono = new GPolygon(puntos, "557799", 3, 0.5, "237464", 0.5);
            poligono.close();
            GMap1.Add(poligono);

            List<GLatLng> puntos2 = new List<GLatLng>();
            puntos2.Add(latlng + new GLatLng(5, -8));
            puntos2.Add(latlng + new GLatLng(5, -6));
            puntos2.Add(latlng + new GLatLng(5, -4));
            puntos2.Add(latlng);
            puntos2.Add(latlng + new GLatLng(-5, 0));
            GPolygon poligono2 = new GPolygon(puntos2, "000000", 3, 1, "654321", 1);
            GMap1.Add(poligono2);

            GPolygon poligono3 = new GPolygon(new List<GLatLng>(), "00ff00", 3, 1, "ff0044", 1);
            poligono3.createPolygon(latlng + new GLatLng(-6, -7.5), 7, 4, Math.PI / 3);
            GMap1.Add(poligono3);
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            GLatLng latlon = new GLatLng(10.2, 22);

            GMap1.setCenter(latlon, 4);

            GMarker icono = new GMarker(latlon);

            GInfoWindow window = new GInfoWindow(icono, "Ejemplo de <b>infoWindow</b>", false, GListener.Event.mouseover);

            GMap1.Add(window);

            GPolygon polygon = new GPolygon();

            polygon.points.Add(new GLatLng(9, 25));
            polygon.points.Add(new GLatLng(3, 22));
            polygon.points.Add(new GLatLng(1, 26));
            polygon.close();

            GPolyline polyline = new GPolyline(polygon);

            GInfoWindow window2 = new GInfoWindow();

            //window2.gPolygon = polygon;
            //window2.html = "GPolygon";
            window2.gPolyline = polyline;
            window2.html      = "polyline";

            window2.opened      = true;
            window2.sourceEvent = GListener.Event.click;
            GMap1.Add(window2);
        }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            GLatLng latlng = new GLatLng(46, 21);

            GMap1.setCenter(latlng, 4);

            List <GLatLng> puntos = new List <GLatLng>();

            puntos.Add(latlng + new GLatLng(0, 8));
            puntos.Add(latlng + new GLatLng(-0.5, 4.2));
            puntos.Add(latlng);
            puntos.Add(latlng + new GLatLng(3.5, -4));
            puntos.Add(latlng + new GLatLng(4.79, +2.6));
            GPolygon poligono = new GPolygon(puntos, "557799", 3, 0.5, "237464", 0.5);

            poligono.close();
            GMap1.Add(poligono);

            List <GLatLng> puntos2 = new List <GLatLng>();

            puntos2.Add(latlng + new GLatLng(5, -8));
            puntos2.Add(latlng + new GLatLng(5, -6));
            puntos2.Add(latlng + new GLatLng(5, -4));
            puntos2.Add(latlng);
            puntos2.Add(latlng + new GLatLng(-5, 0));
            GPolygon poligono2 = new GPolygon(puntos2, "000000", 3, 1, "654321", 1);

            GMap1.Add(poligono2);

            GPolygon poligono3 = new GPolygon(new List <GLatLng>(), "00ff00", 3, 1, "ff0044", 1);

            poligono3.createPolygon(latlng + new GLatLng(-6, -7.5), 7, 4, Math.PI / 3);
            GMap1.Add(poligono3);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            GLatLng latlon = new GLatLng(10.2, 22);
            GMap1.setCenter(latlon, 4);

            GMarker icono = new GMarker(latlon);

            GInfoWindow window = new GInfoWindow(icono, "Ejemplo de <b>infoWindow</b>", false, GListener.Event.mouseover);
            GMap1.Add(window);

            GPolygon polygon = new GPolygon();
            polygon.points.Add(new GLatLng(9, 25));
            polygon.points.Add(new GLatLng(3, 22));
            polygon.points.Add(new GLatLng(1, 26));
            polygon.close();

            GPolyline polyline = new GPolyline(polygon);

            GInfoWindow window2 = new GInfoWindow();
            //window2.gPolygon = polygon;
            //window2.html = "GPolygon";
            window2.gPolyline = polyline;
            window2.html = "polyline";

            window2.opened = true;
            window2.sourceEvent = GListener.Event.click;
            GMap1.Add(window2);
        }
Пример #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            GLatLng latlng = new GLatLng(41, -3.2);

            GMap1.setCenter(latlng, 5, GMapType.GTypes.Satellite);

            GMarkerOptions mOpts = new GMarkerOptions();

            mOpts.draggable = true;
            GMarker marker = new GMarker(latlng, mOpts);

            GMap1.Add(marker);
            GListener listener = new GListener(marker.ID, GListener.Event.dragend, "alertame");

            GMap1.Add(listener);

            GMarker mkr = new GMarker();

            mkr.options            = mOpts;
            mkr.javascript_GLatLng = "mouseEvent.latLng";
            listener = new GListener(mkr.ID, GListener.Event.dragend, "alertame");
            System.Text.StringBuilder sb = new System.Text.StringBuilder();

            sb.Append("function(mouseEvent) {");
            sb.Append(mkr.ToString(GMap1.GMap_Id));
            sb.Append(listener.ToString());
            sb.Append("}");

            GListener listener2 = new GListener(GMap1.GMap_Id, GListener.Event.click, sb.ToString());

            GMap1.Add(listener2);

            GMap1.Add(new GListener(GMap1.GMap_Id, GListener.Event.moveend, "function() {alert('I Love Elvis :9P');}"));

            GPolygon polygon = new GPolygon();

            polygon.Add(latlng + new GLatLng(1, 1));
            polygon.Add(latlng + new GLatLng(2, 3));
            polygon.Add(latlng + new GLatLng(4, 4));
            polygon.close();
            GMap1.Add(polygon);

            GListener listener3 = new GListener(polygon.PolygonID, GListener.Event.click, "function(mouseEvent) {alert('Polygon clicked');}");

            GMap1.Add(listener3);
        }
Пример #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            GLatLng latlng = new GLatLng(41, -3.2);
            GMap1.setCenter(latlng, 5, GMapType.GTypes.Satellite);

            GMarkerOptions mOpts = new GMarkerOptions();
            mOpts.draggable = true;
            GMarker marker = new GMarker(latlng, mOpts);
            GMap1.Add(marker);
            GListener listener = new GListener(marker.ID, GListener.Event.dragend, "alertame");
            GMap1.Add(listener);

            GMarker mkr = new GMarker();
            mkr.options = mOpts;
            mkr.javascript_GLatLng = "mouseEvent.latLng";
            listener = new GListener(mkr.ID, GListener.Event.dragend, "alertame");
            System.Text.StringBuilder sb = new System.Text.StringBuilder();

            sb.Append("function(mouseEvent) {");
            sb.Append(mkr.ToString(GMap1.GMap_Id));
            sb.Append(listener.ToString());
            sb.Append("}");

            GListener listener2 = new GListener(GMap1.GMap_Id, GListener.Event.click, sb.ToString());
            GMap1.Add(listener2);

            GMap1.Add(new GListener(GMap1.GMap_Id, GListener.Event.moveend, "function() {alert('I Love Elvis :9P');}"));

            GPolygon polygon = new GPolygon();
            polygon.Add(latlng + new GLatLng(1, 1));
            polygon.Add(latlng + new GLatLng(2, 3));
            polygon.Add(latlng + new GLatLng(4, 4));
            polygon.close();
            GMap1.Add(polygon);

            GListener listener3 = new GListener(polygon.PolygonID, GListener.Event.click, "function(mouseEvent) {alert('Polygon clicked');}");
            GMap1.Add(listener3);
        }
        private void drawCircle2(double lat, double lng, double radius)
        {
            // globals
            //drawing the circle with the latitude and longitude
            var d2r = Math.PI / 180;   // degrees to radians
            var r2d = 180 / Math.PI;   // radians to degrees
            var earthsradius = 3963; // 3963 is the radius of the earth in miles
            var points = 32;
            //var radius = 10;
            double rlat = ((double)radius / earthsradius) * r2d;
            double rlng = rlat / Math.Cos(lat * d2r);
            List<GLatLng> extp = new List<GLatLng>();
            for (var i = 0; i < points + 1; i++)
            {
                double theta = Math.PI * (i / (double)(points / 2));
                double ex = lng + (rlng * Math.Cos(theta));
                double ey = lat + (rlat * Math.Sin(theta));
                extp.Add(new GLatLng(ey, ex));
            }

            GIcon icon1 = new GIcon();
            icon1.image = "/images/urhere2.png";
            //icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
            icon1.iconSize = new GSize(30, 30);
            icon1.shadowSize = new GSize(22, 20);
            icon1.iconAnchor = new GPoint(6, 20);
            icon1.infoWindowAnchor = new GPoint(5, 1);
            GMarkerOptions mOpts1 = new GMarkerOptions();
            mOpts1.clickable = false;
            mOpts1.icon = icon1;
            GMarker marker1 = new GMarker(latlong, mOpts1);

            this.GMap11.addPolygon(new GPolygon(extp, "##FF0000", 0.3));
            GMap11.addGMarker(marker1);

            //end of code for drawing circle with given lat long and radius
            //code for XML Retrieval

            using (reader1 = XmlReader.Create("C:/Users/Dheeraj Rampally/Desktop/dheeraj/SEM 2 ebooks/Query Processing/Project/yumi_web/yumi/xml/XMLFile1.xml"))
            {
                while (reader1.Read() && i1 <= l && j < l && k < l)
                {
                    if (reader1.IsStartElement())
                    {
                        switch (reader1.Name)
                        {
                            case "dictionary": break;
                            case "item": break;
                            case "key": break;
                            case "string": if (reader1.Read())
                                {
                                    if (reader1.Value.Trim().Contains("Metromix"))
                                    {
                                        nn[k] = reader1.Value.Trim();
                                        //Label1.Text = Label1.Text + reader.Value.Trim() + " "+"<br/>";
                                        k++;
                                    }
                                }
                                break;
                            case "value": break;
                            case "ArrayOfPoint": break;
                            case "Point": break;
                            case "x": if (reader1.Read())
                                {
                                    xcoordinates[i1] = reader1.Value.Trim();
                                    //Label2.Text += "xcoordinates[" + i1 + "]=" + reader.Value.Trim() + " " +"<br/>";
                                    i1++;
                                }
                                break;
                            case "y": if (reader1.Read())
                                {
                                    ycoordinates[j] = reader1.Value.Trim();
                                    //Label3.Text += "ycoordinates[" + j + "]=" + reader.Value.Trim() + " " + "<br/>";
                                    j++;
                                }
                                break;
                        }
                    }
                }
            }//end of code for the retrieval of XML coordinates

            //code snippet to draw a rectangle
            for (int z = 0; z <= 422; z=z+2)//looping through all the neighborhoods <=452
            {
                for (int j2 = 0; j2 < 4; j2++)//looping through all the edges within a neighborhood
                {
                    d2r = Math.PI / 180D;
                    if (j2 == 0)
                    {
                        //Haversine's Formula
                        dlong = (lng-double.Parse(xcoordinates[z])) * d2r;
                        dlat = (lat-double.Parse(ycoordinates[z])) * d2r;
                        a = Math.Pow(Math.Sin(dlat / 2.0), 2) + Math.Cos(lat * d2r) * Math.Cos(double.Parse(ycoordinates[z]) * d2r) * Math.Pow(Math.Sin(dlong / 2.0), 2);
                        c = 2 * Math.Atan2(Math.Sqrt(a), Math.Sqrt(1 - a));
                        d = 3956 * c;//3956 is radius of earth in miles
                    }
                    else if (j2 == 1)
                    {
                        //Haversine's Formula
                        dlong = (lng-double.Parse(xcoordinates[z + 1])) * d2r;
                        dlat = (lat-double.Parse(ycoordinates[z])) * d2r;
                        a = Math.Pow(Math.Sin(dlat / 2.0), 2) + Math.Cos(lat * d2r) * Math.Cos(double.Parse(ycoordinates[z]) * d2r) * Math.Pow(Math.Sin(dlong / 2.0), 2);
                        c = 2 * Math.Atan2(Math.Sqrt(a), Math.Sqrt(1 - a));
                        d = 3956 * c;
                    }
                    else if (j2 == 2)
                    {
                        //Haversine's Formula
                        dlong = (lng-double.Parse(xcoordinates[z])) * d2r;
                        dlat = (lat-double.Parse(ycoordinates[z+1])) * d2r;
                        a = Math.Pow(Math.Sin(dlat / 2.0), 2) + Math.Cos(lat * d2r) * Math.Cos(double.Parse(ycoordinates[z]) * d2r) * Math.Pow(Math.Sin(dlong / 2.0), 2);
                        c = 2 * Math.Atan2(Math.Sqrt(a), Math.Sqrt(1 - a));
                        d = 3956 * c;
                    }
                    else if (j2 == 3)
                    {
                        //Haversine's Formula
                        dlong = (lng-double.Parse(xcoordinates[z+1])) * d2r;
                        dlat = (lat-double.Parse(ycoordinates[z + 1])) * d2r;
                        a = Math.Pow(Math.Sin(dlat / 2.0), 2) + Math.Cos(lat * d2r) * Math.Cos(double.Parse(ycoordinates[z]) * d2r) * Math.Pow(Math.Sin(dlong / 2.0), 2);
                        c = 2 * Math.Atan2(Math.Sqrt(a), Math.Sqrt(1 - a));
                        d = 3956 * c;
                    }
                    distance[j2] = d;
                    //Label1.Text += distance[j2].ToString()+"<br/>";
                }
                maxElement = distance[0];//code for retriving the min element in an array
                for (int i3 = 0; i3 < 4; i3++)
                {
                    if (distance[i3] <maxElement)
                    {
                        maxElement = distance[i3];
                        //Label1.Text += "The minimum element is in loop" + x1 + "<br/>";
                    }
                }
                //x1 y2 x2 y1

                x1 = double.Parse(ycoordinates[z]);
                //Label1.Text += x1+" ";
                x3=lat;
                //Label1.Text += x2+" ";
                x2 = double.Parse(ycoordinates[z + 1]);
                //Label1.Text += x3 + "<br/>";
                if(x2<x3&&x3<x1)
                {
                    c1=true;
                  //  Label1.Text+="c1";
                }
                y1=(double.Parse(xcoordinates[z]));
                //Label1.Text += c2l + " ";
                y3=lng;
                //Label1.Text += c2m + " ";
                y2=(double.Parse(xcoordinates[z+1]));
                //Label1.Text += c2r +"<br/>";
                if((y1>y3)&&(y3>y2))
                {
                    c2=true;
                //    Label1.Text += "c2";
                }

                //vertex falling under circle

                if (radius >= maxElement)
                {
                        //code snippet to draw a rectangle
                    if (z == 0)
                    {
                        //Label1.Text += nn[0];
                        neighborhood[0] = nn[0];
                    }
                    else
                    {
                        //Label1.Text += nn[z / 2];
                        neighborhood[z / 2] = nn[z / 2];
                    }
                        GPolygon rectangle = new GPolygon();
                        List<GLatLng> rectanglePts = new List<GLatLng>();
                        rectanglePts.Add(new GLatLng(double.Parse(ycoordinates[z]), double.Parse(xcoordinates[z + 1])));
                        rectanglePts.Add(new GLatLng(double.Parse(ycoordinates[z]), double.Parse(xcoordinates[z])));
                        rectanglePts.Add(new GLatLng(double.Parse(ycoordinates[z + 1]), double.Parse(xcoordinates[z])));
                        rectanglePts.Add(new GLatLng(double.Parse(ycoordinates[z + 1]), double.Parse(xcoordinates[z + 1])));
                        rectangle = new GPolygon(rectanglePts, "0000CD", 2, 2, "FCD116", 0.3);
                        rectangle.clickable = true;
                        rectangle.close();
                        GMap11.Add(rectangle);
                        continue;
                }

                //circle lying inside neighborhood

                else if ((x2 < x3 && x3 < x1) && (y1 > y3 && y3 > y2))
                {
                    if (z == 0)
                    {
                        //Label1.Text += nn[0];
                        neighborhood[0] = nn[0];
                    }
                    else
                    {
                        //Label1.Text += nn[z / 2];
                        neighborhood[z / 2] = nn[z / 2];
                    }
                    GPolygon rectangle = new GPolygon();
                    List<GLatLng> rectanglePts = new List<GLatLng>();

                    rectanglePts.Add(new GLatLng(double.Parse(ycoordinates[z]), double.Parse(xcoordinates[z + 1])));
                    rectanglePts.Add(new GLatLng(double.Parse(ycoordinates[z]), double.Parse(xcoordinates[z])));
                    rectanglePts.Add(new GLatLng(double.Parse(ycoordinates[z + 1]), double.Parse(xcoordinates[z])));
                    rectanglePts.Add(new GLatLng(double.Parse(ycoordinates[z + 1]), double.Parse(xcoordinates[z + 1])));
                    rectangle = new GPolygon(rectanglePts, "0000CD", 2, 2, "FCD116", 0.3);
                    rectangle.clickable = true;
                    rectangle.close();
                    GMap11.Add(rectangle);
                    continue;
                }

                // the circle and line intersection with vertex lying outside circle
                    for (int j3 = 0; j3 < 4; j3++)
                    {
                        if (j3 == 0)
                        {
                            x4 = double.Parse(ycoordinates[z]);
                            y4 = double.Parse(xcoordinates[z]);
                            x5 = double.Parse(ycoordinates[z + 1]);
                            y5 = double.Parse(xcoordinates[z]);
                        }
                        if (j3 == 1)
                        {
                            x4 = double.Parse(ycoordinates[z + 1]);
                            y4 = double.Parse(xcoordinates[z]);
                            x5 = double.Parse(ycoordinates[z + 1]);
                            y5 = double.Parse(xcoordinates[z + 1]);
                        }
                        if (j3 == 2)
                        {
                            x4 = double.Parse(ycoordinates[z + 1]);
                            y4 = double.Parse(xcoordinates[z + 1]);
                            x5 = double.Parse(ycoordinates[z]);
                            y5 = double.Parse(xcoordinates[z + 1]);
                        }
                        if (j3 == 3)
                        {
                            x4 = double.Parse(ycoordinates[z]);
                            y4 = double.Parse(xcoordinates[z + 1]);
                            x5 = double.Parse(ycoordinates[z]);
                            y5 = double.Parse(xcoordinates[z]);
                        }
                        dx = x5 - x4;
                        dy = y5 - y4;
                        A = dx * dx + dy * dy;
                        B = 2 * (dx * (x4 - lat) + dy * (y4 - lng));
                        C = (x4 - lat) * (x4 - lat) + (y4 - lng) * (y4 - lng) - Math.Pow(0.014513788,2)*radius * radius;
                        det = B * B - 4 * A * C;

                        double t, ix1, iy1,ix2,iy2;
                        if ((A <= 0.0000001) || (det < 0))
                        {

                        }
                        else if(det==0)
                        {
                            t = -B / (2 * A);
                            ix1 = x4 + t * dx;
                            iy1 = y4 + t * dy;
                            if ((x4 >= ix1 && ix1 >= x5) && (y4 <= iy1 && iy1 <= y5) || (x4 <= ix1 && ix1 <= x5) && (y4 >= iy1 && iy1 >= y5))
                            {
                                if (z == 0)
                                {
                                    //Label1.Text += nn[0];
                                    neighborhood[0] = nn[0];
                                }
                                else
                                {
                                    //Label1.Text += nn[z / 2];
                                    neighborhood[z / 2] = nn[z / 2];
                                }
                                GPolygon rectangle = new GPolygon();
                                List<GLatLng> rectanglePts = new List<GLatLng>();
                                rectanglePts.Add(new GLatLng(double.Parse(ycoordinates[z]), double.Parse(xcoordinates[z + 1])));
                                rectanglePts.Add(new GLatLng(double.Parse(ycoordinates[z]), double.Parse(xcoordinates[z])));
                                rectanglePts.Add(new GLatLng(double.Parse(ycoordinates[z + 1]), double.Parse(xcoordinates[z])));
                                rectanglePts.Add(new GLatLng(double.Parse(ycoordinates[z + 1]), double.Parse(xcoordinates[z + 1])));
                                rectangle = new GPolygon(rectanglePts, "0000CD", 2, 2, "FCD116", 0.3);
                                rectangle.clickable = true;
                                rectangle.close();
                                GMap11.Add(rectangle);
                            }
                        }
                        else
                        {
                            t = (-B + Math.Sqrt(det)) / (2 * A);
                            ix1 = x4 + t * dx;
                            iy1 = y4 + t * dy;
                            t = (-B - Math.Sqrt(det)) / (2 * A);
                            ix2 = x4 + t * dx;
                            iy2 = y4 + t * dy;
                            if((x4>=ix1&&ix1>=x5)&&(y4<=iy1&&iy1<=y5)&&(x4>=ix2&&ix2>=x5)&&(y4<=iy2&&iy2<=y5)||
                                (x4 <= ix1 && ix1 <= x5) && (y4 >= iy1 && iy1 >= y5) && (x4 <= ix2 && ix2 <= x5) && (y4 >= iy2 && iy2 >= y5))
                            {
                                if (z == 0)
                                {
                                    //Label1.Text += nn[0];
                                    neighborhood[0] = nn[0];
                                }
                                else
                                {
                                    //Label1.Text += nn[z / 2];
                                    neighborhood[z / 2] = nn[z / 2];
                                }
                                GPolygon rectangle = new GPolygon();
                                List<GLatLng> rectanglePts = new List<GLatLng>();
                                rectanglePts.Add(new GLatLng(double.Parse(ycoordinates[z]), double.Parse(xcoordinates[z + 1])));
                                rectanglePts.Add(new GLatLng(double.Parse(ycoordinates[z]), double.Parse(xcoordinates[z])));
                                rectanglePts.Add(new GLatLng(double.Parse(ycoordinates[z + 1]), double.Parse(xcoordinates[z])));
                                rectanglePts.Add(new GLatLng(double.Parse(ycoordinates[z + 1]), double.Parse(xcoordinates[z + 1])));
                                rectangle = new GPolygon(rectanglePts, "0000CD", 2, 2, "FCD116", 0.3);
                                rectangle.clickable = true;
                                rectangle.close();
                                GMap11.Add(rectangle);
                            }
                        }
                    }

            }

            for (int i = 0, x = 0; i < neighborhood.Length; i++)
            {
                if (neighborhood[i] == null)
                    continue;
                else
                {
                    shortListednn[x] = neighborhood[i];
                    shortListednn[x] = shortListednn[x].Substring(9);
                    //Label1.Text += "ShortlistedNN " + x + "=" + shortListednn[x];
                    x++;
                }
            }

            for (int i = 0; i < Globals.hoods.Count(); i++)
            {
                for (int j = 0; j < shortListednn.Length; j++)
                {
                    if (Globals.hoods[i].getName() == shortListednn[j])
                    {
                        LocationList newHood = new LocationList(shortListednn[j]);
                        newHood = Globals.hoods[i];
                        Globals.shortListedNeighborHoods.Add(newHood);
                    }
                }

            }
            /*
            for (int i = 1; i < Globals.baba.Length; i++)
            {
                Globals.baba[i] = null;
            }

            for (int i = 0; i < Globals.shortListedNeighborHoods.Count(); i++)
            {
                for (int j = 0; j < Globals.shortListedNeighborHoods[i].getLocationsCount(); j++)
                {
                    if (Globals.baba[Globals.shortListedNeighborHoods[i].getSearchEngineCodeForMapping(j)] == null)
                    {
                        Globals.baba[Globals.shortListedNeighborHoods[i].getSearchEngineCodeForMapping(j)] = Globals.shortListedNeighborHoods[i].getNeighborhood(j);
                        continue;
                    }
                    Globals.baba[Globals.shortListedNeighborHoods[i].getSearchEngineCodeForMapping(j)]=Globals.baba[Globals.shortListedNeighborHoods[i].getSearchEngineCodeForMapping(j)]+","+Globals.shortListedNeighborHoods[i].getNeighborhood(j);
                }
            }

            */

            for (int i = 0; i < Globals.shortListedNeighborHoods.Count(); i++)
            {
                for (int j = 0; j < Globals.shortListedNeighborHoods[i].getLocationsCount(); j++)
                {
                    int k = Globals.shortListedNeighborHoods[i].getSearchEngineCodeForMapping(j);
                    s1 += Globals.shortListedNeighborHoods[i].getNeighborhood(j) + k.ToString() + ",";
                    //Label1.Text+= Globals.shortListedNeighborHoods[i].getNeighborhood(j) + k.ToString() +"<br/>";

                }

                //Label1.Text += "<------------Next Set of Neighborhoods for new neighborhood--------->"+"<br/>";
            }
            //Label1.Text = s1;

            char[] seps = { ',' };
            childList = s1.Split(seps);

            //for (int i = 0; i < childList.Length - 1; i++)
            //{
            //    Label1.Text += childList[i] + "<br/>";
            //}

            for (int i = 0; i < childList.Length - 1; i++)
            {
                //Label1.Text += childList[i]+"<br/>";
                length = childList[i].Length;
                if ((childList[i].Substring(length - 1)) == "1")
                {
                    Globals.metromixList[m] = childList[i].Substring(0, length - 1);
                    //Label1.Text += "Metromix" +Globals.metromixList[m] + " " + "<br/>";
                    m++;
                }
                else if ((childList[i].Substring(length - 1)) == "2")
                {
                    Globals.dexknowsList[d1] = childList[i].Substring(0, length - 1);
                    //Label1.Text += "dexknows"+Globals.dexknowsList[d1] + " " + "<br/>";
                    d1++;
                }
                else if ((childList[i].Substring(length - 1)) == "3")
                {
                    Globals.yelpList[y] = childList[i].Substring(0, length - 1);
                    //Label1.Text += "yelp"+Globals.yelpList[y] + " " + "<br/>";
                    y++;
                }
                else if ((childList[i].Substring(length - 1)) == "4")
                {
                    Globals.chicagoList[ch] = childList[i].Substring(0, length - 1);
                    //Label1.Text += "chicagoreader"+Globals.chicagoList[ch] + " " + "<br/>";
                    ch++;
                }
                else if ((childList[i].Substring(length - 1)) == "5")
                {
                    Globals.menuList[me] = childList[i].Substring(0, length - 1);
                    //Label1.Text += "menu"+Globals.menuList[me] + " " + "<br/>";
                    me++;
                }
                else if ((childList[i].Substring(length - 1)) == "6")
                {
                    Globals.menuPagesList[mp] = childList[i].Substring(0, length - 1);
                    //Label1.Text += "menupages"+Globals.menuPagesList[mp] + " " + "<br/>";
                    mp++;
                }
                else if ((childList[i].Substring(length - 1)) == "7")
                {
                    Globals.yahooList[ya] = childList[i].Substring(0, length - 1);
                    //Label1.Text += "yahoo"+Globals.yahooList[ya] + " " + "<br/>";
                    ya++;
                }
                else if ((childList[i].Substring(length - 1)) == "8")
                {
                    Globals.yellowList[ye] = childList[i].Substring(0, length - 1);
                    //Label1.Text += "yellow"+Globals.yellowList[ye] + " " + "<br/>";
                    ye++;
                }
                else if ((childList[i].Substring(length - 1)) == "9")
                {
                    Globals.cityList[ci] = childList[i].Substring(0, length - 1);
                    //Label1.Text += "city"+Globals.cityList[ci] + " " + "<br/>";
                    ci++;
                }
                else if ((childList[i].Substring(length - 2)) == "10")
                {
                    Globals.zagatList[za] = childList[i].Substring(0, length - 2);
                    //Label1.Text += "zagat"+Globals.zagatList[za] + " " + "<br/>";
                    za++;
                }
            }

            Array.Resize(ref Globals.metromixList, m);
            Array.Resize(ref Globals.zagatList, za);
            Array.Resize(ref Globals.yellowList,ye);
            Array.Resize(ref Globals.yahooList, ya);
            Array.Resize(ref Globals.menuPagesList, mp);
            Array.Resize(ref Globals.menuList, me);
            Array.Resize(ref Globals.chicagoList, ch);
            Array.Resize(ref Globals.yelpList, y);
            Array.Resize(ref Globals.dexknowsList, d1);
            Array.Resize(ref Globals.cityList, ci);

            //for (int i = 0; i < Globals.dexknowsList.Length; i++)
            //{
            //    Label1.Text += Globals.dexknowsList[i];
            //}
        }
        private List<GPolygon> constructRectangles(List<List<Point>> cornersList, Rectangle type)
        {
            List<GPolygon> polygons = new List<GPolygon>();
            foreach (List<Point> corners in cornersList)
            {
                List<GLatLng> rectanglePts = new List<GLatLng>();
                rectanglePts.Add(new GLatLng(corners[0].y, corners[1].x));
                rectanglePts.Add(new GLatLng(corners[0].y, corners[0].x));
                rectanglePts.Add(new GLatLng(corners[1].y, corners[0].x));
                rectanglePts.Add(new GLatLng(corners[1].y, corners[1].x));
                if (type == Rectangle.TARGET)
                {
                    GPolygon rectangle = new GPolygon(rectanglePts, "ffffff", 0, 0, "000080", 0.3);
                    rectangle.clickable = true;
                    rectangle.close();
                    polygons.Add(rectangle);
                }
                if (type == Rectangle.CHOSEN)
                {
                    GPolygon rectangle = new GPolygon(rectanglePts, "0000ff", 2, 1, "ffffff", 0);
                    rectangle.clickable = true;
                    rectangle.close();
                    polygons.Add(rectangle);
                }
                if (type == Rectangle.NOTCHOSEN)
                {
                    GPolygon rectangle = new GPolygon(rectanglePts, "ff0000", 2, 1, "ffffff", 0);
                    rectangle.clickable = true;
                    rectangle.close();
                    polygons.Add(rectangle);
                }
                if (type == Rectangle.YUMITARGET)
                {
                    GPolygon rectangle = new GPolygon(rectanglePts, "0000ff", 2, 1, "ffffff", 0);
                    rectangle.clickable = true;
                    rectangle.close();
                    polygons.Add(rectangle);
                }

            }
            return polygons;
        }
        private GPolygon constructRectangle(List<Point> corners, Rectangle type)
        {
            GPolygon rectangle = new GPolygon();
            List<GLatLng> rectanglePts = new List<GLatLng>();
            rectanglePts.Add(new GLatLng(corners[0].y, corners[1].x));
            rectanglePts.Add(new GLatLng(corners[0].y, corners[0].x));
            rectanglePts.Add(new GLatLng(corners[1].y, corners[0].x));
            rectanglePts.Add(new GLatLng(corners[1].y, corners[1].x));
            if (type == Rectangle.TARGET)
            {
                rectangle = new GPolygon(rectanglePts, "ffffff", 0, 0, "000080", 0.3);
                rectangle.clickable = true;
                rectangle.close();
            }
            else if (type == Rectangle.CHOSEN)
            {
                rectangle = new GPolygon(rectanglePts, "0000ff", 2, 1, "ffffff", 0);
                rectangle.clickable = true;
                rectangle.close();
            }
            else if (type == Rectangle.NOTCHOSEN)
            {
                rectangle = new GPolygon(rectanglePts, "ff0000", 2, 1, "ffffff", 0);
                rectangle.clickable = true;
                rectangle.close();
            }
            else if (type == Rectangle.YUMITARGET)
            {
                rectangle = new GPolygon(rectanglePts, "0000ff", 2, 1, "ffffff", 0);
                rectangle.clickable = true;
                rectangle.close();
            }

            return rectangle;
        }