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
        /*
         * 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.º 3
0
 /// <summary>
 /// 모든 스타일 맵 생성
 /// </summary>
 public void MakeAllStyleMap()
 {
     #region 흰색
     IKmlStyle    styleNormal    = MakeStyle("st_n_white", 1.1F, 20, 255, 255, 255);
     IKmlStyle    styleHighlight = MakeStyle("st_h_white", 1.3F, 20, 255, 255, 255);
     IKmlStyleMap styleMap       = ge.createStyleMap("stm_white");
     styleMap.setStyle(styleNormal, styleHighlight);
     dicStyleMap.Add(EColorStyle.WHITE, styleMap);
     #endregion
     #region 빨강
     styleNormal    = MakeStyle("st_n_red", 1.1F, 127, 255, 0, 0);
     styleHighlight = MakeStyle("st_h_red", 1.3F, 127, 255, 0, 0);
     styleMap       = ge.createStyleMap("stm_red");
     styleMap.setStyle(styleNormal, styleHighlight);
     dicStyleMap.Add(EColorStyle.RED, styleMap);
     #endregion
     #region  랑
     styleNormal    = MakeStyle("st_n_blue", 1.1F, 127, 0, 0, 255);
     styleHighlight = MakeStyle("st_h_blue", 1.3F, 127, 0, 0, 255);
     styleMap       = ge.createStyleMap("stm_blue");
     styleMap.setStyle(styleNormal, styleHighlight);
     dicStyleMap.Add(EColorStyle.BLUE, styleMap);
     #endregion
     #region PALEGOLDENROD
     styleNormal    = MakeStyle("st_n_palegoldenrod", 1.1F, 127, 210, 206, 152);
     styleHighlight = MakeStyle("st_h_alegoldenrod", 1.3F, 127, 210, 206, 152);
     styleMap       = ge.createStyleMap("stm_alegoldenrod");
     styleMap.setStyle(styleNormal, styleHighlight);
     dicStyleMap.Add(EColorStyle.PALEGOLDENROD, styleMap);
     #endregion
     #region GOLD
     styleNormal    = MakeStyle("st_n_gold", 1.1F, 127, 254, 224, 78);
     styleHighlight = MakeStyle("st_h_gold", 1.3F, 127, 254, 224, 78);
     styleMap       = ge.createStyleMap("stm_gold");
     styleMap.setStyle(styleNormal, styleHighlight);
     dicStyleMap.Add(EColorStyle.GOLD, styleMap);
     #endregion
     #region ORANGE
     styleNormal    = MakeStyle("st_n_orange", 1.1F, 127, 255, 125, 00);
     styleHighlight = MakeStyle("st_h_orange", 1.3F, 127, 255, 125, 00);
     styleMap       = ge.createStyleMap("stm_orange");
     styleMap.setStyle(styleNormal, styleHighlight);
     dicStyleMap.Add(EColorStyle.ORANGE, styleMap);
     #endregion
     #region BRIGHTRED
     styleNormal    = MakeStyle("st_n_brightred", 1.1F, 127, 255, 52, 52);
     styleHighlight = MakeStyle("st_h_brightred", 1.3F, 127, 255, 52, 52);
     styleMap       = ge.createStyleMap("stm_brightred");
     styleMap.setStyle(styleNormal, styleHighlight);
     dicStyleMap.Add(EColorStyle.BRIGHTRED, styleMap);
     #endregion
     #region DEEPPINK
     styleNormal    = MakeStyle("st_n_deeppink", 1.1F, 127, 232, 09, 142);
     styleHighlight = MakeStyle("st_h_deeppink", 1.3F, 127, 232, 09, 142);
     styleMap       = ge.createStyleMap("stm_deeppink");
     styleMap.setStyle(styleNormal, styleHighlight);
     dicStyleMap.Add(EColorStyle.DEEPPINK, styleMap);
     #endregion
     #region PURPLE
     styleNormal    = MakeStyle("st_n_purple", 1.1F, 127, 151, 28, 147);
     styleHighlight = MakeStyle("st_h_purple", 1.3F, 127, 151, 28, 147);
     styleMap       = ge.createStyleMap("stm_purple");
     styleMap.setStyle(styleNormal, styleHighlight);
     dicStyleMap.Add(EColorStyle.PURPLE, styleMap);
     #endregion
     #region ROYALBLUE
     styleNormal    = MakeStyle("st_n_royalblue", 1.1F, 127, 59, 94, 225);
     styleHighlight = MakeStyle("st_h_royalblue", 1.3F, 127, 59, 94, 225);
     styleMap       = ge.createStyleMap("stm_royalblue");
     styleMap.setStyle(styleNormal, styleHighlight);
     dicStyleMap.Add(EColorStyle.ROYALBLUE, styleMap);
     #endregion
     #region DODGERBLUE
     styleNormal    = MakeStyle("st_n_dodgerblue", 1.1F, 127, 59, 150, 227);
     styleHighlight = MakeStyle("st_h_dodgerblue", 1.3F, 127, 59, 150, 227);
     styleMap       = ge.createStyleMap("stm_dodgerblue");
     styleMap.setStyle(styleNormal, styleHighlight);
     dicStyleMap.Add(EColorStyle.DODGERBLUE, styleMap);
     #endregion
     #region MEDIUMTURQUOISE
     styleNormal    = MakeStyle("st_n_mediumturquoise", 1.1F, 127, 96, 208, 218);
     styleHighlight = MakeStyle("st_h_mediumturquoise", 1.3F, 127, 96, 208, 218);
     styleMap       = ge.createStyleMap("stm_mediumturquoise");
     styleMap.setStyle(styleNormal, styleHighlight);
     dicStyleMap.Add(EColorStyle.MEDIUMTURQUOISE, styleMap);
     #endregion
     #region LIMEGREEN
     styleNormal    = MakeStyle("st_n_limegreen", 1.1F, 127, 103, 206, 62);
     styleHighlight = MakeStyle("st_h_limegreen", 1.3F, 127, 103, 206, 62);
     styleMap       = ge.createStyleMap("stm_limegreen");
     styleMap.setStyle(styleNormal, styleHighlight);
     dicStyleMap.Add(EColorStyle.LIMEGREEN, styleMap);
     #endregion
 }