Skip to content
This repository has been archived by the owner on Mar 26, 2021. It is now read-only.

Commit

Permalink
Merge branch 'release-ios-v3.5.0-android-v5.0.0' into mappy_android_f…
Browse files Browse the repository at this point in the history
…or_merge

* release-ios-v3.5.0-android-v5.0.0: (31 commits)
  [qt] Renamed qt5 formula to qt
  macos-v0.4.1
  [ios] Update podspecs and changelog for v3.5.2
  [ios, macos] Guard against looking up annotation contexts MGLAnnotationTagNotFound (mapbox#8686)
  [ios] Update podspecs and changelog for v3.5.1
  [ios, macos] Hardened std::map usage in MGLMapVIew
  [ios] replaced link to select a feature example (mapbox#8651)
  [ios, macos] Rename Data-driven styling guide (mapbox#8627)
  [ios] assertion to check if an annotationTag > 0 (mapbox#8588)
  [ios, macos] Preserve symlinks when zipping framework
  [ios] Silence incompatible type warning for callout view (mapbox#8608)
  Release android v5.0.2 (mapbox#8629)
  [macos] Removed MGLUserTrackingMode from jazzy ToC
  [macos] Fixed broken images in DDS guide
  [core] cache binary shaders on Android
  [core] Extract and de-templatize several Program static methods
  macos-v0.4.0
  [ios, macos] Updated changelogs
  [ios] Replaced UIActionSheet, UIAlertView with UIAlertController
  [ios, macos] Copyedited data-driven styling guides
  ...
  • Loading branch information
Tran Thuong Tien committed Apr 12, 2017
2 parents c5198a8 + 4d0605a commit c3cbdfd
Show file tree
Hide file tree
Showing 81 changed files with 1,180 additions and 718 deletions.
32 changes: 16 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ git:
addons:
apt:
sources:
- &common_sources [ 'ubuntu-toolchain-r-test', 'george-edison55-precise-backports' ]
- &common_sources [ 'ubuntu-toolchain-r-test', 'george-edison55-precise-backports', 'llvm-toolchain-trusty-3.9' ]
packages:
- &common_packages [ 'libllvm3.8v4', 'cmake', 'cmake-data' ]
- &clang38_packages [ 'clang-3.8', 'libstdc++-5-dev', 'libstdc++6' ]
- &clang39_packages [ 'clang-3.9', 'libstdc++-5-dev', 'libstdc++6' ]
- &gcc5_packages [ 'gcc-5', 'g++-5' ]
- &glfw_packages [ 'libxrandr-dev', 'libxcursor-dev', 'libxinerama-dev' ]

addons_shortcuts:
addons_clang38: &clang38
addons_clang39: &clang39
apt:
sources: *common_sources
packages:
- *common_packages
- *clang38_packages
- *clang39_packages
- *glfw_packages
addons_gcc5: &gcc5
apt:
Expand Down Expand Up @@ -81,14 +81,14 @@ matrix:
- git fetch origin master:refs/remotes/origin/master
- make check

# EGL - Node - Clang 3.8 - Debug
# EGL - Node - Clang 3.9 - Debug
- os: linux
sudo: required
dist: trusty
language: node
compiler: "egl-node4-clang38-debug"
env: BUILDTYPE=Debug _CXX=clang++-3.8 _CC=clang-3.8 WITH_EGL=1
addons: *clang38
compiler: "egl-node4-clang39-debug"
env: BUILDTYPE=Debug _CXX=clang++-3.9 _CC=clang-3.9 WITH_EGL=1
addons: *clang39
before_script:
- mapbox_install_logbt
- mapbox_start_xvfb
Expand All @@ -104,14 +104,14 @@ matrix:
after_failure:
- aws s3 cp . s3://mapbox/mapbox-gl-native/render-tests/$TRAVIS_JOB_NUMBER --recursive --exclude "*" --include "*.trace"

# EGL - Node - Clang 3.8 - Release
# EGL - Node - Clang 3.9 - Release
- os: linux
sudo: required
dist: trusty
language: node
compiler: "egl-node4-clang38-release"
env: BUILDTYPE=Release _CXX=clang++-3.8 _CC=clang-3.8 WITH_EGL=1
addons: *clang38
compiler: "egl-node4-clang39-release"
env: BUILDTYPE=Release _CXX=clang++-3.9 _CC=clang-3.9 WITH_EGL=1
addons: *clang39
before_script:
# fglrx causes the GLX extension to be unavailable
- sudo apt-get purge -qq fglrx
Expand Down Expand Up @@ -148,14 +148,14 @@ matrix:
- ccache --show-stats
- ./platform/linux/scripts/coveralls.sh

# EGL - Clang 3.8 - Debug
# EGL - Clang 3.9 - Debug
- os: linux
sudo: required
dist: trusty
language: cpp
compiler: "egl-clang38-debug"
env: BUILDTYPE=Debug _CXX=clang++-3.8 _CC=clang-3.8 WITH_EGL=1
addons: *clang38
compiler: "egl-clang39-debug"
env: BUILDTYPE=Debug _CXX=clang++-3.9 _CC=clang-3.9 WITH_EGL=1
addons: *clang39
before_script:
- mapbox_start_xvfb
- mapbox_export_mesa_library_path
Expand Down
7 changes: 7 additions & 0 deletions cmake/core-files.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ set(MBGL_CORE_FILES
src/mbgl/gl/draw_mode.hpp
src/mbgl/gl/extension.cpp
src/mbgl/gl/extension.hpp
src/mbgl/gl/features.hpp
src/mbgl/gl/framebuffer.hpp
src/mbgl/gl/gl.cpp
src/mbgl/gl/index_buffer.hpp
Expand All @@ -75,6 +76,8 @@ set(MBGL_CORE_FILES
src/mbgl/gl/object.hpp
src/mbgl/gl/primitives.hpp
src/mbgl/gl/program.hpp
src/mbgl/gl/program_binary.cpp
src/mbgl/gl/program_binary.hpp
src/mbgl/gl/renderbuffer.hpp
src/mbgl/gl/segment.cpp
src/mbgl/gl/segment.hpp
Expand Down Expand Up @@ -134,6 +137,8 @@ set(MBGL_CORE_FILES

# programs
src/mbgl/programs/attributes.hpp
src/mbgl/programs/binary_program.cpp
src/mbgl/programs/binary_program.hpp
src/mbgl/programs/circle_program.cpp
src/mbgl/programs/circle_program.hpp
src/mbgl/programs/collision_box_program.cpp
Expand Down Expand Up @@ -209,6 +214,8 @@ set(MBGL_CORE_FILES
src/mbgl/shaders/preludes.hpp
src/mbgl/shaders/raster.cpp
src/mbgl/shaders/raster.hpp
src/mbgl/shaders/shaders.cpp
src/mbgl/shaders/shaders.hpp
src/mbgl/shaders/symbol_icon.cpp
src/mbgl/shaders/symbol_icon.hpp
src/mbgl/shaders/symbol_sdf.cpp
Expand Down
3 changes: 3 additions & 0 deletions cmake/test-files.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ set(MBGL_TEST_FILES
test/math/minmax.test.cpp
test/math/wrap.test.cpp

# programs
test/programs/binary_program.test.cpp

# sprite
test/sprite/sprite_atlas.test.cpp
test/sprite/sprite_image.test.cpp
Expand Down
3 changes: 2 additions & 1 deletion include/mbgl/map/map.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ class Map : private util::noncopyable {
MapMode mapMode = MapMode::Continuous,
GLContextMode contextMode = GLContextMode::Unique,
ConstrainMode constrainMode = ConstrainMode::HeightOnly,
ViewportMode viewportMode = ViewportMode::Default);
ViewportMode viewportMode = ViewportMode::Default,
const std::string& programCacheDir = "");
~Map();

// Register a callback that will get called (on the render thread) when all resources have
Expand Down
38 changes: 19 additions & 19 deletions include/mbgl/util/enum.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,26 @@ namespace mbgl {
template <typename T>
class Enum {
public:
using Value = std::pair<const T, const char *>;

static const char * toString(T t) {
auto it = std::find_if(begin, end, [&] (const auto& v) { return t == v.first; });
assert(it != end); return it->second;
}

static optional<T> toEnum(const std::string& s) {
auto it = std::find_if(begin, end, [&] (const auto& v) { return s == v.second; });
return it == end ? optional<T>() : it->first;
}

private:
static const Value* begin;
static const Value* end;
static const char * toString(T);
static optional<T> toEnum(const std::string&);
};

#define MBGL_DEFINE_ENUM(type, strings...) \
const constexpr Enum<type>::Value type##_names[] = strings; \
template <> const Enum<type>::Value* Enum<type>::begin = std::begin(type##_names); \
template <> const Enum<type>::Value* Enum<type>::end = std::end(type##_names)
#define MBGL_DEFINE_ENUM(T, values...) \
\
static const constexpr std::pair<const T, const char *> T##_names[] = values; \
\
template <> \
const char * Enum<T>::toString(T t) { \
auto it = std::find_if(std::begin(T##_names), std::end(T##_names), \
[&] (const auto& v) { return t == v.first; }); \
assert(it != std::end(T##_names)); return it->second; \
} \
\
template <> \
optional<T> Enum<T>::toEnum(const std::string& s) { \
auto it = std::find_if(std::begin(T##_names), std::end(T##_names), \
[&] (const auto& v) { return s == v.second; }); \
return it == std::end(T##_names) ? optional<T>() : it->first; \
}

} // namespace mbgl
15 changes: 15 additions & 0 deletions platform/android/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@

Mapbox welcomes participation and contributions from everyone. If you'd like to do so please see the [`Contributing Guide`](https://github.com/mapbox/mapbox-gl-native/blob/master/CONTRIBUTING.md) first to get started.

## 5.0.2 - April 3, 2017

5.0.2 is a patch release that contains the following changes:

* Binary shader caching [#8604](https://github.com/mapbox/mapbox-gl-native/pull/8604)
* Fix resource transform callback [#8582](https://github.com/mapbox/mapbox-gl-native/pull/8582)
* Restore onTouch behaviour to 4.x version [#8585](https://github.com/mapbox/mapbox-gl-native/pull/8585)
* Restore anchoring after updating MarkerView Icon [#8519](https://github.com/mapbox/mapbox-gl-native/pull/8519)

## 5.0.1 - March 22nd, 2017

5.0.1 is a patch release that addresses a shader precision issue that created a rendering problem on some devices.

* Use `highp` for color attributes [#8385](https://github.com/mapbox/mapbox-gl-native/issues/8385)

## 5.0.0 - March 17th, 2017

5.0.0 final release contains:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,15 @@ public void setMapboxMap(MapboxMap mapboxMap) {
}
}

/**
* Invalidates the MarkerView resulting in remeasuring the View.
*/
void invalidate() {
width = height = 0;
offsetX = offsetY = MapboxConstants.UNMEASURED;
markerViewManager.invalidateViewMarkersInVisibleRegion();
}

/**
* Get the String representation of a MarkerView.
*
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import android.support.annotation.Nullable;
import android.support.v4.util.LongSparseArray;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
Expand Down Expand Up @@ -233,6 +232,7 @@ public void updateIcon(@NonNull MarkerView markerView) {
View convertView = markerViewMap.get(markerView);
if (convertView != null && convertView instanceof ImageView) {
((ImageView) convertView).setImageBitmap(markerView.getIcon().getBitmap());
markerView.invalidate();
}
}

Expand Down Expand Up @@ -504,26 +504,6 @@ public void invalidateViewMarkersInVisibleRegion() {
}
}

adaptedView.setOnTouchListener(new View.OnTouchListener() {

@Override
public boolean onTouch(View v, MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_UP) {
boolean clickHandled = false;
if (onMarkerViewClickListener != null) {
clickHandled = onMarkerViewClickListener.onMarkerClick(marker, v, adapter);
markerViewContainer.setTag(true);
}

if (!clickHandled) {
ensureInfoWindowOffset(marker);
select(marker, v, adapter);
}
}
return true;
}
});

marker.setMapboxMap(mapboxMap);
markerViewMap.put(marker, adaptedView);
if (convertView == null) {
Expand Down Expand Up @@ -551,6 +531,34 @@ public boolean onTouch(View v, MotionEvent event) {
updateMarkerViewsPosition();
}

/**
* When the provided {@link MarkerView} is clicked on by a user, we check if a custom click
* event has been created and if not, display a {@link InfoWindow}.
*
* @param markerView that the click event occurred.
*/
public boolean onClickMarkerView(MarkerView markerView) {
boolean clickHandled = false;

MapboxMap.MarkerViewAdapter adapter = getViewAdapter(markerView);
View view = getView(markerView);
if (adapter == null || view == null) {
// not a valid state
return true;
}

if (onMarkerViewClickListener != null) {
clickHandled = onMarkerViewClickListener.onMarkerClick(markerView, view, adapter);
}

if (!clickHandled) {
ensureInfoWindowOffset(markerView);
select(markerView, view, adapter);
}

return clickHandled;
}

/**
* Handles the {@link MarkerView}'s info window offset.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ public Builder target(LatLng location) {
* Set the tilt in degrees
* <p>
* value is clamped to 0 and 60.
* <p/>
* </p>
*
* @param tilt Tilt value
* @return Builder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@
/**
* Manages locational updates. Contains methods to register and unregister location listeners.
* <ul>
* <li>You can register a {@link LocationEngineListener} with
* {@link #addLocationEngineListener(LocationEngineListener)} to receive
* location updates.</li>
* <li> You can unregister a {@link LocationEngineListener} with
* {@link #removeLocationEngineListener(LocationEngineListener)} to stop receiving location updates.</li>
* <li>You can register a LocationEngineListener with LocationSource#addLocationEngineListener(LocationEngineListener)
* to receive location updates.</li>
* <li> You can unregister a LocationEngineListener with
* LocationEngine#removeLocationEngineListener(LocationEngineListener)} to stop receiving location updates.</li>
* </ul>
* <p>
* Note: If registering a listener in your Activity.onStart() implementation, you should unregister it in
Expand Down
Loading

0 comments on commit c3cbdfd

Please sign in to comment.