Using the Prefab Tile Renderer node

Use the Prefab Tile Renderer node to render raster tiles. For example, you can render 2D satellite imagery.

The Prefab Tile Renderer instantiates a prefab template in the center of a map tile, and optionally scales that prefab by the size of the tile.

To account for the effects of bilinear magnification, the texture that you apply from a raster layer contains a border of texels from the surrounding map tiles. To account for this, you can set the tile prefab properties to which the Prefab Tile Renderer sets the scale and offset of the texture.

Creating a Prefab Tile Renderer using the Palette

You can use the Palette to quickly create and set up a Prefab Tile Renderer that renders satellite imagery on 2D ground.

To create a Prefab Tile Renderer using the Palette:

  1. In the Node Tree, select the Map View node where you want to render satellite imagery.

  2. In the Kanzi Studio main menu, select Kanzi Maps > Palette.

    ../../_images/kanzi-maps-palette-menu.png
  3. When Kanzi Studio asks whether you want to import assets, click Yes.

    ../../_images/import-assets.png
  4. In the Kanzi Maps Palette, select 2D satellite ground and click Create.

    ../../_images/palette-create-2d-satellite-ground.png ../../_images/preview-2d-satellite-ground.png

Creating a Prefab Tile Renderer manually

To create a Prefab Tile Renderer manually:

  1. In the Node Tree, press Alt and right-click a Map View node and select Prefab Tile Renderer.

    ../../_images/node-tree-create-prefab-tile-renderer.png
  2. In the Prefabs, create a Plane prefab. In the Properties, add and set:

    • Mesh Material to a material that supports rendering a texture

    • Width and Height to 1

      This way the Prefab Tile Renderer can automatically scale the texture to the size of the map tile.

    • Render Transformation property Rotation X property field to -90

    ../../_images/prefabs-plane.png ../../_images/properties-plane.png
  3. In the Node Tree, select the Prefab Tile Renderer that you created. In the Properties, set:

    • Tile Prefab property to the Plane prefab

    • Texture Layer to the name of the raster layer that provides the imagery that you want to render.

      The property is by default set to the Mapbox raster layer satellite, which provides high-resolution satellite imagery.

      When this property is empty, the Prefab Tile Renderer renders the texture from the texture property in the tile prefab that you set with the Texture property.

    • Texture to a property in the tile prefab that sets the texture in the material used by the prefab.

      For example, set it to the Material > Texture property.

    • Texture Scale to a property in the tile prefab that sets the scaling of the texture along the x and y axes.

      For example, set it to the Material > Texture Tiling property.

    • Texture Offset to a property in the tile prefab that sets the offset of the texture along the x and y axes.

      For example, set it to the Material > Texture Offset property.

    • (Optional) When you do not want the Prefab Tile Renderer to scale the texture by the size of the tile prefab:

      • Scale to Tile Size to disabled

      • Tile Size to a Vector 2D property in the tile prefab that sets the tile size

    ../../_images/node-tree-prefab-tile-renderer.png ../../_images/properties-prefab-tile-renderer.png ../../_images/preview-prefab-tile-renderer.png

Controlling the visibility of content based on zoom level

To avoid visual clutter in your map, you can show content only at a specific range of zoom levels. Use the Minimum Zoom Level and Maximum Zoom Level properties to set the range of zoom levels at which a tile-based Renderer renders its content.

For example, in the Node Tree, select a Renderer node. In the Properties, add and set the Minimum Zoom Level property to 12.5.

This way, you hide the content rendered by the Renderer when in the Map View node the value of the Zoom Level property is less than 12.5.

../../_images/minimum-zoom-level.png