showing specific state of a country on gmap highli

2020-04-23 07:37发布

问题:

I wants to show specific state of a country as highlighted and remaining area in shadow.

I wants to implement like http://www.redfin.com/homes-for-sale#!disp_mode=M&lat=29.770534985365693&long=-95.21904093471284&market=houston&sf=1,2&v=8&zoomLevel=8

I had searched about this and what I understand that, I needs to use overlay for that.

I have one question,

Would I needs to provide lat and lng for borders or it can be achieved by providing some parameter like state code etc.

Any example of showing shadow and highlighted area will be great help.

回答1:

Would I needs to provide lat and lng for borders

You need access to the to the coordinates of the borders, then make them a hole in a polygon that covers the world (or at least the area of interest).

There are options:

  • kml with an inverted polygon

  • import the inverted kml into a FusionTable and display that on a map (doesn't seem to be working anymore)