3 Replies Latest reply: Oct 20, 2015 3:19 PM by Paul White RSS

    DataWatch Designer  - Map Provider Options?

    Paul White

      Hello all - I've recently integrated a map into my DataWatch Dashboard.  My intended functionality is fairly simple - just to show X/Y coordinates on a map, which is powered by a parameter-driven action the user ('ve got that part working fine). 


      I've noticed that in the Map Plot Settings, there is an option for "Map Provider", however the only option is "Default".  How does one choose other options?  I've noticed the DW reference guide indicates that the Map Provider options are changed by modifying the configuration.  Is this referring to the text configuration that each user has in the appdata folder?  I'd like the


      Ideally, we would like to use a WMS layer to plot weather activity on the map, as well as having google maps as the provider. Is this possible? 


      Thank you for any information you can provide!


        • Re: DataWatch Designer  - Map Provider Options?
          Theo Klemming

          Hi Paul

           

          The Map Plot is designed with an architecture that is prepared for mulitple map provider choices. At this point, Datawatch provides map tiles from only 1 third party map server provider.

           

          Still, a user with access to a different map service should be able to use this instead. This is somewhat of an undocumented feature at the moment. I will make some investigations and get back to you on this topic.

           

          Best regards, Theo Klemming

          • Re: DataWatch Designer  - Map Provider Options?
            Theo Klemming

            Hi Paul

             

            I have now found out what the procedure is for adding maps to the Map Plot in addition to the default shipped with Datawatch.

            Please regard each of the steps below carefully.

             

            1. To add new map alternatives for the map plot, you will be editing a settings file containing XML. When you edit and save this file, Datawatch Designer must be CLOSED.

            2. If you are using Designer stand-alone, without a Datawatch server for which the URL is set in Tools > Options, you will edit a file called user.config on your own PC. If you are using Designer in combination with a server (local or remote), you will edit a file in the server installation called DefaultSettings.xml

            3. If you have edited the local user.config file, but nonetheless have Designer set to connect to a Datawatch server, your edited local user.config file will be overwritten with information from the server's DefaultSettings.xml

            4. In the case of working with Designer as a stand-alone application, you will find the user.config file in this location:

            C:\Users\<user>\AppData\Local\Datawatch_Corporation\EXDesigner.exe_StrongName_<randomvalue>\<currentlyinstalledversion>\

            5. In the case of working with Deigner connected to a server, you will find the DefaultSettings.xml file in this location (on the machine hosting the server): C:\inetpub\wwwroot\datawatchvdd\App_Data\

            6. For editing, use Notepad or Notepad++ for example. Before editing, make a backup copy of the file. A defect user.config file will prevent Designer from starting. Regardless of which of the files you are editing (user.config or DefaultSettings.xml), you will look for a section called GlobalSettings. This is a so called PropertyBag section, and when you search the file, you will see that the name value "GlobalSettings" is just *at the end* of this PropertyBag section in the XML.

            7. To add a new map provider to the map plot, you will edit a PropertyBag child of the GlobalSettings PropertyBag. The PropertyBag you will edit has the name "TileProviders".

            8. When you edit the TileProviders PropertyBag, the result should be like the example below, which you can copy for a quick test. It will add the option to use map tiles from MapQuest:

             

            <PropertyBag>

                <Values />

                <SubGroups>

                    <PropertyBag>

                        <Values>

                            <PropertyValue>

                                <Name>ProviderId</Name>

                                <Value>MapQuest</Value>

                            </PropertyValue>

                            <PropertyValue>

                                <Name>MinZoom</Name>

                                <Value>0</Value>

                            </PropertyValue>

                            <PropertyValue>

                                <Name>MaxZoom</Name>

                                <Value>18</Value>

                            </PropertyValue>

                            <PropertyValue>

                                <Name>TileSize</Name>

                                <Value>256</Value>

                            </PropertyValue>

                            <PropertyValue>

                                <Name>UrlFormat</Name>

                                <Value>http://otile1.mqcdn.com/tiles/1.0.0/map/{0}/{1}/{2}.png</Value>

                            </PropertyValue>

                            <PropertyValue>

                                <Name>TileCoordEncoding</Name>

                                <Value>0</Value>

                            </PropertyValue>

                        </Values>

                        <SubGroups />

                        <Name>MapQuest</Name>

                    </PropertyBag>

              </SubGroups>

                <Name>TileProviders</Name>

            </PropertyBag>

             

            9. When you have replaced the TileProviders PropertyBag with the XML snippet above, you save and close the file.

            10. To add any additional map providers, simply clone the PropertyBag named MapQuest, creating a second PropertyBag of the same kind, and so on. There are 3 things to edit: The ProviderId value, The UrlFormat value, and the PropertyBag Name value.

            11. In the URL shown in the example, {0} represents the zoom level value, {1} represents the x-coordinate value and {2} represents the y-coordinate value. For any actual map tile URL, these will have been replaced by numbers before the request for a tile is sent to the map server. The Map Plot in Datawatch takes care of inserting those numeric values as required, instead of the {0} and {1} and {2}.

            12. To find any other map providers that you might want to use, I recommend this website: Map Compare | BBBike.org When you look at a map that you like, right-click the map surface, and (at least in Chrome) select "Copy image URL". Paste the image URL somewhere to investigate it. Any such URL that ends with the pattern /{0}/{1}/{2}.png (however you will see actual numbers instead of {0} and {1} and {2}) indicates that the map provider will work well to add as a Map Provider in Datawatch. There is a long list of providers to pick from. Note that for each provider, it is your own responsibility to find out what the usage conditions are. Some providers require that you get your own map API-key or user token from them, and some may charge money for it.

             

            To provide additional examples, I will add a text file containing all the map tile servers I added to my configuration as part of researching this answer.

             

            Good Luck! // Theo