MCPcopy Create free account
hub / github.com/GeoDaCenter/geoda / AddMapLayer

Method AddMapLayer

Explore/MapNewView.cpp:802–834  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

800}
801
802void 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
836void MapCanvas::ResizeSelectableShps(int virtual_scrn_w,
837 int virtual_scrn_h)

Callers 1

OnMapAddLayerMethod · 0.45

Calls 5

ExtentMapMethod · 0.95
SetHideMethod · 0.80
sizeMethod · 0.45
GetNameMethod · 0.45
notifyObserversMethod · 0.45

Tested by

no test coverage detected