GM_LoadOnlineLayer with vector (WFS) data
BurroWrangler
Global Mapper UserTrusted User
in SDK
Hi,
I'm trying to download WFS vector data using GM_LoadOnlineLayer without prompting the user for a filename. I have a filename I want to pass into the GM_LoadOnlineLayer function but there does not appear to be a method for doing this. For example, I have the following WFS server that I've defined in a user_online_sources.xml file for my application:
Then I call GM_LoadOnlineLayer using the following code:
This function does not bring up the dialog to select the online data I want to download (this is what I want), but it does bring up a dialog to define a filename for the downloaded vector .gml file (I do not want this). Is there any way to pass GM_LoadOnlineLayer a vector filename and have it save this vector file instead of prompting for a filename? Or is there some other workaround so the save file dialog does not come up when this function is called? I am able to export the vector file to my desired filename later using GM_ExportVector, but I would like to export the file to the desired filename when GM_LoadOnlineLayer is called or at least save the file to a specified location and then export the file later. Any ideas how I can avoid bringing up the save file dialog when GM_LoadOnlineLayer is called?
Thanks,
Chris
I'm trying to download WFS vector data using GM_LoadOnlineLayer without prompting the user for a filename. I have a filename I want to pass into the GM_LoadOnlineLayer function but there does not appear to be a method for doing this. For example, I have the following WFS server that I've defined in a user_online_sources.xml file for my application:
<source type="WFS">
<name>Base_Flood_Elevations</name>
<group_list>
<group>FEMA Vector Data</group>
</group_list>
<GetCapsURL>https://hazards.fema.gov/gis/nfhl/services/public/NFHL/MapServer/WFSServer</GetCapsURL>
<ServiceName>WFS</ServiceName>
<LayerNameStyleList>
</LayerNameStyleList>
<WFSFeatureTypeId>public_NFHL:Base_Flood_Elevations</WFSFeatureTypeId>
<WFSDescribeFeatureURL>https://hazards.fema.gov/gis/nfhl/services/public/NFHL/MapServer/WFSServer?</WFSDescribeFeatureURL>
<WFSGetFeatureURL>https://hazards.fema.gov/gis/nfhl/services/public/NFHL/MapServer/WFSServer?</WFSGetFeatureURL>
<MaxZoomMetersPerPixel>0.00</MaxZoomMetersPerPixel>
</source>
Then I call GM_LoadOnlineLayer using the following code:
GM_Rectangle_t olRect;
olRect.mMaxX = -78.521561621681016;
olRect.mMaxY = 35.779925110918278;
olRect.mMinX = -78.558683394541518;
olRect.mMinY = 35.761644674699923;
GM_LayerHandle_t32 handle;
GM_LayerHandle_t32 handle;
GM_Error_t32 err =
GM_LoadOnlineLayer("Base_Flood_Elevations", &olRect, &handle, NULL);
This function does not bring up the dialog to select the online data I want to download (this is what I want), but it does bring up a dialog to define a filename for the downloaded vector .gml file (I do not want this). Is there any way to pass GM_LoadOnlineLayer a vector filename and have it save this vector file instead of prompting for a filename? Or is there some other workaround so the save file dialog does not come up when this function is called? I am able to export the vector file to my desired filename later using GM_ExportVector, but I would like to export the file to the desired filename when GM_LoadOnlineLayer is called or at least save the file to a specified location and then export the file later. Any ideas how I can avoid bringing up the save file dialog when GM_LoadOnlineLayer is called?
Thanks,
Chris
Tagged:
Categories
- 12.8K All Categories
- 5.7K Features Discussion
- 345 Downloading Imagery
- 1.3K Elevation Data
- 385 Georeferencing Imagery Discussion
- 637 GM Script Language
- 54 User Scripts
- 114 GPS Features
- 417 Projection Questions
- 826 Raster Data
- 1.3K Vector Data
- 6.6K Support
- 178 Announcement and News
- 913 Bug Report
- 558 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 569 Other Discussion
- 131 GIS Data Sources
- 27 Global Mapper Showcase
- 238 How I use Global Mapper
- 107 Global Mapper Forum Website