
When creating a map, you have a lot of customization options on the administration panel, including: background color, border color and width, inactive regions color, markers size and color and the active regions color. These are the options that the Google Geochart API provides. However, advanced users will be able to extend this customization features.
If you have some knowledge of CSS, you will be able to customize the maps even further, creating css rules for the maps you created.
You will have to place the CSS rules in your theme CSS, or embed them on the post or page where your map will show.
For each of the examples here, you should take in consideration that you should change the #map_canvas_ID for your map ID.
Country borders color and mouse cursor
#map_canvas_21 path {
stroke-width:1; /* control the countries borders width */
stroke:#6699cc; /* choose a color for the border */
cursor:pointer; /* display the pointer when the map hovers the map. */
}
Hover effect
The hover effect is created with a class and an advanced selector that creates a rule to fill with the color red the regions that are NOT colored #f5f5f5, the color that was chosen for the inactive regions.
#map_canvas_14 path:not([fill^="#f5f5f5"]):hover {
fill:red;
}
Marker with point cursor and different hover effects
#map_canvas_26 circle {
stroke-width:0; /* control the countries borders width */
cursor:pointer; /* display the pointer when the map hovers the map. */
}
#map_canvas_26 circle:hover {
stroke-width:3; /* control the countries borders width */
stroke:#FFFFFF; /* control the countries borders color */
cursor:pointer; /* display the pointer when the map hovers the map. */
fill:#6699cc; /* control the fill color of the marker */
}
Changing the default crop
[More detailed information about this technique here]
The default area that the plugin displays for some countries is very wide sometimes. We can change this by playing around with some values:
#map_canvas {
overflow:hidden;
width:350px;
}
#map_canvas #map_canvas_47 {
margin-left:-110px;
}
You can play around with values and with the size of the map to achieve what you need.
Background Fill in Markers Mode
#map_canvas_18 path:nth-child(111) {
fill:#cccccc;
}
This is a bit tricky to achieve. The theory is that you find the number of the shape of the region you want to color and use it with this advanced CSS selector.
#map_canvas_44 path:nth-child(232),
#map_canvas_44 path:nth-child(234),
#map_canvas_44 path:nth-child(235),
#map_canvas_44 path:nth-child(236) {
fill:#CCCCCC;
}
In the future I will try to document this trick a bit further, having a table of matching numbers for each state and countries that I’ve found out.
I use the firefox/chrome extension ‘Firebug‘ to find out the number. Check this image below with some instructions.
Advanced Italy Example with multiple techniques




37 Responses to “Advanced Customization”
Is there a way I can zoom closer in on an area vs. a state wide view? Example can zoom in on St Paul, MN?
Thanks
Steve
Hello Steve. There are only map with borders of the states and metropolitan areas, there are no maps that will display the border, for example, of St Paul, MN. You could with some tricks some in the area, but since no borders would appear, it wouldn’t make much sense. Maybe in a future version, but unfortunately now it’s not possible.
Just wanted to say thanks for a great plugin Carlos.
I’ve noticed that if two points are in the same city, sometimes one doesn’t show up.
Is there a modification that would allow the markers to be pins instead of dots?
Thank you for the positive feedback Jerry!
When two markers are in the same place, one overlaps the other, so sometimes one might not show. However, the ‘magnifying glass’ effect when 2 markers are very close sometimes solves this issue, by zooming in and show them apart, but I guess when they have the same values, they will overlap anyway. The only solution would be to separate them a bit more in terms of region code.
Unfortunately there is no modification possible to have pins instead of the round markers. This is because the google geochart api, that is used to generate the maps, only allows this round markers.
Hello!
Is there anyway I can zoom in on individual regions? I’m doing a guide to Spain and would like to display region by region maps.
Keep up the good work,
Rob
Hello Rob
By default the plugin only has that option for the US States. For Spain, there is no option to display individual regions. The only way is to use the ‘change default crop’ with CSS, and crop to display individual regions, but I don’t recommend it, as it’s not a perfect solution for what you’re trying to achieve. I’m sorry for this limitation. Greetings
Carlos
Hi ,
Is it possible the get more info in tooltips and an image? or images and text?
And if correct , How?
I cannot find instuction about the action value either
Tom
of course instruction
Hello!
The current version doesn’t allow HTML content in the tooltip unfortunately. Maybe in a future version. So it’s only possible to add the 2 lines of text.
What you can do is put a long info in the action value, and display it choosing the active region action ‘display information below the map’ (or above) and this way you can put HTML content there.
Hope the information helps!
Greetings
Carlos
Thanks,
Paramater for the action.
Ex. Url for Open Url Action.
Simple HTML can be used.
What I want is that I can open another page (url), using the action value? can you provide me the code?
Regards,
Tom
In your examples, there is a map, Where there is an ‘onclick to wikipedia’. That’s what’s the code I need. I try serveral on-clicks commands, but they didn’t work
I’m in a hurry, so please …Mnore information ‘how to’ would be very much appreciated
****Solved****
I didn’t see the action region pull down menu…:-( to get it done….
Sorry for the late reply. Just answered you also on codecanyon. Here’s a reference link to anyone with the same question. Sorry for the late reply. Greetings. http://img42.imageshack.us/img42/77/europelinks.png
How would one go about styling the tooltip boxes. For instance in the example, ‘Advanced Italy Example with multiple techniques,’ how would one get the ‘Pisa’ tooltip (white box) to float to the right and have a different background colour?
Thanks!
Awesome plugin!! Is there a way to allow countries on multiple continents to be activated at the same time? For instance, I would like to highlight countries in both Africa and Spain.
Thx in advance!
Thank you for the feedback James!
In the current version of the Google Geochart API, which the plugin uses to generate the maps, it’s only possible to do that if you chose to display the World Map. If you are displaying the world map you can color countries from everywhere. And if you need to show only a portion of the world, you can use the ‘change default crop’ technique to hide the rest.
Greetings
Carlos
Thx for the quick response! Where would I apply this code? Would it be applied within the page editor or within the css on the backend?
The code would need to be applied to your theme CSS. Note that this (changing the default crop) is an extended customization of the maps, and it’s not part of the supported features of the plugin. This is something that you can do extra, and might not work perfectly, but anyway I made this page to help people extend the customization options for the visual of the maps.
If you need any help you can also send me a message using the contact form. Cheers!
Hello and thank you for this fantastic plugin!
I would like to know if are you able to explain me how to make a div with a list of the cities that are in the country, and when the mouse is hover a city name, the map highlight that city.
Any help is apreciated!
Thanks!
Hello John!
I can’t think of an easy way to achieve this unfortunately. I would have to dig in the geochart API to see if there are any options for this, but I don’t think so. I’ve never done it, it would probably require some jquery to target the generated map shapes to highlight them and other actions. Although it’s not impossible, I don’t have an easy solution for what you’re trying to do. Sorry for this. Greetings
Carlos
Greetings,
I am sure you cannot possibly code all the countries in the world but I wanted to know if you had already done Costa Rica as a stand alone? There are 5 provinces in the country and within each about 1-3 cantons and in each canton 10-20 cities.
I would be very interested in working something out to get this done a la carte.
Thanks
PS: Want to catch you before holiday
Hi Tico! Just replied to your email. You caught me before my early flight
There’s a map of Costa Rica included, divided by 7 regions actually: http://en.wikipedia.org/wiki/ISO_3166-2:CR
Cheers
Carlos
Hi,
Is it possible with your plugin to roll over an area and have a predefined zoomed in area pop up, for example North America on a world map, or a specific state on a US map, and then have active areas on that popup?
Thanks!
Hello Tim! Thank you for the question. Unfortunately it’s not possible to create interactivity as you describe. The closest thing you can do, is for example, display the world map, and create a link on the US to a page were there would be a map of the US only and then create a link for each state to a page with the map of that state (this last step is only possible with US states). If you have any other question let me know.
Thanks for the reply Carlos. Waiting to hear back from my client, then I can buy your cool plugin!
Cheers,
Tim
Hi Carlos
Is there a facility to put counties in for the UK. You have countries ie England, Scotland, Wales and Ireland but I need counties or even regions.
what do you need to create a more detailed map. If I use the co-ordinates my top tips will overlap really closely.
Amanda
Hello Amanda!
Unfortunately, since the maps are loaded from the google geochart API, it depends on them to have the UK counties map available. I’ve read that they are working on this, but I have no date for when they will be available. When they are, I’ll make sure to include them on my plugin also. I’m sorry for this limitation. Greetings
Carlos
Hi Carlos,
I need to make display the text of popup message inside a div. Is it possible?
Thanks in advance.
Alessio
Hello Alessio! I am not sure I understood what you mean. If you want that with the hover action only (not click) information displays on a div, this is not possible. If you want to display information when the user clicks, that’s possible. This link should help: http://cmoreira.net/interactive-world-maps-demo/world-offices-map-information-display/ If you have any other question let me know. Greetings
Just purchase this. Is it possible to have an icon instead of hex colors.
Hello Anthony. Unfortunately no, it’s not possible to have custom icons instead of the round colored markers. This is a limitation of the google geochart API, that currently only allows this option. I’m sorry for this limitation.
Boa noite Carlos,
Tenho o site me desenvolvimento. (se pretender ver , tenho que lhe dar acesso)
No entanto tenho duas questões para lhe colocar.
1ª A questão, de fazer zoom sobre Portugal. Segui os seus conselhos, criei em administador uma área enorme (3500*2500), depois fiz crop (800*600), ajustando com o CSS que indicou.
Problema a resolver: Tenho várias cidades juntas, que por consequência cria aquela “lente”, para poder selecionar a cidade desejada. Só que a lente é tão grande, que deixo de ver as cidades. Existe algum forma por CSS, de reduzir o tamanho da lente ?
2ª Se criar dois mapas, e colocar esses mapas na página selecionada, exemplo, [show-map id='1'] e [show-map id='2'],como é que crio uma zona mista de visualização ?Para o mapa 1 , coloco esta texto, mapa 2 , texto. Posso juntar estas duas áreas de informação ? Se tiver as áreas de visualização separadas, assim que seleciono o outro mapa, a outra informação do mapa anteriormente selecionado mantém-se visivel. Não fica bem, deveria desaparecer.
Obrigado,
Cumprimentos,
Mário
Olá Mário. Espreitei o link que deixou no campo URL e no link /lojas o mapa está lá, presumo que seja aí que pretende implementar os 2 mapas correcto?
Infelizmente, não tenho uma solução simples para o problema da ‘lupa’. O que podemos fazer é desactiva-la com uma linha de código extra nas opções do mapa (magnifyingGlass:{enable: false, zoomFactor: 5.0}). Pode enviar-me uma mensagem via formulário de contacto do codecanyon que posso dar-lhe indicações mais precisas de onde aplicar o código.
Sobre a segunda questão, se percebi bem, quer ter o campo de informação comum para 2 mapas, correcto? Para tal terá de criar uma ‘custom action’ para os 2 mapas, com uma acção comum, em que ambos os mapas apresentam a informação na mesma DIV. Espreite este exemplo: http://cmoreira.net/interactive-world-maps-demo/world-offices-map-information-display/ No fundo basta que um dos mapas tenha a ‘custom action’ e que a DIV alvo seja a mesma que o outro mapa.
Se precisar de informações mais específicas não hesite em contactar-me.
Cumprimentos,
Carlos
Carlos,
O site , http://codecanyon.net/, não consigo aceder de momento.
A compra foi em paypal, Purchase item Interactive World Maps from user cmoreira on CodeCanyon, invoice 5452331.
Neste momento tenho uma mapa ibérico, mas queria separar para portugal e espanha.
Onde posso alterar o, magnifyingGlass:{enable: false, zoomFactor: 5.0} ? se corrigir o factor para 2.0 ou 3.0, pode ser que resolva o problema. Onde faço ? na CSS do thema template? Como ? (código)
A segunda questão é, tenho 2 tabuladores, com região mapa A e região mapa B. E clicando nas cidades A ou B, a informação fica disponivel na mesma área comum de visualização. O problema com que me deparo é, se mudar de tabulador de A para B, e clicar na cidade de B, a informação de A mantém-se, para além de aparecer a informação de B. Com a mesma área de informação, obrigaria a “limpar” a cidade de A, para aparecer só a informação da cidade B.
Obrigado,
Mário
Sim, de facto o site codecanyon está em baixo neste momento. Mas escrevi-lhe para o email.
Cumprimentos,
Carlos
A lot of problems I faced in this Plugin:
1- It doesn’t have the occupied Palestinian territories
2- Their is no MENA region (North Africa and Middle East) in one map
3- It splits Morocco to (Morocco and Western Sahara) which is totally wrong, according to the UN they still one country.
Thanks
Hello! Yes, what you describe is true unfortunately, and I can’t solve this particular issues. The maps are loaded from the Google Geochart API, that follow this UN Statistical Geo Divisions Classifications – http://unstats.un.org/unsd/methods/m49/m49regin.htm (that doesn’t include MENA and divides Morocco and WS). Unfortunately it’s out of my reach to solve the issues you describe. I’m sorry for this limitation. Greetings, Carlos