Available Styles
- Satellite: Aerial imagery with terrain and building details.
- Street: Standard road map with streets, labels, and points of interest.
- Dark: A dark-themed map suitable for night mode or low-light environments.
- Light: A light-themed map for a clean and modern look.
- Custom: Create your own style using 3DMapFi Editor or other tools.
Terrain Styles
3DMapFi also supports terrain-enhanced styles, allowing you to visualize elevation, hillshading, and 3D terrain features. These can be combined with any base style for a more immersive experience.Applying Styles
You can apply styles to your map during initialization or dynamically at runtime. Here’s how to set a style when creating a new map:Switching Styles Dynamically
When switching styles at runtime, you may want to preserve certain layers or controls. Use event listeners to re-add custom layers or UI elements after the style loads.Customizing Styles
You can customize existing styles or create new ones using the 3DMapFi Editor. This allows you to modify colors, fonts, and other visual elements to match your branding or design preferences.Layer Types
- Fill: For polygons such as parks, lakes, or land use.
- Line: For roads, boundaries, and paths.
- Symbol: For icons and text labels.
- Raster: For satellite imagery or raster tiles.
- Circle: For point data visualizations.
- Hillshade: For terrain shading.
Expressions
Expressions allow you to create data-driven styles. For example, you can color roads based on traffic data or population density.Style Editor
The Style Editor provides a user-friendly interface to create and modify map styles. You can:- Add or remove layers
- Adjust layer properties (e.g., color, opacity, visibility)
- Create custom expressions for dynamic styling
- Save and export your styles for use in your applications For more details on using the Style Editor, refer to the Map Editor documentation.
Importing and Exporting Styles
You can import existing style JSON files into the Style Editor, or export your custom styles for use in other applications.Example Style Configuration
Here’s an example of a custom style configuration using the Style Editor:Tips and Best Practices
- Performance: Limit the number of layers and sources for optimal performance.
- Branding: Use custom fonts and colors to align maps with your brand.
- Accessibility: Ensure sufficient contrast and readable labels for all users.
- Versioning: Keep track of style versions for easier maintenance and updates.
- Testing: Preview your styles on different devices and zoom levels.