Функция setAttribute

Mapserver, GeoServer, MapGuide, Google и другое ПО для веб-картографии
Ответить
eternal
Интересующийся
Сообщения: 26
Зарегистрирован: 26 июл 2010, 17:45
Репутация: 0

Функция setAttribute

Сообщение eternal »

Как пользоваться функцией setAttributeNS:
OpenLayers.Format.KML.prototype.setAttributeNS= OpenLayers.Format.OSM.prototype.setAttributeNS= OpenLayers.Format.XML.prototype.setAttributeNS= function(node,uri,name,value)

Adds a new attribute or changes the value of an attribute with the given namespace and name.
Parameters
node {Element} Element node on which to set the attribute.
uri {String} Namespace URI for the attribute.
name {String} Qualified name (prefix:localname) for the attribute.
value {String} Attribute value.

или getAttributeNS:
getAttributeNS: function(node,uri,name)

Get an attribute value given the namespace URI and local name.
Parameters
node {Element} Node on which to search for an attribute.
uri {String} Namespace URI.
name {String} Local name of the attribute (without the prefix).

Returns {String} An attribute value or and empty string if none found.

наверное должно выглядеть так:

Код: Выделить всё

  function setAttribute(value){
	   new OpenLayers.Format.XML.prototype.setAttributeNS(
                   node,
                   uri, 
                   name,
                   value
           )}
как определить node, я так понимаю это узел в xml или объект на карте для которого меняется атрибут
Ответить

Вернуться в «Веб-картография»

Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей и 3 гостя