Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
VIPS Observation App DEPRECATED
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VIPS
VIPS Observation App DEPRECATED
Commits
36b391b7
Commit
36b391b7
authored
4 years ago
by
Bhabesh Bhabani Mukhopadhyay
Browse files
Options
Downloads
Patches
Plain Diff
#VOAPP-13 : For new POI user's current gps location captured
parent
fa2ba366
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
config.xml
+1
-0
1 addition, 0 deletions
config.xml
src/components/MapPOI.vue
+83
-4
83 additions, 4 deletions
src/components/MapPOI.vue
src/components/PlacesList.vue
+16
-0
16 additions, 0 deletions
src/components/PlacesList.vue
with
100 additions
and
4 deletions
config.xml
+
1
−
0
View file @
36b391b7
...
...
@@ -18,6 +18,7 @@ compile to www folder</description>
<allow-intent
href=
"sms:*"
/>
<allow-intent
href=
"mailto:*"
/>
<allow-intent
href=
"geo:*"
/>
<plugin
name=
"cordova-plugin-geolocation"
spec=
"4.1.0"
/>
<platform
name=
"android"
>
<allow-intent
href=
"market:*"
/>
<edit-config
file=
"app/src/main/AndroidManifest.xml"
mode=
"merge"
target=
"/manifest/application"
>
...
...
This diff is collapsed.
Click to expand it.
src/components/MapPOI.vue
+
83
−
4
View file @
36b391b7
...
...
@@ -84,6 +84,7 @@ export default{
poi
:
{},
mapZoom
:
0
,
poiTypes
:
[],
}
},
methods
:
{
...
...
@@ -124,7 +125,7 @@ export default{
})
localStorage
.
setItem
(
CommonUtil
.
CONST_STORAGE_POI_LIST
,
JSON
.
stringify
(
lstPOI
));
},
initMap
()
/*
initMap()
{
let mapZoom = this.mapZoom;
let urlMap = CommonUtil.CONST_GPS_URL_NORWAY_MAP;
...
...
@@ -169,7 +170,7 @@ export default{
renderer : 'canvas',
})
})
},
},
*/
myImage
()
{
var
fill
=
new
Fill
({
...
...
@@ -224,8 +225,76 @@ export default{
return
(
mapInteractions
)
?
[]
:
''
;
},
/** My current location */
myposition
()
{
let
options
=
{
enableHighAccuracy
:
true
};
navigator
.
geolocation
.
getCurrentPosition
(
this
.
geolocationSuccess
,
this
.
geolocationError
,
options
);
//navigator.geolocation.getCurrentPosition(this.geolocationSuccess, this.geolocationError, this.geolocationOptions);
},
geolocationOptions
(
options
){
console
.
log
(
'
geolocation options :
'
+
options
);
},
geolocationError
(
error
){
console
.
log
(
'
geolocation error :
'
+
geolocationError
);
},
geolocationSuccess
(
pos
)
{
let
This
=
this
;
console
.
log
(
pos
);
This
.
poi
.
latitude
=
pos
.
coords
.
latitude
;
This
.
poi
.
longitude
=
pos
.
coords
.
longitude
;
let
coord
=
[
pos
.
coords
.
longitude
,
pos
.
coords
.
latitude
];
let
transFormCord
=
transform
(
coord
,
'
EPSG:3857
'
,
'
EPSG:4326
'
);
let
vectorLayer
=
new
VectorLayer
({
source
:
new
VectorSource
({
features
:
[
new
Feature
({
geometry
:
new
Point
(
fromLonLat
(
transFormCord
))
})
],
}),
style
:
new
Style
({
image
:
new
CircleStyle
({
radius
:
5
,
fill
:
new
Fill
({
color
:
'
red
'
}),
stroke
:
new
Stroke
({
color
:
'
red
'
,
width
:
4
})
})
})
});
let
geoGSON
=
new
GeoJSON
();
let
resultGeoGSON
=
geoGSON
.
writeFeatures
(
vectorLayer
.
getSource
().
getFeatures
(),
{
dataProjection
:
'
EPSG:4326
'
,
featureProjection
:
'
EPSG:3857
'
})
This
.
poi
.
geoJSON
=
resultGeoGSON
;
This
.
mapInit
();
},
mapInit
()
{
let
This
=
this
;
let
urlMap
=
CommonUtil
.
CONST_GPS_URL_NORWAY_MAP
;
let
latitude
=
this
.
poi
.
latitude
;
...
...
@@ -347,9 +416,19 @@ export default{
this
.
mapZoom
=
CommonUtil
.
CONST_GPS_OBSERVATION_ZOOM
;
this
.
poiTypes
=
JSON
.
parse
(
CommonUtil
.
CONST_POI_TYPES
);
this
.
getPointOfInterest
(
this
.
$route
.
params
.
pointOfInterestId
);
if
(
this
.
$route
.
params
.
pointOfInterestId
)
{
this
.
getPointOfInterest
(
this
.
$route
.
params
.
pointOfInterestId
);
this
.
mapInit
();
}
else
{
this
.
myposition
();
}
//this.initMap();
this
.
mapInit
();
},
beforeDestroy
()
{
// This resets the container layout when leaving the router page
...
...
This diff is collapsed.
Click to expand it.
src/components/PlacesList.vue
+
16
−
0
View file @
36b391b7
...
...
@@ -6,7 +6,16 @@
<div
class=
'col-10 '
><h5>
{{
poi
.
name
}}
</h5></div>
<div
class=
'col'
><i
class=
"fas fa-plus-circle fa-2x"
></i></div>
</router-link>
<div
class=
"clearfix"
/>
</div>
<div
id=
'divNewPOI'
class=
"container"
>
<router-link
class=
"row fw-bold"
ref=
'linkMapPoi'
:to=
"
{name:'MapPOI', params: {}}" >
<div
class=
'col-10 '
></div>
<div
class=
'col'
><i
class=
"fas fa-plus-circle fa-2x"
></i></div>
</router-link>
</div>
<common-util
ref=
"CommonUtil"
/>
</div>
</
template
>
...
...
@@ -47,6 +56,7 @@ export default {
getPlacesList
()
{
let
lstPOI
=
JSON
.
parse
(
localStorage
.
getItem
(
CommonUtil
.
CONST_STORAGE_POI_LIST
));
return
lstPOI
;
}
...
...
@@ -61,3 +71,9 @@ export default {
}
}
</
script
>
<
style
>
#divNewPOI
{
position
:
fixed
;
bottom
:
0
;
}
</
style
>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment