Exemplo n.º 1
0
 public bool de_highlight()
 {
     if (sel_point != null)
     {
         IKmlStyleMap sm        = ge.createStyleMap("");
         IKmlStyle    normal    = mkStyle(sel_point.getComputedStyle().getIconStyle().getColor().get(), @"http://maps.google.com/mapfiles/kml/paddle/wht-blank.png", (float)0.3);
         IKmlStyle    highlight = mkStyle(sel_point.getComputedStyle().getIconStyle().getColor().get(), @"http://maps.google.com/mapfiles/kml/paddle/wht-blank.png", (float)0.4);
         sm.setNormalStyle(normal);
         sm.setHighlightStyle(highlight);
         sel_point.setStyleSelector(sm);
         return(true);
     }
     return(false);
 }
Exemplo n.º 2
0
 public void dehighlight()
 {
     if (p_highlight != "")
     {
         IKmlPlacemark point = getByName(p_highlight);
         point.getComputedStyle().getIconStyle().setScale((float)0.3);
     }
 }
Exemplo n.º 3
0
        public void highlight(String name)
        {
            if (p_highlight != "")
            {
                dehighlight();
            }
            IKmlPlacemark point = getByName(name);

            point.getComputedStyle().getIconStyle().setScale((float)0.5);
            p_highlight = name;
        }
Exemplo n.º 4
0
        public void highlight(IKmlPlacemark point)
        {
            de_highlight();

            IKmlIcon icon = ge.createIcon("");

            icon.setHref(@"http://maps.google.com/mapfiles/kml/paddle/wht-blank.png");
            IKmlStyle ssty = ge.createStyle("");

            ssty.getIconStyle().setIcon(icon);
            ssty.getIconStyle().setScale((float)0.9);
            ssty.getIconStyle().getColor().set(point.getComputedStyle().getIconStyle().getColor().get());

            point.setStyleSelector(ssty);
            sel_point = point;
        }
Exemplo n.º 5
0
        /*
         * insert a trip into trippool and remove the trip at the same index as well as the one after ( this is used by join )
         */
        public String insert(String name, IKmlFolder trip, String[] att, IKmlStyle sty)
        {
            de_highlight();
            int        index = int.Parse(name.Split('_')[1]);
            String     style = "";
            IKmlFolder temp1 = getByName("Trip_" + index);
            IKmlFolder temp2 = getByName("Trip_" + (index + 1));

            IKmlObjectList points = temp1.getFeatures().getChildNodes();

            for (int ii = 0; ii != points.getLength(); ii++)
            {
                IKmlPlacemark point = (IKmlPlacemark)points.item(ii);
                trip.getFeatures().appendChild(point);
                if (ii == 0)
                {
                    style = point.getComputedStyle().getIconStyle().getColor().get();
                }
            }
            points = temp2.getFeatures().getChildNodes();

            IKmlStyleMap sm        = ge.createStyleMap("");
            IKmlStyle    normal    = mkStyle(style, @"http://maps.google.com/mapfiles/kml/paddle/wht-blank.png", (float)0.3);
            IKmlStyle    highlight = mkStyle(style, @"http://maps.google.com/mapfiles/kml/paddle/wht-blank.png", (float)0.4);

            sm.setNormalStyle(normal);
            sm.setHighlightStyle(highlight);
            for (int ii = 0; ii != points.getLength(); ii++)
            {
                IKmlPlacemark point = (IKmlPlacemark)points.item(ii);


                if (ii == 0)
                {
                    _style = point.getComputedStyle().getIconStyle().getColor().get();
                }
                if (point.getGeometry().getType() != "KmlPoint")
                {
                    point.getComputedStyle().getLineStyle().setWidth((float)4);
                    point.getComputedStyle().getLineStyle().getColor().set(style);
                }
                else
                {
                    point.setStyleSelector(sm);
                }
                trip.getFeatures().appendChild(point);
            }

            _core.RemoveAt(index - 1);
            // _attr.RemoveAt(index - 1);
            // removeKMLTrip(index.ToString());

            _core.RemoveAt(index - 1);
            //_attr.RemoveAt(index - 1);
            // removeKMLTrip(index.ToString());

            _core.Insert(index - 1, trip);
            // _attr.Insert(index - 1, att);
            // addAtPosition(trip, index - 1);

            return(_style);
        }
Exemplo n.º 6
0
        public void highlight(IKmlPlacemark point)
        {
            de_highlight();

            IKmlIcon icon = ge.createIcon("");
            icon.setHref(@"http://maps.google.com/mapfiles/kml/paddle/wht-blank.png");
            IKmlStyle ssty = ge.createStyle("");
            ssty.getIconStyle().setIcon(icon);
            ssty.getIconStyle().setScale((float)0.9);
            ssty.getIconStyle().getColor().set(point.getComputedStyle().getIconStyle().getColor().get());

            point.setStyleSelector(ssty);
            sel_point = point;
        }