Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #23422

Re: undefined property, is not defined, is undefined - calling a value

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From Cornelius Lange <coni@javas.invalid>
Newsgroups comp.lang.javascript
Subject Re: undefined property, is not defined, is undefined - calling a value
Date Wed, 05 Mar 2014 19:08:23 +0100
Organization A noiseless patient Spider
Lines 68
Message-ID <lf7p6o$2mk$1@dont-email.me> (permalink)
References <lf7602$4r8$1@dont-email.me> <53172567$0$6656$9b4e6d93@newsspool2.arcor-online.net>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding 7bit
Injection-Date Wed, 5 Mar 2014 18:08:24 +0000 (UTC)
Injection-Info mx05.eternal-september.org; posting-host="899544f221f4416bd5dad285a182947d"; logging-data="2772"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/mi/AL18ZNwWcWgaxNVZS4"
User-Agent Mozilla/5.0 (Windows NT 5.1; rv:14.0) Gecko/20120713 Thunderbird/14.0
In-Reply-To <53172567$0$6656$9b4e6d93@newsspool2.arcor-online.net>
Cancel-Lock sha1:G5BPL1HOmAoJ1BXJdl5oGfq1CuE=
Xref csiph.com comp.lang.javascript:23422

Show key headers only | View raw


Am 05.03.2014 14:23, schrieb Christian Winter:
> Am 05.03.2014 13:40, schrieb Cornelius Lange:
>> hey,
>>
>> does someone give a helping hand to find my blind spot -
>> in trying to call the value from "plaqueid"? (10516):
>>
>> the (shortend) datastructure is:
>> ----------------------------------
>> (
>> {
>> _layers:{
>> 106:{
> [...snip...]
>> this datastructure was given by console.log(layers);
>> - from following "calling-place":
>>
>> the calling code from example3.js
>> ----------------------------------
>> function init() { ...
>>   map.on('draw:edited', function (e) {
>>      var layers = e.layers;
>>           alert(options.feature.plaqueid);    // here calling
>>      layers.eachLayer(function(layer) {    });    });
>> ... }
>> ----------------------------------
>> (shortend too)
>>
>> I don't get further into the datastructur than "layers[106]" - by trying
>> e.g. with
>>
>> # console.log(layers); // ok, shown all.
>> # console.log(layers[106]); // ...undefined property layers[106] @ ...
> [....snip...]
>> Where might be here the crux for me, to get this value?
>> What I've to see?
>
> If you're really dumping "layers" and get the structure above
> (shortened):
>     { _layers: { 106: {...} } }
> then you're not looking deep enough.
may be - yes: I'm still "spelling" Javascript ...



> layers._layers[106] would be the way to go. Might be that your
> layers object has accessors for the individual layers, guessing from
> the usually "pseudo-private" underscore notation, and should be written
> as something like layers.getLayer(106) (or whatever accessor syntax
> it has, though if I'm guessing right and you're working with Leaflet,
yes. Just "mess around" with the "draw:edited"-feature, for trying to 
save stuff into the table.



> this is the way to go).
Thanx a lot!!
both is working and gives the id:
layers._layers[106].feature.properties.plaqueid
layers.getLayer(106).feature.properties.plaqueid



>
> -Chris


Coni

Back to comp.lang.javascript | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

undefined property, is not defined, is undefined - calling a value Cornelius Lange <coni@javas.invalid> - 2014-03-05 13:40 +0100
  Re: undefined property, is not defined, is undefined - calling a value Christian Winter <thepoet_nospam@arcor.de> - 2014-03-05 14:23 +0100
    Re: undefined property, is not defined, is undefined - calling a value Cornelius Lange <coni@javas.invalid> - 2014-03-05 19:08 +0100

csiph-web