How can I create a pin map for free/low cost?

Hey everyone, I need some advice. I’m working for a company, and I got the task of creating a pin map using the Google Maps API. The map covers the US, has about 2,000 markers for different locations, and also includes GeoJSON polygons for state boundaries to show political leanings.

Here’s the kicker: I was given this project with barely any knowledge of Google Cloud, and honestly, I don’t think my team really knew much about it either. The map works now, but it blew through the entire $300 free trial credit overnight! At this rate, keeping the map up will cost $300 a day, which is obviously way too expensive.

So, I’m hoping to either find a way to make this map for free or at least significantly lower the daily cost. Any ideas or tips? Appreciate any help!

6 Likes

Hey! If you’re looking to cut costs, I’d recommend using Leaflet.js. It’s an open-source JavaScript library for interactive maps, and it’s lightweight too. You can host the map data yourself, which should help bring your cost down to almost nothing, especially if you pair it with free base maps from sources like OpenStreetMap. Just make sure your server can handle the traffic, though!

5 Likes

If Google Maps is too expensive, you might want to check out Mapbox or OpenLayers. Mapbox gives you a lot of customization and is way cheaper than Google. OpenLayers is another open-source option like Leaflet but has more features for handling complex geospatial data like your polygons.

5 Likes

One thing that could save you some money is hosting the GeoJSON data yourself instead of relying on Google’s API. That’s one way to reduce the API requests. You can store it on your own server or use a service like GitHub Pages or Netlify for free hosting if you don’t expect too much traffic.

4 Likes

Wow, 2,000 markers can add up quickly! You might want to look into marker clustering. It helps to group nearby markers together so that you don’t have 2,000 individual markers loading at once. It improves both performance and cost efficiency.

3 Likes

Another trick is hosting your own map tiles. Instead of using Google’s tiles, you can generate and serve them yourself, or use services like MapTiler or TileServer. It’s more work upfront, but you’ll save a ton on API calls, especially for maps that don’t change frequently.

2 Likes

Are you caching the map data at all? If not, consider doing that! Every time the map is loaded, it’s probably making new API requests. You can save costs by caching the responses for a period of time (hours/days depending on how real-time your data needs to be).

1 Like