T
T
tenaro2015-03-13 22:15:57
JavaScript
tenaro, 2015-03-13 22:15:57

google maps api. How to show only a few cities (label), hide the rest?

Suppose on the global map it is necessary to leave the names of only two cities of Moscow and Novosibirsk, how can this be done? And how to add a line of text under the name of such a city?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Neverov, 2015-03-14
@tenaro

You cannot show individual labels within the same label type (that is, you cannot show some city labels and hide others).
The solution is simple:
1. Hide all standard inscriptions.
To do this, you need to specify the styles property when creating, the code of which can be obtained through this wizard: gmaps-samples-v3.googlecode.com/svn/trunk/styledma...
2. Create layers on the map with the labels of two cities yourself, place them in the coordinates of these cities. You will have to do this through google.maps.OverlayView - other standard symbols (Market, Icon, Symbol etc) will not work for you.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question