Products
MapTiler Cloud
Maps Platform GeoData Hosting Weather Visualization Static maps API
MapTiler
Map Design Tool Search & Geocoding IP Geolocation API MapTiler SDK JS
server & data
Self-hosted Maps Map Server
Engine & Desktop
GeoData Processing
Company
News Careers About Us Open-source Contact
Pricing
Resources
Documentation Portal JavaScript SDK Android SDK iOS SDK API Client Library + CLI API Reference Tileset Schemas YouTube Channel Support
Search Products
MapTiler Cloud
Maps Platform GeoData Hosting Weather Visualization
MapTiler
Map Design Tool Search & Geocoding IP Geolocation API Static maps API MapTiler SDK JS
server & data
Self-hosted Maps Map Server
Engine & Desktop
GeoData Processing
Company
News Careers About Us Open-source Contact
Pricing Resources
Documentation Portal JavaScript SDK Android SDK iOS SDK API Client Library + CLI API Reference Tileset Schemas YouTube Channel Support
My Cloud
My Cloud
  1. Documentation
  2. SDK JS
  3. Examples
  4. Add a pattern to a polygon

Add a pattern to a polygon

Use the fill-pattern feature to draw a polygon by employing a repeating image pattern. This technique allows for the creation of visually appealing shapes by using a repeated image as a fill. To implement this, refer to the layer ⇾ fill ⇾ fill-pattern section in the GL Style Specification.



Related examples

Show polygon data from GeoJSON on the map

GeoJSON polygon layer

Example

This tutorial shows how to add a GeoJSON polygon overlay to the map.

Polygon fill pattern (polygon helper)

Polygon fill pattern (polygon helper)

Example

This example shows how to add a polygon layer with a fill pattern to the map using the polygon layer helper.

Polygon color ramp symbol (polygon helper)

Polygon color ramp symbol (polygon helper)

Example

This example shows how to add a polygon layer with a color ramp symbol that changes the fill color based on the map's zoom level using the polygon layer helper.

Show polygon information on click

Show polygon information on click

Example

When a user clicks a polygon, display a popup containing more information.

An extension of MapLibre GL JS
MapTiler SDK JS the easiest way for developers to integrate maps with their web applications and products is using our JavaScript Maps SDK

Examples

More than 100 examples

SDK JS Reference

  • Map
  • Map Styles
  • Markers and popups
  • Sources
  • Layers
  • Controls
  • Helpers
  • Coordinates
  • Events
  • User interaction handlers
  • Languages
  • Color Ramp
  • Config
  • API Client
  • Properties and options
  • Types

SDK Modules

  • 3D JS
  • Augmented reality (AR)
  • Elevation Profile
  • Geocoding
  • Marker Layout
  • Weather JS

Video tutorials

  • video tutorial about sdk-js
  • More video tutorials

JS Frameworks

  • Angular
  • React
  • Svelte
  • Vue.js
  • Vite

Other maps libraries

  • MapTiler SDK JS
  • Leaflet
  • OpenLayers
  • Deck.gl
  • Cesium

Other libraries

  • Unreal
  • Unity

Module Usage

  • MapTiler SDK JS
  • Leaflet
  • OpenLayers
  • MapLibre GL JS
  • React component
  • Svelte component
  • Vanilla JS

Module Reference

  • API Reference
  • Types and interfaces

Follow us on

Products
Maps API Geocoding Map designers tool GeoData hosting Static map IP Geolocation API Coordinates API Data processing Weather visualization MapTiler SDK Self-hosting Server Self-hosting Data
Maps & data
Streets Satellite Basic Light Dark Outdoor Winter 3D Terrain Countries MapTiler planet Attribution-free map Map preview Showcases & Tools
Usage
Transportation Weather Real Estate Aviation News & Media Government Mapbox alternative Google Maps API alternative Maps in videos Maps for games Custom coordinate systems Augmented reality maps Elections
Documentation
Tutorials API Reference Web SDK Android SDK iOS SDK Tileset Schemas YouTube channel Bug report
Company
News Jobs About Us Become a Partner Open-source Press Contact Cookie settings

©  2024  MapTiler. All rights reserved. Privacy & Terms.