openct-tasks/_common/modules/pemFioi/map_v2
Haifeng Luo a2feebe153 Add code from commit: 5eace44153 2021-04-11 20:28:50 +08:00
..
blockly_map.js Add code from commit: 5eace44153 2021-04-11 20:28:50 +08:00
map.js Add code from commit: 5eace44153 2021-04-11 20:28:50 +08:00
readme.txt Add code from commit: 5eace44153 2021-04-11 20:28:50 +08:00

readme.txt

addCity(lng, lat, name)
    - draw pin with label
    - save city to inner DB

getNbCities()    
    return: amount of saved cities

addRoad(city_idx_1, city_idx_2)
    - draw line between cities (color1)
    - save link (city_idx_1 <-> city_idx_2) to DB

getNbRoads(city_idx)
    return: amount of roads where city_idx_1 == city_idx or city_idx_2 == city_idx

getCityRoads(city_idx)
    return: roads where city_idx_1 == city_idx or city_idx_2 == city_idx

getCityLongitude(city_idx)    
    return: city lng

getCityLatitude(city_idx)    
    return: city lat

getRoadLength(road_idx)
    return: distance between cities linked by given road

highlightRoad(road_idx)
    - draw line between cities (color2)
    
getDestinationCity(city_idx, road_idx)
    return: find all roads where city_idx_1 == city_idx or city_idx_2 == city_idx, take road with index = road_idx, return another city idx from road link