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
906ee7a5
Commit
906ee7a5
authored
Feb 20, 2020
by
jedjas12
Browse files
Changed zoom level
parent
4793d9e6
Changes
2
Hide whitespace changes
Inline
Side-by-side
salesforce/my-conservation-life/force-app/main/default/lwc/geoQuery/geoQuery.js
View file @
906ee7a5
...
...
@@ -82,9 +82,9 @@ export default class GeoQuery extends LightningElement {
console
.
log
(
`Map clicked at lat:
${
coord
.
lat
}
lon:
${
coord
.
lng
}
`
);
// If you zoom out far enough the world map will start to repeat accross the screan and leaflet
// will return longitudes like 190 degrees for what would technicall be -170
// will return longitudes like 190 degrees for what would technicall
y
be -170
let
mlat
=
(((
coord
.
lat
+
90
)
%
180
)
-
90
);
let
mlon
=
(((
coord
.
lng
+
180
)
%
360
)
-
180
);
//TODO
let
mlon
=
(((
coord
.
lng
+
180
)
%
360
)
-
180
);
// Remember where the user actually clicked so we can put the markers in the correct spot
let
latOff
=
Math
.
trunc
(
coord
.
lat
/
90
);
...
...
salesforce/my-conservation-life/force-app/main/default/lwc/map/map.js
View file @
906ee7a5
...
...
@@ -15,6 +15,8 @@ export default class Map extends LightningElement {
*
* When this is complete, call initializeleaflet()
*/
connectedCallback
()
{
Promise
.
all
([
loadScript
(
this
,
leaflet
+
'
/leaflet.js
'
),
...
...
@@ -29,6 +31,7 @@ export default class Map extends LightningElement {
/**
* Constructs the Leaflet map on the page and initializes this.map
*/
map
=
L
.
map
(
'
.map-root
'
,{
drawControl
:
true
}).
setView
([
18.7669
,
46.8691
])
initializeLeaflet
()
{
const
mapRoot
=
this
.
template
.
querySelector
(
'
.map-root
'
);
this
.
map
=
L
.
map
(
mapRoot
);
...
...
@@ -36,6 +39,7 @@ export default class Map extends LightningElement {
L
.
control
.
scale
().
addTo
(
this
.
map
);
this
.
map
.
setMinZoom
(
2
);
this
.
map
.
setMaxZoom
(
8
);
}
/**
...
...
@@ -48,9 +52,7 @@ export default class Map extends LightningElement {
'
https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png
'
,
{
attribution
:
'
©
'
+
mapLink
+
'
Contributors
'
,
//minZoom: 4,
maxZoom
:
5
,
maxNativeZoom
:
5
})
.
addTo
(
this
.
map
);
}
...
...
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