public IKmlStyle mkStyle(String col, String shape, float size) { IKmlIcon icon = ge.createIcon(""); icon.setHref(shape); IKmlStyle style = ge.createStyle(""); style.getIconStyle().getColor().set(col); style.getIconStyle().setIcon(icon); style.getIconStyle().setScale(size); return(style); }
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; }
/// <summary> /// Icon을 생성하여 GEPlugin 에 Append /// </summary> /// <param name="placemarkID"></param> /// <param name="iconName"></param> /// <param name="iconURL"></param> /// <param name="latitude"></param> /// <param name="longitude"></param> public void CreateSystemIcon(string placemarkID, string iconName, string iconUrl, double latitude, double longitude) { try { if (this.ge == null) { FileLogManager.GetInstance().WriteLog("[GEController] CreateSystemIcon( GEPlugin is null. )"); throw new Exception("External Exception : GEPlugin is null."); } //아이콘 생성---------------------------------------시작 IKmlPlacemark placemark = ge.createPlacemark("icon" + placemarkID); placemark.setDescription(iconName); if (!string.IsNullOrEmpty(iconUrl)) { //아이콘 스타일 변경----------------------------시작 IKmlIcon icon = ge.createIcon(""); icon.setHref(iconUrl); IKmlStyle style = ge.createStyle(""); style.getIconStyle().setIcon(icon); placemark.setStyleSelector(style); //아이콘 스타일 변경------------------------------끝 } else { //아이콘 스타일 변경----------------------------시작 IKmlIcon icon = ge.createIcon(""); icon.setHref("http://maps.google.com/mapfiles/kml/paddle/red-circle.png"); IKmlStyle style = ge.createStyle(""); style.getIconStyle().setIcon(icon); placemark.setStyleSelector(style); //아이콘 스타일 변경------------------------------끝 } IKmlPoint point = ge.createPoint(""); point.setLatitude(latitude); point.setLongitude(longitude); placemark.setGeometry(point); ge.getFeatures().appendChild(placemark); //아이콘 생성-----------------------------------------끝 } catch (Exception ex) { System.Console.WriteLine("CreateSystemIcon Exception : " + ex.ToString()); FileLogManager.GetInstance().WriteLog("[GEController] CreateSystemIcon( " + ex.ToString() + " )"); } }