IEEE.org
|
IEEE Xplore Digital Library
|
IEEE Standards
|
IEEE Spectrum
|
More Sites
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Open at RIT
My Conservation Life
Conservation360
Commits
23a8fadf
Commit
23a8fadf
authored
Apr 07, 2020
by
jedjas12
Browse files
Variable name changes
parent
43c89b55
Changes
1
Hide whitespace changes
Inline
Side-by-side
salesforce/my-conservation-life/force-app/main/default/lwc/geoQuery/geoQuery.js
View file @
23a8fadf
...
...
@@ -107,20 +107,20 @@ export default class GeoQuery extends LightningElement {
// Iterate over the assets and add them to the map
let
assetIndex
;
for
(
assetIndex
=
0
;
assetIndex
<
response
.
length
;
assetIndex
++
)
{
const
a
=
response
[
assetIndex
];
const
a
ssetResponse
=
response
[
assetIndex
];
// Create the map marker, asset type determine the icon
let
markerIcon
;
if
(
a
.
asset_type
===
'
Tree
'
)
{
markerIcon
=
L
.
marker
(
L
.
latLng
(
a
.
lat
,
a
.
lon
),
{
icon
:
baobabIcon
}).
addTo
(
map
);
}
else
if
(
a
.
asset_type
===
'
Lemur
'
)
{
markerIcon
=
L
.
marker
(
L
.
latLng
(
a
.
lat
,
a
.
lon
),
{
icon
:
lemurIcon
}).
addTo
(
map
);
if
(
a
ssetResponse
.
asset_type
===
'
Tree
'
)
{
markerIcon
=
L
.
marker
(
L
.
latLng
(
a
ssetResponse
.
lat
,
assetResponse
.
lon
),
{
icon
:
baobabIcon
}).
addTo
(
map
);
}
else
if
(
a
ssetResponse
.
asset_type
===
'
Lemur
'
)
{
markerIcon
=
L
.
marker
(
L
.
latLng
(
a
ssetResponse
.
lat
,
assetResponse
.
lon
),
{
icon
:
lemurIcon
}).
addTo
(
map
);
}
else
{
markerIcon
=
L
.
marker
(
L
.
latLng
(
a
.
lat
,
a
.
lon
)).
addTo
(
map
);
markerIcon
=
L
.
marker
(
L
.
latLng
(
a
ssetResponse
.
lat
,
assetResponse
.
lon
)).
addTo
(
map
);
}
// Add expanded details for if a user clicks on the marker
markerIcon
.
bindPopup
(
`
${
a
.
asset_type
}
\n\r
${
a
.
project_name
}
`
);
markerIcon
.
bindPopup
(
`
${
a
ssetResponse
.
asset_type
}
\n\r
${
a
ssetResponse
.
project_name
}
`
);
// // Keep a reference to the marker so we can remove it later
this
.
myAssets
.
push
(
markerIcon
);
...
...
@@ -162,22 +162,22 @@ export default class GeoQuery extends LightningElement {
}
// Iterate over the assets and add them to the map
let
i
;
for
(
i
=
0
;
i
<
response
.
length
;
i
++
)
{
const
a
=
response
[
i
];
let
assetIndex
;
for
(
assetIndex
=
0
;
assetIndex
<
response
.
length
;
assetIndex
++
)
{
const
a
ssetResponse
=
response
[
assetIndex
];
// Create the map marker. Add back the offset so markers appear where the user clicked.
let
markerIcon
;
if
(
a
.
asset_type
===
'
Tree
'
)
{
markerIcon
=
L
.
marker
(
L
.
latLng
(
a
.
lat
,
a
.
lon
),
{
icon
:
baobabIcon
}).
addTo
(
map
);
}
else
if
(
a
.
asset_type
===
'
Lemur
'
)
{
markerIcon
=
L
.
marker
(
L
.
latLng
(
a
.
lat
,
a
.
lon
),
{
icon
:
lemurIcon
}).
addTo
(
map
);
if
(
a
ssetResponse
.
asset_type
===
'
Tree
'
)
{
markerIcon
=
L
.
marker
(
L
.
latLng
(
a
ssetResponse
.
lat
,
assetResponse
.
lon
),
{
icon
:
baobabIcon
}).
addTo
(
map
);
}
else
if
(
a
ssetResponse
.
asset_type
===
'
Lemur
'
)
{
markerIcon
=
L
.
marker
(
L
.
latLng
(
a
ssetResponse
.
lat
,
assetResponse
.
lon
),
{
icon
:
lemurIcon
}).
addTo
(
map
);
}
else
{
markerIcon
=
L
.
marker
(
L
.
latLng
(
a
.
lat
,
a
.
lon
)).
addTo
(
map
);
markerIcon
=
L
.
marker
(
L
.
latLng
(
a
ssetResponse
.
lat
,
assetResponse
.
lon
)).
addTo
(
map
);
}
// Add expanded details for if a user clicks on the marker
markerIcon
.
bindPopup
(
`
${
a
.
asset_type
}
\n\r
${
a
.
project_name
}
`
);
markerIcon
.
bindPopup
(
`
${
a
ssetResponse
.
asset_type
}
\n\r
${
a
ssetResponse
.
project_name
}
`
);
// Keep a reference to the marker so we can remove it later
this
.
myAssets
.
push
(
markerIcon
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment