Custom Boundaries

Custom Boundaries

Custom boundaries constrain the shared map viewer to a specific geographic area. When a boundary is set, viewers cannot pan or zoom outside the defined region. This is useful for focusing attention on a particular area — a city, a property, a project site — without distractions from the surrounding map.

Boundary Modes

The boundary setting in the Share modal offers two modes:

  • Auto — The viewer's viewport automatically fits to the extent of your features with comfortable padding. This is the default.
  • Custom — You define the exact boundary area using one of three methods: search, draw, or upload.
In Auto mode, the viewer still cannot scroll to the other side of the world — the viewport is constrained to your feature extent plus a 30% padding buffer.

Setting a Boundary by Search

  1. In the Share modal, switch the boundary mode from Auto to Custom
  2. Type a place name into the search field — country, state, city, or region (minimum 2 characters)
  3. Select a result from the dropdown list (results are limited to areas with polygon boundaries)
  4. The preview map zooms to the selected boundary

Search uses the Nominatim geocoding service to find place boundaries. Only results that have a polygon boundary are shown — point results like individual addresses are filtered out.

For best results, search for administrative areas like countries, states, counties, or cities. These have well-defined polygon boundaries. Searching for a street address will not return usable results.

Drawing a Boundary

  1. Click the Draw Rectangle button below the search field
  2. Click on the preview map to place the first corner of your rectangle
  3. Move your mouse — a rubber-band preview shows the rectangle as you move
  4. Click again to place the second corner and complete the rectangle
  • The cursor changes to a crosshair while drawing is active
  • A status indicator shows whether you are placing the first or second corner
  • Press Escape at any time to cancel the drawing and start over
  • The completed rectangle defines the viewer's maximum viewport

Uploading a Boundary

  1. Click Upload KML and select a .kml or .kmz file from your device
  2. The file is parsed and the first polygon boundary is extracted
  3. The preview map zooms to the uploaded boundary
  • KMZ files are automatically unzipped to extract the inner KML
  • If the file contains a MultiPolygon, the largest polygon (by coordinate count) is used
  • If the file contains no polygon features (only points or lines), a bounding box is computed from all features and used as a rectangular boundary
  • Invalid or empty files show an error message

MultiPolygon Handling

When a search result or uploaded file contains a MultiPolygon geometry (for example, a country with islands), MapEdit extracts the largest polygon by coordinate count. This ensures the boundary covers the main landmass rather than a small island.

Boundary Preview Map

The boundary picker includes an embedded preview map that shows your features along with the selected boundary. This preview is read-only — you can pan and zoom to inspect the boundary, but features cannot be edited. The preview automatically fits to your selected boundary when one is set.

Show Boundary to Viewers

When a custom boundary is set, an additional toggle appears: Show Boundary to Viewers. When enabled, a dashed indigo outline is drawn on the shared map so viewers can see the boundary area. This is useful when the boundary itself is meaningful — for example, a project site perimeter or a jurisdiction boundary.

If the boundary is purely for viewport constraint and you do not want viewers to see it, leave the "Show Boundary to Viewers" toggle off. The viewport will still be constrained, but no visible boundary will appear on the map.

Clearing a Boundary

To remove a custom boundary, click the Clear button in the boundary picker or switch back to Auto mode. This removes the boundary constraint and returns to the default behavior where the viewport fits to your features.

Live Data and Boundaries

If your project includes live data layers, the boundary interacts with the data in a specific way: in Auto mode, the viewport expands (but never shrinks) when new features appear from a live data refresh. This prevents the map from jumping around as data updates, while still ensuring all features remain visible.

With a custom boundary, the viewport stays fixed to the boundary you defined, regardless of where live data features appear.