Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Maps Javascript API fill color of buildings

I am aware my question is very similar to Google map building style

However, the solution provided there doesn't seem to achieve my goal.

I am trying to use a custom map style to change the fill color of buildings. When I set landscape.man_made with geometry.fill it sets that color for the landscape of all urban areas and when I set geometry.stroke it sets that color for building outlines.

My question is can I specifically set the fill color for buildings only and if so can you provide a simple code sample of what the JSON would look like?

EDIT

It seems as though this may not be possible by default. Does anyone know if there is a way then to retrieve the geometry of a featureType? I will be doing my own looking but my idea is if that data can be gotten, then custom shapes could be drawn on the map corresponding to the outlines (landscape.man_made -> geometry.stroke) with the desired fill color. If I find anything I will update here, but it anyone already knows how to retrieve the information it would be helpful.

like image 784
FatalKeystroke Avatar asked Aug 31 '16 13:08

FatalKeystroke


People also ask

Can you color code Google Maps?

To color-code your map, just use the same method for the icons – click on the destination and when the box pops up, just click on whatever color you want to make it. You can make all restaurants blue, all shopping pink, all parks green, etc.


1 Answers

After researching further I have determined it's curently not possible to achieve my desired result with the Google Maps API.

It does seem that it's possible to retrieve individual map tiles and process them such that it replaces the default building color with a more unique one, then use that image to find building borders and their corner coordinates to dray a polygon over the map. However, this seems an extraneous amount of work and processing for such a result, especially if you want to do it to all the building on the screen as I do.

like image 74
FatalKeystroke Avatar answered Oct 06 '22 18:10

FatalKeystroke