I'm experimenting with Google's GeoCharts. I have state data and city data that I want to display over the city data. This means I want to use the geochart regions
and markers
display mode at the same time. Can this be done, or faked? I can't seem to find a way but was wondering if anyone else has had success.
问题:
回答1:
As stated in documentation mode
parameter could be region
or marker
. So they could not be used together. I would recommend you to try jVectorMap library which supports such kind of behavior.
回答2:
with some CSS hacking you can use the markers mode and color the region you want. It's not easy, you would have to know wich 'child' path of the svg map you want to color and make advanced css rules.
For example:
#map_canvas path:nth-child(57) {
fill:#cccccc;
}
Check out the last example of this page, from my website: http://cmoreira.net/interactive-world-maps-demo/advanced-customization/
Hope it helps! Cheers
回答3:
VectorWorkz GeoChart lets you define region color binding and marker binding within the same instance, take a look at the VectorWorkz online demo.
回答4:
I could do it by overlapping two charts one for region, one for markers (using absolute divs with z-index)
you need to use transparent color as style for the marker layer backgroundColor: 'transparent', datalessRegionColor: 'transparent', defaultColor: 'transparent' and put it on the top layer
回答5:
or maybe put one chart with type "marker" over another of type "region" ? :)