Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
Refactor MapView code to be more maintainable. Implement JavaDocs up …
Browse files Browse the repository at this point in the history
…to rotation.
  • Loading branch information
Leith Bade committed Oct 1, 2015
1 parent 9fdc36c commit 4930a40
Show file tree
Hide file tree
Showing 8 changed files with 825 additions and 630 deletions.
7 changes: 6 additions & 1 deletion android/java/MapboxGLAndroidSDK/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,14 @@ android.libraryVariants.all { variant ->
destinationDir = new File(destinationDir, variant.baseName)
source = files(variant.javaCompile.source)
classpath = files(variant.javaCompile.classpath.files) + files(android.bootClasspath)
options.windowTitle("Mapbox Android SDK")
options.docTitle("Mapbox Android SDK")
options.header("<b>Mapbox Android SDK</b>")
options.bottom("&copy; 2015 Mapbox. All rights reserved.")
options.links("http://docs.oracle.com/javase/7/docs/api/")
// TODO this will fail as package-list file not online, need to use offline
options.links("http://d.android.com/reference/")
exclude '**/R.html', '**/R.*.html'
// TODO exclude generated R, BuildConfig, com.almeros.*
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import android.graphics.Point;
import android.view.View;
import com.mapbox.mapboxgl.geometry.LatLng;
import com.mapbox.mapboxgl.views.InfoWindow;
import com.mapbox.mapboxgl.views.R;

public class Marker extends Annotation {
Expand Down Expand Up @@ -138,6 +139,10 @@ public void setSprite(String sprite) {
this.sprite = sprite;
}

public String getSprite() {
return sprite;
}

public void setTitle(String title) {
this.title = title;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.mapbox.mapboxgl.annotations;
package com.mapbox.mapboxgl.views;

import android.content.Context;
import android.graphics.PointF;
Expand All @@ -7,8 +7,9 @@
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.mapbox.mapboxgl.annotations.Marker;
import com.mapbox.mapboxgl.geometry.LatLng;
import com.mapbox.mapboxgl.views.MapView;

/**
* A tooltip view
Expand Down Expand Up @@ -85,7 +86,7 @@ public InfoWindow open(Marker object, LatLng position, int offsetX, int offsetY)
mView.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED);

PointF coords = mMapView.toScreenLocation(position);
double y = mMapView.getTopOffsetPixelsForAnnotationSymbol(object.sprite);
double y = mMapView.getTopOffsetPixelsForAnnotationSymbol(object.getSprite());
y = y * mMapView.getScreenDensity();

// Flip y coordinate as Android view origin is upper left corner
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.mapbox.mapboxgl.annotations;
package com.mapbox.mapboxgl.views;

import android.content.Context;
import android.graphics.Canvas;
Expand Down
Loading

0 comments on commit 4930a40

Please sign in to comment.