Gravity.GoogleMaps.StaticMapBuilder 3.0.0

dotnet add package Gravity.GoogleMaps.StaticMapBuilder --version 3.0.0
                    
NuGet\Install-Package Gravity.GoogleMaps.StaticMapBuilder -Version 3.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Gravity.GoogleMaps.StaticMapBuilder" Version="3.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Gravity.GoogleMaps.StaticMapBuilder" Version="3.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Gravity.GoogleMaps.StaticMapBuilder" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Gravity.GoogleMaps.StaticMapBuilder --version 3.0.0
                    
#r "nuget: Gravity.GoogleMaps.StaticMapBuilder, 3.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Gravity.GoogleMaps.StaticMapBuilder@3.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Gravity.GoogleMaps.StaticMapBuilder&version=3.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Gravity.GoogleMaps.StaticMapBuilder&version=3.0.0
                    
Install as a Cake Tool

๐ŸŒ Gravity.GoogleMaps.StaticMapBuilder

Gravity.GoogleMaps.StaticMapBuilder is a fully type-safe, fluent, and extensible .NET URL builder for the Google Static Maps API. It helps you generate valid, optimized static map URLs effortlessly โ€” with full IntelliSense, compile-time checks, and support for complex features like styles, markers, paths, map IDs, and more.


๐Ÿš€ Features

  • โœ… Fully type-safe and fluent API
  • ๐Ÿง  Smart validation for all query parameters
  • ๐ŸŽจ Full support for styles, map types, and custom markers
  • ๐Ÿงญ Handles edge cases (map ID conflicts, marker limits, etc.)
  • ๐Ÿ” Built with test coverage in mind (96%+)
  • ๐Ÿงช Easy to unit test and extend

๐Ÿ“ฆ Installation

dotnet add package Gravity.GoogleMaps.StaticMapBuilder

๐Ÿ“š Documentation

Explore detailed usage guides for key features:

  • Markers โ†’ Standalone vs grouped markers, icons, limits, examples
  • Map Styles โ†’ Hue, lightness, feature types
  • Paths โ†’ Lines, polylines, geodesic options

๐Ÿงญ See the official Google Maps Static API for complete reference.


โšก Quick Start

var url = new StaticMapsUrlBuilder()
    .AddCenterWithCoordinates(48.8566, 2.3522)
    .AddZoom(13)
    .AddSize(600, 400)
    .AddMarkers(
        new LocationMarker("Eiffel Tower", label: 'E'),
        new CoordinatesMarker(48.8584, 2.2945, label: 'T')
    )
    .AddMapStyle(
        new MapStyle(
            new StyleRule(Color: new HexColor("0xFF0000")),
            Features.Road.AllRoad,
            Elements.Geometry.AllGeometry
        )
    )
    .AddKey("YOUR_API_KEY")
    .Build();

Please note that the url is not signed, see the official Google documentation for details.


๐Ÿงฑ Fluent Builders

Every parameter of the API is covered through intuitive, self-documenting builder methods:

.AddCenterWithLocation("Paris")
.AddZoom(12)
.AddScale(MapScale.Two)
.AddMapType(StaticMapType.Terrain)
.AddLanguage("en")

๐ŸŽจ Custom Styles Made Simple

var style = new MapStyle(
    new StyleRule(Hue: new HexColor("0x00FF00"), Visibility: Visibility.Simplified),
    Features.Administrative.Country,
    Elements.Labels.Text.AllText
);

๐Ÿ“ Marker Groups and Icons

var group = new MarkerGroup(MarkerSize.Mid, iconUrl: "http://yourcdn.com/marker.png");
group.AddLocation("Lyon");
group.AddCoordinates(45.75, 4.85);

๐Ÿงช Test Coverage & Reliability

  • 95%+ code coverage
  • Every builder method has unit and integration tests
  • Constraints validated both at build-time and runtime

๐Ÿ›ก๏ธ License

MIT License


๐Ÿ™Œ Credits

Made with โค๏ธ by GravityApps Developed & maintained by freelance developer https://github.com/AntoninLolivier


Want to contribute or suggest an improvement? ๐Ÿ‘‰ Open an issue or pull request on GitHub

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.0 720 12/3/2025
2.2.2 339 11/21/2025
2.2.1 348 11/21/2025
2.2.0 414 11/19/2025
2.1.0 227 6/18/2025
2.0.0 309 6/13/2025
1.0.2 210 5/27/2025
1.0.1 205 5/27/2025
1.0.0 202 5/27/2025