Notes
![]() ![]() Notes - notes.io |
import android.Manifest;
import android.graphics.Color;
import android.location.Location;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.Marker;
import com.google.android.gms.maps.model.MarkerOptions;
import com.google.android.gms.maps.model.Polyline;
import com.google.android.gms.maps.model.PolylineOptions;
public class MainActivity extends AppCompatActivity implements OnMapReadyCallback
{
GoogleMap map;
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
SupportMapFragment smf = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
smf.getMapAsync(MainActivity.this);
ActivityCompat.requestPermissions(MainActivity.this,
new String[] {
Manifest.permission.ACCESS_COARSE_LOCATION,
Manifest.permission.ACCESS_FINE_LOCATION
}, 11);
}
public void onMapReady(GoogleMap googleMap)
{
map = googleMap;
LatLng l1 = new LatLng(28.111, 35.222);
LatLng l2 = new LatLng(27.511, 35.282);
LatLng l3 = new LatLng(29.211, 35.102);
LatLng l4 = new LatLng(28.811, 34.992);
LatLng l5 = new LatLng(27.911, 35.000);
map.addPolyline(new PolylineOptions()
.add(l1)
.add(l2)
.add(l3)
.add(l4)
.add(l5)
.color(Color.BLUE)
.width(5.0f));
final LatLng loc = new LatLng(28.111, 35.222);
// Pin
MarkerOptions mo = new MarkerOptions();
mo.title("Burası Önemli");
mo.snippet("Açıklama");
mo.position(loc);
map.addMarker(mo);
int izin = ContextCompat.checkSelfPermission(MainActivity.this, Manifest.permission.ACCESS_COARSE_LOCATION);
map.setMyLocationEnabled(true);
map.setOnMyLocationChangeListener(new GoogleMap.OnMyLocationChangeListener() {
@Override
public void onMyLocationChange(Location location)
{
Log.e("x","Yeni Konum : "+location.toString());
}
});
map.setOnMarkerClickListener(new GoogleMap.OnMarkerClickListener() {
@Override
public boolean onMarkerClick(Marker marker)
{
Log.e("x","Seçilen : "+marker.getTitle()+" --> "+marker.getSnippet());
return false;
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
menu.add("Normal").setShowAsAction(MenuItem.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW);
menu.add("Uydu").setShowAsAction(MenuItem.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW);
menu.add("Arazi").setShowAsAction(MenuItem.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW);
menu.add("Hibrit").setShowAsAction(MenuItem.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW);
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
String ad = ""+item.getTitle();
if (ad.equals("Normal")) map.setMapType(GoogleMap.MAP_TYPE_NORMAL);
if (ad.equals("Uydu")) map.setMapType(GoogleMap.MAP_TYPE_SATELLITE);
if (ad.equals("Arazi")) map.setMapType(GoogleMap.MAP_TYPE_TERRAIN);
if (ad.equals("Hibrit")) map.setMapType(GoogleMap.MAP_TYPE_HYBRID);
return super.onOptionsItemSelected(item);
}
}
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team