3

I am looking for a static maps API (similar to https://www.mapbox.com/developers/api/static/ ) that can serve the map without an underlying base layer. My intention is to generate images with the roads/labels layer on top of a custom base layer. Does such a thing exist? If not, what can I use to create it?

4
3
+25

Using the Google Static Maps API

Try:

http://maps.googleapis.com/maps/api/staticmap?center=london&size=1080x720&sensor=false&zoom=15&maptype=road&style=feature%3Awater|element%3Ageometry|color%3A0xffffff|lightness%3A17|&style=feature%3Alandscape|element%3Ageometry|color%3A0xf5f5f5|lightness%3A20|&style=feature%3Aroad.highway|element%3Ageometry.fill|color%3A0xffffff|lightness%3A17|&style=feature%3Aroad.highway|element%3Ageometry.stroke|color%3A0xffffff|lightness%3A29|weight%3A0.2|&style=feature%3Aroad.arterial|element%3Ageometry|color%3A0xffffff|lightness%3A18|&style=feature%3Aroad.local|element%3Ageometry|color%3A0xffffff|lightness%3A16|&style=feature%3Apoi|element%3Ageometry|color%3A0xf5f5f5|lightness%3A21|&style=feature%3Apoi.park|element%3Ageometry|color%3A0xffffff|lightness%3A21|&style=feature%3Aall|element%3Alabels.text.stroke|visibility%3Aon|color%3A0xffffff|lightness%3A16|&style=feature%3Aall|element%3Alabels.text.fill|saturation%3A36|color%3A0x333333|lightness%3A40|&style=feature%3Aall|element%3Alabels.icon|visibility%3Aoff|&style=feature%3Atransit|element%3Ageometry|color%3A0xffffff|lightness%3A19|&style=feature%3Aadministrative|element%3Ageometry.fill|color%3A0xffffff|lightness%3A20|&style=feature%3Aadministrative|element%3Ageometry.stroke|color%3A0xffffff|lightness%3A17|weight%3A1.2|

Then use the z-index method to overlay you image (with transparency) example http://www.corelangs.com/css/box/ontop.html

Mock up Example: (needs refining) http://jsfiddle.net/yUbV9/146/

2
  • Excellent, thanks. I'm just going to give it a few days for other people to reply, and then I'll mark your post as the answer (so long as no one gives another one). Would you happen to know if I can query this with a lat/lng bounding box? – Mike Furlender Dec 18 '15 at 15:56
  • I took a closer look at this and realized that its not actually transparent at all. If I was to overlay this on top of my data (which is essentially a heatmap over the united states), the white in that static map would lighten the result image. What I want is to be able to place roads and labels over my basemap without distorting the basemap or lightening it. – Mike Furlender Dec 18 '15 at 16:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.