XF Ultrascale 2011 can retrieve and embed static maps from the internet, using the xf:geomap extension. Maps are retrieved from http://maps.google.com.
Maps are inline graphic elements just like images, barcodes and charts, so they can be placed and manipulated as such.
The syntax for adding a map is:
<xf:geomap xmlns:xf="http://www.ecrion.com/xf/1.0"
address="ANY_LOCATION_IN_THE_WORLD"
display-marker="BOOLEAN"
map-type="GOOGLE_MAP_TYPE"
zoom="INTEGER"
key="MY_API_KEY"
<!-- other image-specific attributes -->
fo:content-width="LENGTH_OR_PERCENT"
fo:content-height="LENGTH_OR_PERCENT"
<!-- ... -->
/>
The attributes have the following meanings:
| • | address - the address the map should point to; it's recommended to be as specific as possible about the location |
| • | display-marker - boolean value telling whether or not to display a marker on the map in the exact location pointed to |
| • | map-type - the type of the map as supported by the API; possible values are: roadmap, mobile, satellite, terrain, hybrid |
| • | zoom - the zoom level; an integer ranging from 0 to 19, specifying the zoom level; 0 is World View, while 19 is Building View |
| • | key - an API key that allows faster connection to the Google Maps service; a key will be provided by Google if you have a Google Account (more details here). |
The extension also supports any other standard image-specific attributes, as long as they are prefixed with the XSL-FO namespace prefix (i.e. fo:content-width instead of content-width).
Example:
<xf:geomap xmlns:xf="http://www.ecrion.com/xf/1.0" address="Pacific Avenue Atlantic City NJ USA" display-marker="true" map-type="hybrid" zoom="17" key="MY_API_KEY" fo:content-width="512.000px" fo:content-height="512.000px" />
The output for the code above will be:
