Ben
Ben

Reputation: 3025

Google Geocharts: Regions and Markers on same map?

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.

Upvotes: 8

Views: 13587

Answers (5)

Christophe Ponsard
Christophe Ponsard

Reputation: 11

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

Upvotes: 1

Karthi Keyan
Karthi Keyan

Reputation: 4393

VectorWorkz GeoChart lets you define region color binding and marker binding within the same instance, take a look at the VectorWorkz online demo.

Upvotes: 0

Michal - wereda-net
Michal - wereda-net

Reputation: 959

or maybe put one chart with type "marker" over another of type "region" ? :)

Upvotes: -1

bjornd
bjornd

Reputation: 22943

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.

Upvotes: 6

CMoreira
CMoreira

Reputation: 1708

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

Upvotes: 3

Related Questions