3

I would like to have a map on my website displaying all my stores. That worked out pretty well except for the fact the map is displaying more then just my country.
Is there a way to just show one country?

I made the map undraggable and users are not able to zoom, so the map is pretty much fixed but still, I would like to just show my country.

Is this possible with macro's? And if so, how do I create them?

EDIT:

So my country is Belgium and I would like to hide France and Germany (and if possible highlight Belgium...)

enter image description here

1
  • Not sure if leaflet + osm is an option, but you can do it with that.
    – Steven
    Jun 25, 2014 at 16:44

3 Answers 3

1

You can not do it through macro's but alternatively you can set the zoom option for the map.

Go to Gmap Setting and set the Default zoom option to your requirement.

Hope it works for you!

7
  • Yes that's what I said. The map is zoomed on my country, but my neighbouring countries are still shown... I want those to be hidden!
    – Michiel
    Feb 12, 2013 at 14:19
  • is it possible to post the map screenshot, so that it is easy to understand your requirement
    – Bala
    Feb 12, 2013 at 14:27
  • Sure! Please see my edit!
    – Michiel
    Feb 12, 2013 at 14:32
  • Do you mean put some dark layer above other countries? sounds quite fascist ;)
    – Codium
    Feb 12, 2013 at 14:40
  • 1
    other option is use Google Store Locator module drupal.org/project/google_store_locator on drupal.org. It have the features to customize the map marker pins to be your own custom icon, and you can make the map 'location aware' which allows the user to share their location with the browser, and the map will re-center and zoom based on their location.
    – Bala
    Feb 13, 2013 at 7:04
0

I don't think it's possible with Google Maps. But you can try to use Google GeoMap to render a specific country map: GeoMap.

As an example, go to this link and copy paste the code below to render a map of Belgium with only Gent and Brussels with some values.

Javascript code to put in "Edit Code" textarea, then press "Run Code":

function drawVisualization() {
      var data = google.visualization.arrayToDataTable([
        ['City', 'Popularity'],
        ['Gent', 200],
        ['Brussels', 300]
      ]);

      var options = {};
      options['region'] = 'BE';
      options['colors'] = [0xFF8747, 0xFFB581, 0xc06000]; //orange colors
      options['dataMode'] = 'markers';

      var container = document.getElementById('visualization');
      var geomap = new google.visualization.GeoMap(container);
      geomap.draw(data, options);
}

GeoMap is usually used to display charts and datas, but it could answer your needs, it's just a suggestion.

-1

Very near to what @Bala has answered you can opt the following:

  1. Use OpenLayers instead of GMap if your requirements suite and cater to it.
  2. Set zoom level for default map in OpenLayer settings.
  3. Use KML overlay for OpenLayer to highlight the country of your liking.

A sample of what you are looking for from my website: http://indiansnakes.org/content/rat-snake

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.