Skip to content

Instantly share code, notes, and snippets.

View GlebMaltsev's full-sized avatar

Gleb GlebMaltsev

  • Minsk, Belarus
View GitHub Profile
@GlebMaltsev
GlebMaltsev / exception
Created December 2, 2015 13:42
Got duplicate zoom scale: 1.0 in init MapView
12-02 16:41:03.877 20552-20552/uk.kier.inspectors E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: uk.kier.inspectors, PID: 20552
java.lang.IllegalArgumentException: Got duplicate zoom scale: 1.0
at uk.co.ordnancesurvey.android.maps.MapScrollController.setZoomScales(MapScrollController.java:90)
at uk.co.ordnancesurvey.android.maps.GLMapRenderer.setMapLayers(GLMapRenderer.java:326)
at uk.co.ordnancesurvey.android.maps.MapView.init(MapView.java:118)
at uk.co.ordnancesurvey.android.maps.MapView.<init>(MapView.java:55)
at uk.co.ordnancesurvey.android.maps.SupportMapFragment.onCreateView(SupportMapFragment.java:80)
at android.support.v4.app.Fragment.performCreateView(Fragment.java:1962)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1026)
@GlebMaltsev
GlebMaltsev / Additional map layers
Created December 3, 2015 14:11
Creatting custom Map Layers
new MapLayer("GOOGLE12", "12", 256, 144447.93F),
new MapLayer("GOOGLE13", "13", 256, 72223.96F),
new MapLayer("GOOGLE14", "14", 256, 36111.98F),
new MapLayer("GOOGLE15", "15", 256, 18055.99F),
new MapLayer("GOOGLE16", "16", 256, 9028.00F),
new MapLayer("GOOGLE17", "17", 256, 4514.00F),
new MapLayer("GOOGLE18", "18", 256, 2257.00F),
new MapLayer("GOOGLE19", "19", 256, 1128.50F),
new MapLayer("GOOGLE20", "20", 256, 564.25F)
@GlebMaltsev
GlebMaltsev / layers
Created December 3, 2015 16:23
Additional map layers. tileSizeMetres = tileSizePixels * Ground_Resolution
new MapLayer("GOOGLE12", "12", 256, 256 * 38.2185F),
new MapLayer("GOOGLE13", "13", 256, 256 * 19.1093F),
new MapLayer("GOOGLE14", "14", 256, 256 * 9.5546F),
new MapLayer("GOOGLE15", "15", 256, 256 * 4.7773F),
new MapLayer("GOOGLE16", "16", 256, 256 * 2.3887F),
new MapLayer("GOOGLE17", "17", 256, 256 * 1.1943F),
new MapLayer("GOOGLE18", "18", 256, 256 * 0.5972F),
new MapLayer("GOOGLE19", "19", 256, 256 * 0.2986F),
new MapLayer("GOOGLE20", "20", 256, 256 * 0.1493F)
@GlebMaltsev
GlebMaltsev / gist:cedc898a014062b4a715
Created December 7, 2015 12:47
Upload Defect Request
session_id=C7B06B9C63D969A7D185B6B41B59&user_name=pclarke2&defect_id=1449492386951&section_id=13523&map_comments=&description=&length=6&width=9&depth=9&cluster_number=9&defect_detail=&fault_type=Carriage+Way+Inspections&defect_type=Edge+damage&priority=P2%2B&road_speed=30&traffic_management=Give+and+Take&latitude=53.9179244&longitude=27.5850013&completion_date=1449492412455&status=&on_site_hazard=&failed_repair=true
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
int width = getMeasuredWidth();
int height = getMeasuredHeight();
int measureSpec = keepAspectRatioByHeight ? height : width;
// ViewGroup.LayoutParams params = this.getLayoutParams();
// params.height = measureSpec;
02-12 18:54:43.647 28069-28069/com.effectivesoft.commentator D/onMeasure: ...
02-12 18:54:43.647 28069-28069/com.effectivesoft.commentator D/onMeasure: ...
02-12 18:54:43.647 28069-28069/com.effectivesoft.commentator D/onMeasure: getMeasuredWidth() = 723
02-12 18:54:43.647 28069-28069/com.effectivesoft.commentator D/onMeasure: getMeasuredHeight() = 846
02-12 18:54:43.647 28069-28069/com.effectivesoft.commentator D/onMeasure: ...
02-12 18:54:43.647 28069-28069/com.effectivesoft.commentator D/onMeasure: ...
02-12 18:54:43.647 28069-28069/com.effectivesoft.commentator D/onMeasure: getMeasuredWidth() = 156
02-12 18:54:43.647 28069-28069/com.effectivesoft.commentator D/onMeasure: getMeasuredHeight() = 723
02-12 18:54:43.657 28069-28069/com.effectivesoft.commentator D/onMeasure: ...
02-12 18:54:43.657 28069-28069/com.effectivesoft.commentator D/onMeasure: ...
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
Log.d("onMeasure", "...");
Log.d("onMeasure", "...");
int width = getMeasuredWidth();
int height = getMeasuredHeight();
int measureSpec = keepAspectRatioByHeight ? height : width;
Log.d("onMeasure", "getMeasuredWidth() = " + width);
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
Log.d("Layout onMeasure", "...");
Log.d("Layout onMeasure", "...");
Log.d("Layout onMeasure", "getMeasuredWidth() = " + getMeasuredWidth());
Log.d("Layout onMeasure", "getMeasuredHeight() = " + getMeasuredHeight());
}
@Override
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
Log.d("onMeasure", "...");
int width = getMeasuredWidth();
int height = getMeasuredHeight();
int size = keepAspectRatioByHeight ? height : width;
Log.d("Image onMeasure", "MeasureSpec.getSize(widthMeasureSpec) = " + MeasureSpec.getSize(widthMeasureSpec));
Log.d("Image onMeasure", "MeasureSpec.getSize(heightMeasureSpec) = " + MeasureSpec.getSize(heightMeasureSpec));
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
Log.d("Layout onMeasure", "...");
Log.d("Layout onMeasure", "MeasureSpec.getSize(widthMeasureSpec) = " + MeasureSpec.getSize(widthMeasureSpec));
Log.d("Layout onMeasure", "MeasureSpec.getSize(heightMeasureSpec) = " + MeasureSpec.getSize(heightMeasureSpec));
}
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {