Android PolygonOptions - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android PolygonOptions class.

This code example shows how to use the following methods: addAll, fillColor, strokeColor, strokeWidth
package com.manish.googlemap; 
 
import java.util.ArrayList; 
 
import android.graphics.Color; 
import android.os.Bundle; 
import android.support.v4.app.FragmentActivity; 
 
import com.google.android.gms.maps.GoogleMap; 
import com.google.android.gms.maps.GoogleMap.OnMapClickListener; 
import com.google.android.gms.maps.GoogleMap.OnMapLongClickListener; 
import com.google.android.gms.maps.GoogleMap.OnMarkerClickListener; 
import com.google.android.gms.maps.SupportMapFragment; 
import com.google.android.gms.maps.model.BitmapDescriptorFactory; 
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.Polygon; 
import com.google.android.gms.maps.model.PolygonOptions; 
import com.google.android.gms.maps.model.PolylineOptions; 

6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods: add, fillColor, strokeColor, strokeWidth
package jp.hackugyo.gatemail.ui.activity; 
 
import android.graphics.Color; 
import android.os.Bundle; 
 
import com.google.android.gms.maps.GoogleMap; 
import com.google.android.gms.maps.GoogleMap.OnMarkerClickListener; 
import com.google.android.gms.maps.SupportMapFragment; 
import com.google.android.gms.maps.model.BitmapDescriptorFactory; 
import com.google.android.gms.maps.model.CircleOptions; 
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.PolygonOptions; 
 
import jp.hackugyo.gatemail.R; 
import jp.hackugyo.gatemail.model.withoutdb.MapField; 
import jp.hackugyo.gatemail.ui.AbsFragmentActivity; 
import jp.hackugyo.gatemail.util.LogUtils; 
 

6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods: strokeColor, strokeWidth, visible
package com.elias.insideglorias; 
 
import java.io.InputStream; 
import java.util.List; 
import java.util.Vector; 
 
import com.elias.kmlreader.ReaderKML; 
import com.elias.polygondouble.Point; 
import com.elias.polygondouble.Polygon; 
import com.elias.polygondouble.Polygon.Builder; 
import com.google.android.gms.maps.CameraUpdate; 
import com.google.android.gms.maps.CameraUpdateFactory; 
import com.google.android.gms.maps.GoogleMap; 
import com.google.android.gms.maps.SupportMapFragment; 
import com.google.android.gms.maps.model.LatLng; 
import com.google.android.gms.maps.model.MarkerOptions; 
import com.google.android.gms.maps.model.PolygonOptions; 
 
import android.graphics.Color; 
import android.location.Criteria; 

6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods: add, strokeWidth
		mMap.setOnMapLongClickListener(this);
		mMap.setOnCameraChangeListener(this);
		mMap.setOnMarkerDragListener(this);
		mMap.setOnMarkerClickListener(this);
		mMap.setMyLocationEnabled(true); //shows the location button and enables it	
		options.add(new LatLng(0,0));
		poly = mMap.addPolygon(options
				.strokeWidth(2)
                .strokeColor(Color.BLACK)
                .fillColor(0x7FB5B1E0));
	} 
	@Override 
    protected void onPause() { 
        super.onPause(); 
    } 
	 
	@Override 
	public void onMapClick(LatLng point) {
		if (inc>0){
			mkr1.get(selmkr-1).setIcon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_GREEN));
Full Snippet Info
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
		hole.add(new LatLng(45.5275, -73.5925));
		hole.add(new LatLng(45.5225, -73.5925));
		hole.add(new LatLng(45.5225, -73.5975));
		hole.add(new LatLng(45.5275, -73.5975));
 
		PolygonOptions rectOptions = new PolygonOptions()
		.add(new LatLng(45.53, -73.59),
				new LatLng(45.52, -73.59),
				new LatLng(45.52, -73.60),
				new LatLng(45.53, -73.60),
				new LatLng(45.53, -73.59))
				.addHole(hole)
				.strokeColor(Color.RED)
				.fillColor(Color.BLUE);
 
		Polygon polygon = mMap.addPolygon(rectOptions);
		 
		// And sure, why not, a CIRCLE 
		CircleOptions circleOptions = new CircleOptions()
		.center(new LatLng(45.525, -73.595))
Full Snippet Info
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
                .fillColor(Color.CYAN)
                .strokeColor(Color.BLUE)
                .strokeWidth(5));
 
        // Create a rectangle centered at Sydney. 
        PolygonOptions options = new PolygonOptions().addAll(createRectangle(SYDNEY, 5, 8));
 
        int fillColor = Color.HSVToColor(
                mAlphaBar.getProgress(), new float[] {mColorBar.getProgress(), 1, 1});
        mMutablePolygon = mMap.addPolygon(options
                .strokeWidth(mWidthBar.getProgress())
                .strokeColor(Color.BLACK)
                .fillColor(fillColor));
 
        mColorBar.setOnSeekBarChangeListener(this);
        mAlphaBar.setOnSeekBarChangeListener(this);
        mWidthBar.setOnSeekBarChangeListener(this);
 
        // Move the map so that it is centered on the mutable polygon. 
        mMap.moveCamera(CameraUpdateFactory.newLatLng(SYDNEY));
Full Snippet Info
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
        super.onActivityCreated(savedInstanceState);
        setUpMapIfNeeded(); 
    } 
 
    private void setUpMapIfNeeded() { 
        PolygonOptions rectOptions = new PolygonOptions()
                .add(new LatLng(37.35, -122.0),
                        new LatLng(37.45, -122.0),
                        new LatLng(37.45, -122.2));
        if (map == null) {
            map = this.getMap();
            if (map != null) {
                map.addMarker(new MarkerOptions().position(new LatLng(37.35, -122.0)).title("Hello World"));
                map.addMarker(new MarkerOptions().position(new LatLng(37.45, -122.0)).title("Hello World"));
                map.addMarker(new MarkerOptions().position(new LatLng(37.45, -122.2)).title("Hello World"));
                map.addPolygon(rectOptions);
            } 
            requestPath(); 
        } 
    } 
Full Snippet Info
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
                .title("ATM"));
    } 
 
    public void addBanburyToMap() { 
 
        PolygonOptions rectOptions = new PolygonOptions()
                .add(new LatLng(37.236758, -76.646559),
                        new LatLng(37.236632, -76.646091),
                        new LatLng(37.236686, -76.645847),
                        new LatLng(37.236624, -76.645713),
                        new LatLng(37.236368, -76.645571),
                        new LatLng(37.236265, -76.645356),
                        new LatLng(37.235558, -76.645322),
                        new LatLng(37.235742, -76.646209),
                        new LatLng(37.236178, -76.64666),
                        new LatLng(37.236449, -76.646746),
                        new LatLng(37.236705, -76.646625))
                .strokeWidth(4)
                .strokeColor(Color.BLACK);
 
Full Snippet Info
2
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
        super.onActivityCreated(savedInstanceState);
        setUpMapIfNeeded(); 
    } 
 
    private void setUpMapIfNeeded() { 
        PolygonOptions rectOptions = new PolygonOptions()
                .add(new LatLng(37.35, -122.0),
                        new LatLng(37.45, -122.0),
                        new LatLng(37.45, -122.2));
        if (map == null) {
            map = this.getMap();
            if (map != null) {
                map.addMarker(new MarkerOptions().position(new LatLng(37.35, -122.0)).title("Hello World"));
                map.addMarker(new MarkerOptions().position(new LatLng(37.45, -122.0)).title("Hello World"));
                map.addMarker(new MarkerOptions().position(new LatLng(37.45, -122.2)).title("Hello World"));
                map.addPolygon(rectOptions);
            } 
            requestPath(); 
        } 
    } 
Full Snippet Info
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods: getPoints
    @Test 
    public void testPolygon() { 
        PolygonOptions opts = ga.adapt(Geom.polygon(1,1,2,2,3,3,1,1));
        assertNotNull(opts);
 
        assertEquals(4, opts.getPoints().size());
        assertEquals(new LatLng(1,1), opts.getPoints().get(0));
        assertEquals(new LatLng(2,2), opts.getPoints().get(1));
        assertEquals(new LatLng(3,3), opts.getPoints().get(2));
        assertEquals(new LatLng(1,1), opts.getPoints().get(3));
    } 
} 
Full Snippet Info
4
CodeRank
Experience pair programming with AI  Get Codota for Java

Related Android PolygonOptions Questions & Answers:

See Code Examples for Android PolygonOptions Methods: