Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум программистов > JavaScript: Общие вопросы > hide marker bu ID


Автор: sedoyksa 21.11.2011, 08:16
hi
here http://suprofitweb.ru/google/map.php i have code\map
how can i call marker for hide it?
for example: markers: [{ lat: 42.339641,
lng: -71.094224,

marker: {title: 'Boston Museum of Fine Arts',draggable:true,id:'mark',
name:'mark'},
listeners: {
click: function(e) {
var el = this.getMarkerById('mark');
el.hide=true;
mark.hide=true;
Ext.Msg.alert(Ext.getVersion().toString());

so i have only alert. cant hide marker

i need to hide marker then i click checkbox on other window
how??

i use framework 4.0.0.

this question was on sencha.com/forum. answer - there is no extJS question, only GoogleMap API

Автор: Alexblbl 21.11.2011, 15:04
For example, go over all the markers, with "for" or other, and compare their "title" to the one you want. 

Why use the ID?

If there is Title? 

Besides, i did not see when you assigning the ID to any of the markers.

Автор: sedoyksa 21.11.2011, 16:05
this is not "assigning the ID to any of the markers." ?
marker: {title: 'Boston Museum of Fine Arts',draggable:true,id:'mark',
name:'mark'},

Автор: Alexblbl 21.11.2011, 18:25
Цитата(sedoyksa @ 21.11.2011,  16:05)
this is not "assigning the ID to any of the markers." ?
marker: {title: 'Boston Museum of Fine Arts',draggable:true,id:'mark',
name:'mark'},

Ok )

You can use "for" cycle, for search any elements (markers) in your map.
 
And each element, use "getTitle()" and them compare this title with title on marker where you click: addListener('click', marker, function(){ ... }) on marker

and use the "this.setVisible(visible:boolean)"

that's all.

Автор: sedoyksa 22.11.2011, 22:56
ok
this is (by title) - i can find marker
yeap?
but can i hide it?how

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)