| 800 | } |
| 801 | |
| 802 | void MapCanvas::AddMapLayer(wxString name, BackgroundMapLayer* map_layer, |
| 803 | bool is_hide) |
| 804 | { |
| 805 | // geometries: projection is matched to current map |
| 806 | if (map_layer) { |
| 807 | map_layer->SetHide(is_hide); |
| 808 | bool added = false; |
| 809 | for (int i=0; i<bg_maps.size(); i++) { |
| 810 | if (bg_maps[i]->GetName() == map_layer->GetName()) { |
| 811 | added = true; |
| 812 | } |
| 813 | } |
| 814 | if (!added) { |
| 815 | for (int i=0; i<fg_maps.size(); i++) { |
| 816 | if (fg_maps[i]->GetName() == map_layer->GetName()) { |
| 817 | added = true; |
| 818 | } |
| 819 | } |
| 820 | } |
| 821 | if (!added) { |
| 822 | // project makes sure no overwrite here |
| 823 | bg_maps.push_back(map_layer); |
| 824 | } else { |
| 825 | // if already loaded before, just show it |
| 826 | map_layer->SetHide(false); |
| 827 | } |
| 828 | this->ExtentMap(); |
| 829 | full_map_redraw_needed = true; |
| 830 | PopulateCanvas(); |
| 831 | Refresh(); |
| 832 | maplayer_state->notifyObservers(this); |
| 833 | } |
| 834 | } |
| 835 | |
| 836 | void MapCanvas::ResizeSelectableShps(int virtual_scrn_w, |
| 837 | int virtual_scrn_h) |
no test coverage detected