Exemple #1
0
        private void BWriteJSON_Click(object sender, EventArgs e)
        {
            SaveFileDialog sfd = new SaveFileDialog();

            if (sfd.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            XGeoJson gj = new XGeoJson();

            gj.WriteJSONFile(layer, sfd.FileName + ".json");
            MessageBox.Show("完成");
        }
Exemple #2
0
        private void BOpenJSON_Click(object sender, EventArgs e)
        {
            IsJSONLayer = true;
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.Filter           = "JSON文件|*.json";
            openFileDialog.RestoreDirectory = false;
            openFileDialog.FilterIndex      = 1;
            openFileDialog.Multiselect      = false;
            if (openFileDialog.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            XGeoJson gj = new XGeoJson();

            JSONLayers = gj.ReadJSONFile(openFileDialog.FileName);
            //layer.DrawAttributeOrNot = false;
            MessageBox.Show("读入" +
                            (JSONLayers[0].FeatureCount() + JSONLayers[1].FeatureCount() + JSONLayers[2].FeatureCount()) + "个实体");
            view.UpdateExtent(JSONLayers[0].Extent);
            UpdateMap();
        }