|
45 | 45 | import com.omkarmoghe.pokemap.models.map.GymMarkerExtended;
|
46 | 46 | import com.omkarmoghe.pokemap.models.map.PokemonMarkerExtended;
|
47 | 47 | import com.omkarmoghe.pokemap.models.map.PokestopMarkerExtended;
|
| 48 | +import com.omkarmoghe.pokemap.models.map.SearchParams; |
48 | 49 | import com.omkarmoghe.pokemap.util.PokemonIdUtils;
|
49 | 50 | import com.pokegoapi.api.map.fort.Pokestop;
|
50 | 51 | import com.pokegoapi.api.map.pokemon.CatchablePokemon;
|
@@ -88,6 +89,7 @@ public class MapWrapperFragment extends Fragment implements OnMapReadyCallback,
|
88 | 89 | private GoogleMap mGoogleMap;
|
89 | 90 | private Location mLocation = null;
|
90 | 91 | private Marker userSelectedPositionMarker = null;
|
| 92 | + private Location currentCenter = new Location("0,0"); |
91 | 93 | private Map<String, GymMarkerExtended> gymsList = new HashMap<>();
|
92 | 94 | Map<Integer, String> gymTeamImageUrls = new HashMap<>();
|
93 | 95 | String lurePokeStopImageUrl = "http://i.imgur.com/2BI3Cqv.png";
|
@@ -590,6 +592,26 @@ private String getExpirationBreakdown(long millis) {
|
590 | 592 | public void onEvent(CatchablePokemonEvent event) {
|
591 | 593 | setPokemonMarkers(event.getCatchablePokemon());
|
592 | 594 | drawCatchedPokemonCircle(event.getLat(), event.getLongitude());
|
| 595 | + if(positionNum == 1) { |
| 596 | + currentCenter.setLatitude(event.getLat()); |
| 597 | + currentCenter.setLongitude(event.getLongitude()); |
| 598 | + } |
| 599 | + if(positionNum == LOCATION_PERMISSION_REQUEST) |
| 600 | + { |
| 601 | + if (mGoogleMap != null) { |
| 602 | + |
| 603 | + if (mPref.getShowScannedPlaces()) { |
| 604 | + |
| 605 | + double radiusInMeters = ((SearchParams.DEFAULT_RADIUS *3)-(27*3))*2;//((3*100)-(27*3))*2 |
| 606 | + int strokeColor = 0x4400CCFF; // outline |
| 607 | + int shadeColor = 0x4400CCFF; // fill |
| 608 | + |
| 609 | + CircleOptions circleOptions = new CircleOptions().center(new LatLng(currentCenter.getLatitude(), currentCenter.getLongitude())).radius(radiusInMeters).fillColor(shadeColor).strokeColor(strokeColor).strokeWidth(8); |
| 610 | + clearCatchedPokemonCircle(); |
| 611 | + userSelectedPositionCircles.add(mGoogleMap.addCircle(circleOptions)); |
| 612 | + } |
| 613 | + } |
| 614 | + } |
593 | 615 | }
|
594 | 616 |
|
595 | 617 | /**
|
|
0 commit comments