Subscribe Bookmark RSS Feed
JohnPonte

Staff

Joined:

Jun 17, 2013

All About Background Maps in JMP 9: JSL Scripting

This blog post is the final one in a series about image-based background maps in JMP 9.



Part I of the series introduced background maps, which are a new feature in JMP. It explained why background maps are useful and showed how to access a background map through the user interface.


Part II of the series discussed Simple Earth and Detailed Earth. These options are the background maps that are installed as part of the JMP product. Because they are local to the machine, they don't require any Internet connection or rely on server availability. But they have a limited resolution, and the quality of the imagery starts to degrade when you zoom in too close.


Part III of the series discussed the Web-based options for background maps: NASA and Web Map Services. These options support the WMS api and let you retrieve maps from a WMS server on the Internet. A WMS server can often generate a map at a higher resolution, allowing you to zoom in on the graph.


Part IV of the series discussed a JMP add-in called the WMS Explorer. This add-in helps to find WMS servers that are available online. It also gives a preview of what locations the WMS server covers and what types of maps it can return.




I invite you to read these blog posts if you haven't already. I hope they will answer any questions you have about the image-based background maps in JMP 9. I'd also like to point out that others at JMP have written blog posts about the vector-based background maps.


One thing I haven't discussed yet is how to access the background map functionality through JSL. You can find an example of this in the Samples Data directory. Run JMP and open the sample data file called Hurricanes.jmp. Edit the script called Bubble Plot with Map. Look for the command in the script that begins with Background Map.


To figure out the correct parameters for the background map command, simply look at the background map dialog. The wording on the dialog is the same as the JSL commands. To create a background map, simply use the command Background Map().


There are two types of background maps you can specify: Images() and Boundaries(). Each of these then takes a parameter, which is the name of the map to use. The name is one of the maps listed in the dialog. For Images(), the choices are "Simple Earth," "Detailed Earth," "NASA" or "Web Map Service." If you elect to use "Web Map Service," then there are two additional parameters: the WMS URL and the layer supported by the WMS server. For Boundaries(), the choices vary since boundaries can be user-defined. But a typical choice might be "World Countries."


So if I wanted to add a background map that used the "Detailed Earth" imagery and the "World Countries" as a boundary, the command would look like this:


Background Map ( Images ( "Detailed Earth" ), Boundaries ( "World Countries" ) )


If I wanted to change that to use a WMS server, then the command might look like this:


Background Map (

Images ( "Web Map Service", "http://wms.jpl.nasa.gov/wms.cgi", "BMNG" ),

Boundaries ( "World Countries" )

)

Note the spacing doesn't matter. I just did it for readability. And here is what the graph would look like:




Tip: Of course, you can always create your graph and add a background map through the user interface. Then from the little red triangle (lrt) use the Script->Save Script to Script Window menu item to see the JSL that gets generated. I find this technique very helpful for learning JSL in general.


So what else can you do with background maps in JMP? Well, apparently you can use them to create the company holiday card. Check it out! Whatever holiday you choose to celebrate at this time of year, I'd like to wish you a happy one. And I hope you have a happy, healthy and successful 2011.


Peace!