javascript - js google earth placemarks -


I have lost so much. I am trying to understand how to put placemarks in a global variable.

We have the following code:

  // placemark var placemark = earth.createPlacemark (""); Placemark.setName (PASSENGERS [i] .name + "to" + PASSENGERS [I] House); // create icon var icon = earth.createIcon (""); Icon.setHref (url + "/ img /" + passenger [ii] .use + + ".jpg"); // style style style = earth.createStyle (""); Style.getIconStyle () setIcon (icon) Style.getIconStyle () setScale (4.0). // Stylemap Prepare More Style map = earth.createStyleMap (""); StyleMap.setNormalStyle (style); StyleMap.setHighlightStyle (style); // collaborative stylemap with Placemark placemark.setStyleSelector (styleMap); // Ready point var point = earth.createPoint (""); Point.setAltitudeMode (earth.ALTITUDE_RELATIVE_TO_GROUND); Point.setLatitude (building.lat); Point.setLongitude (building.lng); Point.setAltitude (0.0); // Associate Placemark with Point Placemark. Set gemetry (point);   

We have a global variable name that passenger

so I tried passors [i]. Placemark = placemark; But I only get a null object. I've tried the console.lad (placemark), but then I got a blank object.

Is placemark an object? If this happens then I can not get any data, if it is not, then what is it? Very upset. Google API documentation is difficult to follow

What placemark is a function? But then why declare it as a var if it is a function, how can I put it in PASSENGERS.

Try

  var placemark = earth.createPlacemark (PassseNGERS [ I] .id);   

Since then, you can refer to the placemark using this

  var referencedPlacemark = earth.getElementById (ID);   

The ID must be unique

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -