RocketMap icon indicating copy to clipboard operation
RocketMap copied to clipboard

[Stock-RM-PR] Adds a new menu item "Favorite Locations" in the navigation

Open darkelement1987 opened this issue 6 years ago • 4 comments

This will insert a new menu item "Favorite Locations" in the navigation with three functions:

  • with the first function, users can search for places like neighborhoods, streets, etc. (This code was already in RM. I only changed it a bit.)

  • the second function allows the user to save the current view as "quick button". Each view can be assigned an own name. This buttons can be deleted again at any time by the user.

  • and the third feature allows the site admins to leave predefined locations as "quick button". These can be stored as deletable or non-deletable buttons. The predefined gps coordinates are stored in the custom.js

These functions are very helpful to save hotspots like nests, or if the site admin scans only some places (or a large area), he can deposit these places as a "quick button". The places created by the user are stored in the localstorage and will not be publicly available. Therefore, my other PR (#2545) is very useful to restore the settings in case of loss.

A few examples: (result see Screenshots)

const 'favoriteLocations' = [{
        'Amsterdam': {lat: 52.3702157, lng: 4.8951678, zoom: 13, deletable: false},
        'Central Park (NY)': {lat: 40.7828647, lng: -73.9653551, zoom: 16, deletable: false},
        'London': {lat: 51.5073509, lng: -0.1277582, zoom: 14, deletable: true},
        'Berlin': {lat: 52.5200065, lng: 13.4049539, zoom: 14}
    }]

image

darkelement1987 avatar Mar 27 '18 23:03 darkelement1987

this is cool!

bcrucialhd avatar Mar 28 '18 02:03 bcrucialhd

Just tested this myself. Works great!

darkelement1987 avatar Mar 30 '18 01:03 darkelement1987

--Solve conflicts-- Edit: FU Travis. Edit: Travis fixed

darkelement1987 avatar Mar 30 '18 19:03 darkelement1987

Modified title to indicate this is a PR on stock RM and not official code.

tomballgithub avatar Apr 05 '18 01:04 tomballgithub