Skip to content

About

MapFix - Independent open-source Google Maps short link fixer that creates direct Google Maps URLs, Apple Maps alternatives, coordinates & Plus Codes.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

MapFix – Google Maps Link Fixer

An independent, free, open-source utility that resolves supported Google Maps short links into direct URLs and generates Apple Maps alternatives, verified coordinates, and Plus Codes when available.

Live Site: https://google-maps-link-fixer.vercel.app/

When shortened Google Maps URLs (maps.app.goo.gl or legacy goo.gl/maps) stall in embedded webviews, fail to redirect across browsers, or get stuck loading on iPhone or desktop, MapFix resolves the redirect server-side, inspects the destination structure, strips share-sheet tracking parameters, outputs a clean, direct https://www.google.com/maps... link, and provides an Apple Maps alternative plus coordinates and a Plus Code when supported by the extracted destination data.

Disclaimer: MapFix is an independent utility and is not affiliated with, endorsed by, or sponsored by Google LLC or Apple Inc.


Features

  • Server-Side Short Link Expansion: Resolves https://maps.app.goo.gl/... and legacy https://goo.gl/maps/... links without browser extensions, accounts, or Google Maps API keys.
  • Apple Maps Conversion (When Supported): Generates https://maps.apple.com/... alternatives (place, search, or directions) from extracted coordinates, place names, addresses, search queries, or routes—while explicitly withholding conversion for Google Place ID-only, shortlist, incomplete, or map-center-only URLs.
  • Verified Coordinates & Open Location Code (Plus Codes): Preserves verified destination coordinates with original decimal or DMS arcsecond precision (strictly separating viewport-only /@lat,lng, center=, and query-biased ll= map centers) and encodes global Plus Codes locally using Google's official open-source Open Location Code algorithm. Plain coordinate URLs (such as ?q=lat,lng or standalone ?ll=lat,lng) encode a coordinate pin and Plus Code representing those supplied coordinates, not a verified business listing.
  • Destination Semantics Preservation: Distinguishes Place, Directions (including incomplete /maps/dir/?api=1 links), Search, Coordinates / Dropped Pin (including 0,0 and DMS coordinates), Shortlists (map_action=shortlist&place_ids=...), and Placelists (/maps/placelists/list/...)—never flattening routes or dropped pins into generic text searches.
  • Tracking Clutter Removal: Strips share-sheet parameters (g_ep, g_st, entry, lucs, skid, coh, shh, shs, shorturl, utm_*, fbclid, gclid) while keeping Place IDs (query_place_id, place_id, ftid, cid), coordinates, and route parameters intact.
  • Transparent Status Labeling: Clearly communicates whether a link was Resolved / Verified Structure, Accepted · Unverified, Incomplete, or Rejected.
  • 10-Stage Validation & SSRF Defense: Strict hostname allowlisting, HTTPS-only outbound requests, DNS resolution validation with socket IP pinning, redirect-loop detection, hop caps, payload/response size limits, and per-instance IP rate limiting.
  • SEO & Accessibility Ready: Server-rendered informational guides, Next.js Metadata API, sitemap.xml, robots.txt, dynamic Open Graph image (Paste → Resolve → Copy), JSON-LD (WebSite, WebApplication, FAQPage), WCAG-oriented focus/ARIA support, and default light mode with optional dark mode toggle.

Screenshots

Homepage (Light Mode)

MapFix – Google Maps Link Fixer homepage in light mode showing the URL input bar, status badge guide, and clean editorial layout

Resolved Link & Inline Actions

MapFix – Google Maps Link Fixer displaying a resolved maps.app.goo.gl short link with inline Copy Fixed Link, Open in Maps, and Reset actions

Homepage (Dark Mode)

MapFix – Google Maps Link Fixer homepage in dark mode


Technology Stack

  • Framework: Next.js 16 (App Router)
  • Language: TypeScript (strict mode)
  • Styling: Tailwind CSS v4
  • Icons: Lucide React
  • Analytics: Cookieless Vercel Web Analytics (@vercel/analytics/next)
  • Runtime: Node.js (for POST /api/fix SSRF-safe HTTPS resolution)
  • Testing: Vitest
  • Package Manager: pnpm
  • Hosting: Vercel (Hobby plan compatible, zero database)

Architecture Overview

flowchart LR
    U["User Browser (iOS / Android / Desktop)"] -->|"1. Paste Maps URL"| UI["MapLinkFixer Client UI"]
    UI -->|"2. POST /api/fix (JSON <= 4 KB)"| API["API Route (/api/fix, Node.js)"]
    API -->|"3. Rate Limit + Payload Check"| PIPE["10-Stage Validation Pipeline"]
    PIPE -->|"4. Classify URL"| CLS["classifier.ts"]
    CLS -->|"Short Link (maps.app.goo.gl / goo.gl/maps)"| SEC["security.ts (DNS Pinning + SSRF Guard)"]
    SEC -->|"5. Manual HTTPS Redirects (<= 8 hops)"| GOOG["Google Maps Servers"]
    GOOG -->|"301/302 Location"| SEC
    SEC -->|"6. Validate Hop & Interstitials"| DST["destination.ts"]
    CLS -->|"Full Maps URL (google.com/maps / maps.google.com)"| DST
    DST -->|"7. Extract Semantics, Strip Tracking, Verify Output"| API
    API -->|"8. Structured JSON Result / Honest Error"| UI
Loading

Supported URL Formats

Format Example Support
Modern Short Link https://maps.app.goo.gl/... Resolved server-side via HTTPS redirects
Legacy Short Link https://goo.gl/maps/... Resolved server-side (/maps/ path required)
Full Maps URL https://www.google.com/maps/... & https://google.com/maps/... Validated, inspected, and cleaned directly
Classic Subdomain https://maps.google.com/... Normalized to www.google.com/maps and cleaned

Unsupported domains, deceptive lookalikes (e.g., google.com.example.org), non-Maps Google services (e.g., google.com/search, goo.gl/forms), embedded credentials, non-443 ports, and non-HTTPS schemes are rejected.


Security Model & Known Limitations

Security Controls

  1. Strict Hostname Allowlisting: Only maps.app.goo.gl, goo.gl/maps/..., google.com/maps/..., www.google.com/maps/..., and maps.google.com are accepted. Punycode/IDN homographs and IP literals are rejected.
  2. HTTPS-Only Outbound Requests: Non-HTTPS inputs and HTTP redirect downgrades are rejected.
  3. DNS Rebinding & Private IP Blocking: Before connecting, resolveAndVerifyPublicIps verifies every A/AAAA record is a public, routable IP (blocking loopback, RFC1918, CGNAT 100.64.0.0/10, link-local/cloud metadata 169.254.169.254, ULA, multicast, and IPv4-mapped IPv6) and pins the socket directly to the verified IP.
  4. Hop, Time, and Size Caps: Maximum 8 redirect hops, 8-second request timeout, 256 KB upstream response limit, and 4 KB JSON request body limit.
  5. Zero Link Persistence & Cookieless Analytics: Submitted URLs are never stored in a database or logged by the application; API errors never expose stack traces. MapFix uses no advertising trackers, cross-site tracking, or marketing cookies, and relies solely on cookieless Vercel Web Analytics (@vercel/analytics/next) for aggregate page-view measurement.
  6. Rate Limiting (Serverless Caveat): /api/fix applies a sliding-window in-memory IP rate limiter (20 req/min). Because Vercel executes serverless functions across ephemeral instances, this rate limiter is per active instance—it mitigates single-instance bursts without external Redis/DB dependencies, and is not globally consistent distributed rate limiting.

Known Limitations

  • Google Anti-Bot / Consent Walls: Google servers may occasionally respond to datacenter IPs with HTTP 429/403, a CAPTCHA, or a consent interstitial. MapFix reports these honestly and never fabricates a destination.
  • No Google Places API Calls: MapFix verifies URL structure and identifiers (ChIJ..., ftid, coordinates), not real-world business existence or opening hours.
  • Apple Maps Conversion Boundaries: Google Place IDs (ChIJ...) and Feature IDs (ftid) are not interchangeable with Apple Place IDs. Apple Maps URLs are generated only when usable coordinates, place names, addresses, search queries, or routes are present, and Apple Maps may resolve a business or search differently from Google Maps.
  • Plus Code Precision: Global Open Location Codes are computed locally from verified destination coordinates (never viewport-only /@lat,lng camera centers) and cannot exceed the precision present in the source URL.

See SECURITY.md for vulnerability reporting instructions.


Local Development

Prerequisites

  • Node.js >= 20.0.0
  • pnpm (corepack enable or npm install -g pnpm)

Setup

git clone https://github.com/php369/GoogleMaps-LinkFixer.git
cd GoogleMaps-LinkFixer
pnpm install
cp .env.example .env.local
pnpm dev

Open http://localhost:3000.

Verification Scripts

pnpm lint         # ESLint check
pnpm typecheck    # TypeScript strict check (tsc --noEmit)
pnpm test         # Deterministic unit tests with mocked network responses
pnpm build        # Next.js production build (next build --webpack)

Optional live integration check against real Google Maps short links (excluded from CI):

pnpm test:integration

Environment Variables

See .env.example:

Variable Required Default Description
NEXT_PUBLIC_SITE_URL No https://google-maps-link-fixer.vercel.app Canonical base URL for metadata, canonical tags, sitemap.xml, robots.txt, and JSON-LD.
NEXT_PUBLIC_GOOGLE_SITE_VERIFICATION No — Google Search Console HTML meta verification token (value of content="...").

API Documentation

POST /api/fix

Headers: Content-Type: application/json

Request:

{
  "url": "https://maps.app.goo.gl/example"
}

Success (200 OK):

{
  "success": true,
  "classification": "VALID_SHORT_MAPS_URL",
  "resolutionKind": "resolved",
  "originalUrl": "https://maps.app.goo.gl/example",
  "resolvedUrl": "https://www.google.com/maps/place/...",
  "directUrl": "https://www.google.com/maps/place/...",
  "destinationType": "place",
  "verificationStatus": "verified",
  "placeVerificationNote": "Destination identifiers extracted from URL. Real-world place existence is not checked against the Google Places API.",
  "extracted": {
    "type": "place",
    "verificationStatus": "verified",
    "coordinates": {
      "lat": 37.8199286,
      "lng": -122.4782551,
      "latText": "37.8199286",
      "lngText": "-122.4782551",
      "source": "data_pin"
    },
    "placeName": "Golden Gate Bridge",
    "strippedTrackingParams": ["entry", "g_ep"]
  },
  "appleMaps": {
    "supported": true,
    "url": "https://maps.apple.com/place?coordinate=37.8199286%2C-122.4782551&name=Golden%20Gate%20Bridge",
    "kind": "place",
    "note": "Uses extracted coordinates and name; Apple Maps may display a different listing or presentation than Google Maps."
  },
  "plusCode": {
    "supported": true,
    "code": "849VRG9C+XM9",
    "codeLength": 11,
    "areaDescription": "~2.8 × 3.5 m grid area",
    "note": "Encodes the supplied coordinates (~2.8 × 3.5 m grid area at equator)—not a verified business or building."
  },
  "redirectCount": 1
}

Failure (4xx / 5xx):

{
  "success": false,
  "classification": "UNRESOLVABLE_SHORT_LINK",
  "error": {
    "code": "GOOGLE_ACCESS_DENIED",
    "message": "Google Maps did not allow this automated request. Try again later or share the full location URL.",
    "suggestion": "Open the link on your device if possible, or open Google Maps and copy the full address bar URL or use Share > Copy link."
  }
}

Error Codes: INVALID_URL, UNSUPPORTED_DOMAIN, NOT_A_MAPS_URL, SHORT_LINK_NOT_FOUND, GOOGLE_ACCESS_DENIED, REDIRECT_SECURITY_REJECTED, REDIRECT_LOOP, TOO_MANY_REDIRECTS, TIMEOUT, DESTINATION_UNVERIFIED, RATE_LIMITED, UNEXPECTED_RESPONSE, PAYLOAD_TOO_LARGE, RESOLUTION_FAILED.


Google Search Console & Vercel Setup

  1. Add URL-prefix property in Google Search Console for https://google-maps-link-fixer.vercel.app/.
  2. Obtain the HTML meta verification token from Search Console (copy only the content="..." value).
  3. Configure the token in Vercel → Project Settings → Environment Variables (NEXT_PUBLIC_GOOGLE_SITE_VERIFICATION, Type: Config) alongside NEXT_PUBLIC_SITE_URL=https://google-maps-link-fixer.vercel.app.
  4. Deploy / Redeploy the application so the verification <meta name="google-site-verification" ...> tag renders in server-generated HTML.
  5. Verify ownership in Google Search Console.
  6. Submit the sitemap: https://google-maps-link-fixer.vercel.app/sitemap.xml.
  7. Use URL Inspection in Search Console to monitor individual canonical pages (/, /about, /how-to-fix-google-maps-links, /why-google-maps-links-are-not-opening, /how-to-share-direct-google-maps-links, /privacy, /terms).

GitHub Repository Topics

google-maps, google-maps-link-fixer, google-maps-links, maps-app-goo-gl, apple-maps, plus-codes, open-location-code, url-converter, url-resolver, nextjs, typescript, open-source, utility


Contributing

Contributions are welcome! Please read CONTRIBUTING.md before opening a pull request.

License

Released under the MIT License.

About

MapFix - Independent open-source Google Maps short link fixer that creates direct Google Maps URLs, Apple Maps alternatives, coordinates & Plus Codes.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages