## Preview Features

Q2G includes a built-in preview system to visualize your layers and styles:

- View layers in an interactive web map
- Preview styles before uploading
- Test layer visibility and symbology
- Check layer extents and properties
- View layer information and attributes

## Opening the Preview

### Preview Dialog

To open the preview for a layer:

1. In the QGIS Layers panel, find the layer you want to preview
2. Look for the preview button (usually labeled with an eye icon)
3. Click the preview button
4. The preview window will open showing the layer

### Preview Window Layout

- Map Area: Interactive web map showing the layer
- Toolbar: Zoom, pan, and other controls
- Layer List: Available layers to display
- Information Panel: Layer details and properties

## Map Controls

### Navigation Controls

Control | Function | Keyboard Shortcut
--- | --- | ---
Zoom In | Zoom to a smaller area | +
Zoom Out | Zoom to a larger area | -
Pan | Move the map around | Click and drag
Fit to Extent | Zoom to layer extent | Home
Return to initial view | R

### Using the Q2G Controls

- Zoom: Use the + and - buttons or scroll wheel
- Pan: Click and drag the map
- Fit to Layer: Click the "Fit" button to zoom to layer extent

## Viewing Layer Information

### Layer Properties

The information panel shows:

- Layer Name: Name of the layer
- Type: Vector or Raster
- Geometry Type: Point, Line, Polygon, etc.
- CRS: Coordinate Reference System
- Extent: Bounding box coordinates
- Feature Count: Number of features (for vectors)

### Attribute Information

For vector layers, you can view:

- Attribute table
- Data types for each attribute
- Sample values

## Previewing Styles

### Style Preview

The preview shows how your layer will appear with its current QGIS style:

1. Open the preview for a layer
2. The map will display the layer with its QGIS style
3. Colors, symbols, and labels are shown
4. You can verify the style looks correct

### Testing Styles

Before uploading, test your styles:

1. Modify the layer style in QGIS
2. Open the preview
3. Check if the style renders correctly
4. Make adjustments if needed
5. Upload when satisfied

### Style Compatibility

Note that:

- Some QGIS styles may not convert perfectly to SLD
- Complex effects may not be supported
- Test on GeoServer after uploading

## Feature Information

### Clicking on Features

To get information about a feature:

1. Click on a feature in the map
2. A popup will show the feature's attributes
3. You can view all attribute values

### Feature Details

The popup shows:

- All attribute names and values
- Geometry type and coordinates
- Feature ID

## Exporting from Preview

### Export Options

From the preview window, you can:

- Export as Image: Save the current view as PNG/JPG
- Export as PDF: Save as a printable PDF
- Export Coordinates: Copy current extent

### Exporting the Map

1. Arrange the map view as desired
2. Click the "Export" button
3. Choose export format
4. Select save location
5. Click "Save"

## Multiple Layer Preview

### Viewing Multiple Layers

If you have multiple layers loaded:

1. Open the preview
2. Use the layer list to toggle layers on/off
3. Adjust layer order if needed
4. Check how layers interact

### Layer Transparency

Adjust layer transparency:

- Use the opacity slider for each layer
- See through overlapping layers
- Test layer combinations

## Troubleshooting Preview Issues

### Preview Won't Open

- Ensure the layer has valid geometry
- Check the layer has a valid CRS
- Try refreshing the preview
- Check QGIS logs for errors

### Layer Not Showing

- Check if the layer is enabled in the layer list
- Verify the layer has features
- Check the layer extent (may be zoomed out)
- Try "Fit to Extent" button

### Style Not Showing Correctly

- Some QGIS styles may not preview perfectly
- Check the style in QGIS directly
- Simplify the style if needed
- Test on GeoServer after uploading

### Performance Issues

- Large layers may be slow to render
- Try zooming to a specific area
- Reduce the number of visible layers
- Check your computer's resources

## Best Practices

- Always Preview: Preview layers before uploading
- Check Styles: Verify styles render correctly
- Test Interactions: Check how multiple layers work together
- Verify Extent: Ensure layer extent is correct
- Check Attributes: Verify all attributes are present

## Next Steps

- Layer Upload - Upload your previewed layers
- Style Management - Manage layer styles
- Troubleshooting - Solve common issues

↑