Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
<?xml version="1.0" encoding="UTF-8"?>
<dgml xmlns="">
<name>NearMap PhotoMaps</name>
<!-- <icon pixmap="nearmap-photomap-preview.png"/> -->
<description><![CDATA[<p>Aerial imagery of Australia from NearMap.</p>]]></description>
<minimum> 900 </minimum>
<maximum> 4000 </maximum>
<discrete> false </discrete>
<map bgcolor="#000000">
<layer name="nearmap-photomap" backend="texture" >
<!-- NearMap PhotoMaps expire usually after 30 days for most areas
although some tiles are less and some are more. Use 15 days
or 1296000 seconds -->
<texture name="map" expire="1296000" >
<sourcedir format="JPG"> earth/nearmap-photomap </sourcedir>
<storageLayout levelZeroColumns="1" levelZeroRows="1" mode="Custom" />
<projection name="Mercator" />
<downloadUrl protocol="http" host="" path="/maps/x={x}&amp;y={y}&amp;z={zoomLevel}&amp;nml=Vert" />
<property name="coordinate-grid">
<property name="overviewmap">
<property name="compass">
<property name="scalebar">
<section name="coordinate-grid" checkable="true" connect="coordinate-grid" spacing="12">
<heading>Coordinate Grid</heading>

This comment has been minimized.

Copy link
Owner Author

@andrewharvey andrewharvey commented Oct 25, 2010

For those interested I found out how the minimum and maximum zoom are calculated.

zoom = 200.0 * ln(radius of earth in pixels).

So in terms of, where n is the tile zoom level, and 256 is the width of the tiles in pixels, and ln is log base e.
zoom = 200.0 * ln((2^n * 256) / 2 / pi).

Setting this as the min and max zoom in the dgml file means that Marble won't let you zoom outside of that range. For some reason (which I am not surprised about) at high OSM zoom levels using this calculation won't exactly set the zoom bound to that OSM zoom level, but it seems reasonable enough. Also these values aren't too important as Marble will use the best avaliable tiles, so if it can only find tiles up to OSM zoom 18, but you zoom down on a scale of 22, and the max zoom in the dgml file is equiverlant to OSM zoom 22, it will just show up scaled up versions of the OSM zoom 18 tiles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment