| 591 | } |
| 592 | |
| 593 | void MapTree::OnZoomToSelected(wxCommandEvent& event) |
| 594 | { |
| 595 | // set map extent to selected objects in mouse clicked layer |
| 596 | wxString map_name = map_titles[new_order[select_id]]; |
| 597 | BackgroundMapLayer* ml = GetMapLayer(map_name); |
| 598 | double minx, miny, maxx, maxy; |
| 599 | if (ml == NULL) { |
| 600 | // selected layer is current map |
| 601 | canvas->GetExtentOfSelected(minx, miny, maxx, maxy); |
| 602 | } else { |
| 603 | // other layer |
| 604 | ml->GetExtentOfSelected(minx, miny, maxx, maxy); |
| 605 | // re projection if needed |
| 606 | OGRSpatialReference* destSR = canvas->GetSpatialReference(); |
| 607 | OGRSpatialReference* sourceSR = ml->GetSpatialReference(); |
| 608 | #ifdef __PROJ6__ |
| 609 | if (sourceSR) { |
| 610 | sourceSR->SetAxisMappingStrategy(OAMS_TRADITIONAL_GIS_ORDER); |
| 611 | } |
| 612 | if (destSR) { |
| 613 | destSR->SetAxisMappingStrategy(OAMS_TRADITIONAL_GIS_ORDER); |
| 614 | } |
| 615 | #endif |
| 616 | OGRCoordinateTransformation *poCT = OGRCreateCoordinateTransformation(sourceSR, destSR); |
| 617 | if (poCT!= NULL) { |
| 618 | //poCT->Transform(1, &minx, &miny); |
| 619 | //poCT->Transform(1, &maxx, &maxx); |
| 620 | } |
| 621 | } |
| 622 | canvas->ExtentTo(minx, miny, maxx, maxy); |
| 623 | canvas->RedrawMap(); |
| 624 | canvas->ResetBrushing(); |
| 625 | } |
| 626 | |
| 627 | void MapTree::OnSetAssociateLayer(wxCommandEvent& event) |
| 628 | { |
nothing calls this directly
no test coverage detected