Migrating from Google Maps

Migrate your Google Maps dynamic and static map integration to Woosmap Map JS API.

The Woosmap Map JS API was designed to match Google Maps’ class names and method signatures. If you’re only using dynamic maps, markers, and shapes, this migration is essentially a find-and-replace.

Script Tag & Map Init

HTML
        <!-- Google Maps -->
<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_GOOGLE_KEY&callback=initMap" defer></script>

<!-- Woosmap -->
<script src="https://sdk.woosmap.com/map/map.js?key=YOUR_WOOSMAP_KEY&callback=initMap" defer></script>

    
JavaScript
        // Google Maps
const map = new google.maps.Map(document.getElementById("map"), {
  center: { lat: 48.8566, lng: 2.3522 },
  zoom: 13,
});

// Woosmap — same signature, different namespace
const map = new woosmap.map.Map(document.getElementById("map"), {
  center: { lat: 48.8566, lng: 2.3522 },
  zoom: 13,
});

    

All classes follow the same pattern: replace google.maps with woosmap.map. That applies to Map, Marker, InfoWindow, Circle, Polygon, Polyline, LatLng, LatLngBounds, and event.*.

Two things that aren’t a straight swap:

  • LatLngBounds constructor takes (ne, sw) — Google uses (sw, ne).
  • LatLnglat and lng are properties, not methods. Drop the parentheses: location.lat instead of location.lat().

Map Styling

Woosmap supports the same JSON style format as Google Maps — styles from Snazzy Maps or Google’s style editor work directly. See the style reference for the full list of supported feature types and stylers.

Static Maps

The Static Map API is where parameter formats actually differ:

Shell
        # Google Maps
curl "https://maps.googleapis.com/maps/api/staticmap?center=48.8584,2.2945&zoom=15&size=600x400&key=YOUR_GOOGLE_KEY"

# Woosmap
curl "https://api.woosmap.com/maps/static?lat=48.8584&lng=2.294351&zoom=15&width=600&height=400&key=YOUR_WOOSMAP_KEY"

    

With markers:

Shell
        # Google Maps
curl "https://maps.googleapis.com/maps/api/staticmap?center=48.8584,2.2945&zoom=15&size=600x400&markers=color:red|48.8584,2.2945&key=YOUR_GOOGLE_KEY"

# Woosmap
curl "https://api.woosmap.com/maps/static?lat=48.8584&lng=2.294351&zoom=15&width=600&height=400&markers=color:red|48.8584,2.294351&key=YOUR_WOOSMAP_KEY"

    
Parameter Google Maps Woosmap
Center center=lat,lng lat=...&lng=...
Size size=WIDTHxHEIGHT width=...&height=...
Markers Same syntax Same syntax
Retina scale=2 retina=yes
Image format PNG or JPEG PNG only

Full parameter list: Static Map API docs.

What Woosmap Doesn’t Cover

If your Google Maps integration uses any of these, they’ll need a separate solution:

  • Street View — not available in Woosmap.
  • Traffic, Bicycling, Transit layers — no map overlay equivalents. Woosmap does support transit routing and traffic-aware directions, just not as visual map layers.
  • Elevation API — not available.
  • AdvancedMarkerElement — Woosmap uses the traditional Marker class, but you can build custom HTML/CSS markers (example).
Was this helpful?