This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Themabewertung:
  • 0 Bewertung(en) - 0 im Durchschnitt
  • 1
  • 2
  • 3
  • 4
  • 5
Ändern von Objekt-Eigenschaften
#1
Hallo,
ich habe mir ein paar Skripte als Vorlage geholt und bin nun dabei sie mir auf meine Bedürfnisse anzupassen. Leider fehlen an der ein oder anderen Stelle ein paar Basics.

Ich versuche nun auf ein bestimmtes Objekt zuzugreifen, um die Farbe zu ändern:

const Raeume = {
  type: 'FeatureCollection',
  features: [{
    type: 'Feature',
    properties: {
      name: 'Wohnzimmer',
      color: '#DBECFF',
    },
   
  },

usw.

Über die folgende Funktion kann ich die Farbe ändern:
object.applySettings({ color: '#FFEB8C' });


Aber wie finde ich 'object', wenn ich nur den Namen des Objekts habe?
Das klappt nicht:
Raeume('Wohnzimmer').applySettings({ color: '#FFEB8C' });


Danke und Gruß,
Kevin
Zitieren


Gehe zu:


Benutzer, die gerade dieses Thema anschauen: 1 Gast/Gäste