map.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. import { get, post } from '@/utils/request'
  2. const mapAPI = {
  3. photoMarks: '/api/geo/photo/marks',
  4. photoMarksArea: '/api/geo/photo/marks_area',
  5. photoMarksNearby: '/api/geo/photo/marks_nearby',
  6. cupMapApi: '/api/geo/map/cup',
  7. cascadeApi: '/api/geo/map/cascade',
  8. photoMarkInfo: '/api/geo/photo/mark/info',
  9. photoItemApi: '/api/geo/photo/item',
  10. addPositionAPi: '/api/geo/map/position',
  11. addMyPositionAPi: '/api/geo/map/my_position',
  12. addPathAPi: '/api/geo/map/trail',
  13. mapMarks: '/api/geo/map/marks',
  14. trailPathApi: '/api/geo/map/trail',
  15. chartMapAreaApi: '/api/geo/chartmap/area',
  16. chartMapGeojsonApi: '/api/geo/chartmap/geojson'
  17. }
  18. export function getMapMarks() {
  19. return get(mapAPI.mapMarks)
  20. }
  21. export function getPhotoMarks(areaCode) {
  22. return get(mapAPI.photoMarks + '?type=' + areaCode)
  23. }
  24. export function getPhotoMarksArea(areaCode) {
  25. return get(mapAPI.photoMarksArea + '?areaCode=' + areaCode)
  26. }
  27. export function getPhotoMarksNearby(distance) {
  28. return get(mapAPI.photoMarksNearby + '?distance=' + distance)
  29. }
  30. export function getCupMap() {
  31. return get(mapAPI.cupMapApi)
  32. }
  33. export function getAreaCascadeOptions() {
  34. return get(mapAPI.cascadeApi)
  35. }
  36. export function getMarkerInfo(id) {
  37. return get(mapAPI.photoMarkInfo + '?id=' + id)
  38. }
  39. export function getPhotoItems() {
  40. return get(mapAPI.photoItemApi)
  41. }
  42. export function addGeoPosition(data) {
  43. return post(mapAPI.addPositionAPi, data)
  44. }
  45. export function addMyPosition(data) {
  46. return post(mapAPI.addMyPositionAPi, data)
  47. }
  48. export function addPath(data) {
  49. return post(mapAPI.addPathAPi, data)
  50. }
  51. export function getGeoPoint() {
  52. return get(mapAPI.trailPathApi + '/' + 1)
  53. }
  54. export function getChartMapArea() {
  55. return get(mapAPI.chartMapAreaApi)
  56. }
  57. export function getChartMapGeojson(areaCode) {
  58. return get(mapAPI.chartMapGeojsonApi + '?areaCode=' + areaCode)
  59. }