/// new layer functions // wf_add_layeroleobject aLayer, lb_dataset, LayerInfo, Fldsole_1.object.Geoset = 'H: /water_pt_map.gst'alayer=Create OleObject alayer.ConnectToNewObject ( "MapX.Layer.5") LayerInfo = Create OleObject LayerInfo.connecttonewObject ("Mapx.LayerInfo.5") FLDS = CREATE OLEOBJECT FLDS.CONNECTTONEWOBJECT ("Mapx.fields.5")
Flds.addstringfield ("ID", 12) Flds.addstringfield ("Name", 50) // New Layer LayerInfo.type = 6LayerInfo.addParameter ("Name", 'meteruse') LayerInfo.addparameter ("Fields", FLDS LayerInfo.addParameter ("AutoCreatedataDataSet", 1) LayerInfo.addparameter ("DatasetName", "Pt_water") ALAYER = OLE_1.Object.Layers.Add (LayerInfo, 1) // Setting Activity Layer OLE_1.Object.Layers.animationLayer = alayer /// / ================================ // Name: wf_add_dot // DEC {3} LDC_X, LDC_Y / / / / Increase Function, division display //// Time: 20040924 //// ======================= l ll_f
/ / Set color according to level
if il_jb = 1 thenole_1.object.DefaultStyle .SymbolCharacter = 35ole_1.object.DefaultStyle .SymbolFontColor = RGB (255, 0, 0) ole_1.object.DefaultStyle .SymbolFont.Size = 12 // ole_1.object.DefaultStyle .SymbolFont = " map Symbols "ole_1.object.DefaultStyle .textFontColor = RGB (255, 0, 0) ole_1.object.DefaultStyle .textFont.Size = 12ole_1.object.DefaultStyle .textFont =" Arial "elseif il_jb = 2 then ole_1.object.DefaultStyle .SymbolCharacter = 36ole_1.object.DefaultStyle .SymbolFontColor = RGB (255, 255, 0) ole_1.object.DefaultStyle .SymbolFont.Size = 11ole_1.object.DefaultStyle .textFontColor = RGB (255, 255, 0) ole_1.object.DefaultStyle .textFont.Size = 11 elseif il_jb = 3 thenole_1.object.DefaultStyle .SymbolCharacter = 37ole_1.object.DefaultStyle .SymbolFontColor = RGB (255, 127, 0) ole_1.object.DefaultStyle .SymbolFont.Size = 10ole_1.object.DefaultStyle. TextFontColor = RGB (255, 127, 0) ole_1.object.defaultStyle .textFont.Size = 10 END IF
int i, n = 1oleobject f, f2, lb_dataset, flds, rvoleobject aLayeroleobject m_pointlb_dataset = Create OleObject lb_dataset.ConnectToNewObject ( "MapX.dataset.5") flds = Create OleObject flds.ConnectToNewObject ( "MapX.fields.5") rv = Create OleObject rv.ConnectToNewObject ( "MapX.rowvalue.5") alayer = Create OleObject //("mapx.layer.5")f=Create OleObjectf2 = Create OleObjectm_point = Create OleObjectalayer.ConnectToNewObject ( "MapX.Layer.5") ll_f = f.ConnectToNewObject ( "MapX.Feature.5") ll_f = f2.ConnectToNewObject ( "MapX.Feature.5") ll_f = m_point.ConnectToNewObject ( "MapX.point.5") aLayer = ole_1.object.layers. Item ("meteruse") lb_dataset = aLayer.DataSets.Item ("pt_water") FLDS = lb_dataset.fieldsalayer.lablproperties.DataSet = lb_datasetalayer.labelproperties.Datafield = lb_dataset.fields.Item ("ID")
alayer.autolabel = true = true = true
If IS_NAME <> "" and not isnull (is_name) Thenif IL_SAME_F = 1 THEN / Moving coordinate f = ALAYER.GETFEATUREBYKEY (IS_FEATUREKEY) F.Point.Set (ADC_X, ADC_Y) F.Update () Else // No increased OLE_1.Object.AutoredRAW = falsem_point.set (ADC_X, ADC_Y) f = OLE_1.Object.FeatureFactory.createSymbol (m_point, ole_1.object.defaultstyle)
Alayer.keyfield = flds.Item (1) .Name F.KeyValue = is_NAME
F2 = alayer.addfeature (f) is_featurekey = f2.featureKeyil_same_f = 1END IF
ALAYER.REFRESHOLE_1.Object.Autoredraw = trueend IF / / ===================================== / / name: wf_delete_feature //// String as_featruekey // Delete one symbol on the map ///// 20040913 // ====================================================================================================================================================================== ============ oleObject aLayeralayer = Create oleobject // ("mapx.layer.5 ")
ALAYER.CONNECTONEWOBJECT ("Mapx.Layer.5") ALAYER = OLE_1.Object.Layers ('meteruse ")
ALAYER.DELETEFEATURE (as_featruekey) ALAYER.REFRESH