본문
180906(목) - Google Maps (Businesses and Other POI)
Mobile/Google Maps 2018. 9. 6. 19:35
Google Maps
Businesses and Other POI
- 기본적으로 POIs 는 icon과 함께 base map에 appear
- POIs include parks, schools, government buildings, and more
- businesses POIs는 map type이 normal일 때, appear
ex) shops, restaurants, hotels, and more
- business POIs가 indoor maps일 때는, lite mode map에서만 appear
- POI는 Places SDK의 place에 corresponds
- but unless national or historic significance면 그거슨 POIs가 아니다.
Listen for click events on POIs
public class OnPoiClickDemoActivity extends FragmentActivity
implements OnMapReadyCallback, GoogleMap.OnPoiClickListener {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.poi_click_demo);
SupportMapFragment mapFragment =
(SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
mapFragment.getMapAsync(this);
}
@Override
public void onMapReady(GoogleMap map) {
map.setOnPoiClickListener(this);
}
@Override
public void onPoiClick(PointOfInterest poi) {
Toast.makeText(getApplicationContext(), "Clicked: " +
poi.name + "\nPlace ID:" + poi.placeId +
"\nLatitude:" + poi.latLng.latitude +
" Longitude:" + poi.latLng.longitude,
Toast.LENGTH_SHORT).show();
}
}
- POSs는 기본적으로 map에 표시되지만, on-click UI 는 없다.
- PointOfInterest
contains lat / lng coordinates, place ID, name
Stop POIs form showing on the map
- all POIs or specific categories POIs는 custom styles applying 으로 hide 가능
- hiding map features with styling.
[
{
"featureType": "poi.business",
"stylers": [
{ "visibility": "off" }
]
}
]
[
{
"featureType": "poi",
"stylers": [
{ "visibility": "simplified" }
]
}
]
'Mobile > Google Maps' 카테고리의 다른 글
180907(금) - Google Maps (Launch Google Maps) (0) | 2018.09.07 |
---|---|
180907(금) - Google Maps (Lite Mode) (0) | 2018.09.07 |
180905(수) - Google Maps (Map Objects) (0) | 2018.09.05 |
180905(수) - Google Maps (Select Current Place) (0) | 2018.09.05 |
180905(수) - Google Maps (Polylines and Polygons to Represent Routes and Areas) (0) | 2018.09.05 |
댓글