airbnb / airmapview Goto Github PK
View Code? Open in Web Editor NEWA view abstraction to provide a map user interface with various underlying map providers
Home Page: http://airbnb.github.io/AirMapView/
License: Apache License 2.0
A view abstraction to provide a map user interface with various underlying map providers
Home Page: http://airbnb.github.io/AirMapView/
License: Apache License 2.0
I'm trying to obtain the center of the map but it's always null. How do I go about doing it when using the Web view?
I think it's important to understand what has been changed between versions. The last one was for 1.3.4
Thanks!
These flags below appear to be disabled without reason disallowing users of the library to enable zoom controls or the my location button when a native map is being utilized
Hi, how i can initialize map with async task?
Like:
.getMapAsync(new OnMapReadyCallback() {
@Override
public void onMapReady(GoogleMap googleMap) {
}
});
hi
Is it possible to use OSM maps stored on device?
There is a problem with MapBox marker
when I try to add some bitmap or BitmapDescriptorFactory
algorithm ignores that and show standard pin
Is there one?
It looks like just Google maps in native and web-based forms at the moment. I notice there's also a amazon branch, but no info on plans to integrate it into the main lib.
Is it possible to style the map ?
Using Google Maps is possible to stylize my map according to a Json.
Hey there!
I'd like to report a security issue but cannot find contact instructions on your repository.
If not a hassle, might you kindly add a SECURITY.md
file with an email, or another contact method? GitHub recommends this best practice to ensure security issues are responsibly disclosed, and it would serve as a simple instruction for security researchers in the future.
Thank you for your consideration, and I look forward to hearing from you!
(cc @huntr-helper)
I'm getting this error when i run the app on some devices :
App is having trouble with Google Play Services. Please try again
Hi,
For some reason I can't get to make the JavaScript Google maps to work.
I created a totally new account in Google Cloud Console and created all the necessary setup including the billing system.
For some reason the Web Maps are still throwing this Google Maps JavaScript API warning: NoApiKeys exception and the map is showing up with a dark grey overlay on top of it, stating that the maps is only for Development Purposes.
I am using the sample app and I am getting these same results.
Hi,
When using getChildFragmentManager to initialize the MapAirView inside a fragment the created NativeGoogleMapFragment's getActivity method returns null and as a result the googleMap variable is never initialized.
Am I missing something here?
Hello,
I tried the code below in the Emulator as well as on real device. Both the devices doesn't have Google Play Services installed so a web based version of map is shown. But for some reason, the map is always blank with just blue color. Attached is the screenshot. Am I missing something?
mapViewBuilder = new DefaultAirMapViewBuilder(this);
map = (AirMapView) findViewById(R.id.map_view);
map.setOnMapInitializedListener(this);
map.initialize(getSupportFragmentManager());
<com.airbnb.android.airmapview.AirMapView
android:id="@+id/map_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />
I am working for Properly Inc on our Anrdoid app and since we want to support Kindle and other Android OS variations that dont support the Play Services, I found our guys plugin. We are already using your deeplink plugin too.
But for some reason I cant interact with the Map in the WebView, the log shows ReferenceErrors.
I tried doing things through the AirMapView and the AirMapInterface, nothing helped.
To setup the the plugin for this use I followed your sample project and got it to display.
Do I have to interact with the webmap in another way, or should I use/try MapBox?
Thank you,
Matt
Feature Request:
Add the ability to enable/disable the MapToolbar when using the native map.
Thanks,
Justin
Hi,
Are there plans to add support for switching between map types to the AirMapInterface?
The native GoogleMap object offers the setMapType(int), it would be quite useful if a similar method was exposed via the AirMapInterface. In particular it would be useful to be able to switch between "roadmap" and "satellite" programmatically. As it stands there doesn't appear to be any way to change the default map type, which is Roadmap.
For reference, the map types available via the Google Maps Javascript API are described here:
https://developers.google.com/maps/documentation/javascript/maptypes
What the title says.
The strokeColor and fillColor seem to be ignored when the circle is drawn on non-native Google maps. Everything works as normal on the native Google map.
Hey,
looks like the library asks for a location permission on behalf of us. What I'd like to achieve is to ask for this permission on my own.
From what I can see checkLocationPermissions()
checks if permission is granted and asks for it if not. This method is used only from setMyLocationEnabled()
method. This would be acceptable if, as a workaround, I could pass false
to it and avoid asking. Unfortunately in NativeGoogleMapFragment
init()
method there's a setMyLocationEnabled(true)
call which forces asking for permission.
Is this correct or am I missing something?
As for me, the ideal solution would be to completely remove asking for this permission from AirMapView and leave it to developer's decision. Another, that would probably work for most of people, would be to remove setMyLocationEnabled(true)
from mentioned init()
method.
What do you think?
Error:A problem occurred configuring project ':app'.
Could not resolve all dependencies for configuration ':app:_debugCompile'.
Could not find com.amazon.android:amazon-maps-api:2.0.
Searched in the following locations:
https://jcenter.bintray.com/com/amazon/android/amazon-maps-api/2.0/amazon-maps-api-2.0.pom
https://jcenter.bintray.com/com/amazon/android/amazon-maps-api/2.0/amazon-maps-api-2.0.aar
file:/C:/Users/Mirko/AppData/Local/Android/sdk/extras/android/m2repository/com/amazon/android/amazon-maps-api/2.0/amazon-maps-api-2.0.pom
file:/C:/Users/Mirko/AppData/Local/Android/sdk/extras/android/m2repository/com/amazon/android/amazon-maps-api/2.0/amazon-maps-api-2.0.aar
file:/C:/Users/Mirko/AppData/Local/Android/sdk/extras/google/m2repository/com/amazon/android/amazon-maps-api/2.0/amazon-maps-api-2.0.pom
file:/C:/Users/Mirko/AppData/Local/Android/sdk/extras/google/m2repository/com/amazon/android/amazon-maps-api/2.0/amazon-maps-api-2.0.aar
Required by:
Link:app:unspecified > com.airbnb.android:airmapview:1.1.2
Could not find com.google.android.gms:play-services-maps:7.0.0.
Searched in the following locations:
https://jcenter.bintray.com/com/google/android/gms/play-services-maps/7.0.0/play-services-maps-7.0.0.pom
https://jcenter.bintray.com/com/google/android/gms/play-services-maps/7.0.0/play-services-maps-7.0.0.jar
file:/C:/Users/Mirko/AppData/Local/Android/sdk/extras/android/m2repository/com/google/android/gms/play-services-maps/7.0.0/play-services-maps-7.0.0.pom
file:/C:/Users/Mirko/AppData/Local/Android/sdk/extras/android/m2repository/com/google/android/gms/play-services-maps/7.0.0/play-services-maps-7.0.0.jar
file:/C:/Users/Mirko/AppData/Local/Android/sdk/extras/google/m2repository/com/google/android/gms/play-services-maps/7.0.0/play-services-maps-7.0.0.pom
file:/C:/Users/Mirko/AppData/Local/Android/sdk/extras/google/m2repository/com/google/android/gms/play-services-maps/7.0.0/play-services-maps-7.0.0.jar
Required by:
Link:app:unspecified > com.airbnb.android:airmapview:1.1.2
I'm having trouble understanding why NativeGoogleMapFragment#setMyLocationEnabled is set to true by default here
I've been searching for a way to use AirMapView without prompting the user for their location. Is that possible?
TouchListener simply will not work since mapview itself is using touchlistener inside of it. What if we want to detect action up by our own touchlistenr? Please provide solution.
Hello,
I tried to trigger the onMapMarkerClick(1) function programatically, but the marker title and map toolbar is not shown. The marker has to be tapped manually. Is there any way, this can be achieved?
Thanks in advance.
Hi, I know that this is not the correct topic but I would like to know what technologies backend and frontend use to work the map on the web.
I have the doubt that technologies use to be able to work a search engine with a map.
Thank you
First of all congratulations for the repo, it's fantastic.
I want to show only a bitmap of the map in a section of the app, how can I achieve this?
Thanks in advace
Google provides a utility library named android-map-utils, which includes many features not included directly in Google Maps, like :
Obviously, this library expects the APIs from Google Maps, so it cannot work with AirMapView.
Since this library is open-source, I started integrating it in AirMapView. A working demo can be found at this address : https://github.com/acq/AirMapView/tree/map-utils. The only feature that does not work yet is custom tiles (and others require more work, like custom images for markers). Here are some screenshots:
In this proof of concept, several features needed to be added or reworked in order the library to work. This includes ground overlays, custom image markers on web maps, changed APIs (for example: AirMapPolyline), various bug fixes, ...
This code is not ready to be merged, but raises several questions:
Thanks!
This return a error when I try to compile.
The build of gradle works well, but the app, not.
Error:Execution failed for task ':app:dexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/lib/jvm/java-7-openjdk-amd64/bin/java'' finished with non-zero exit value 2
Hi guys, I'm trying to get the Google Maps web view to work but all I can see is a blank blue screen from a failed-to-load Google map. I suspected maybe the API Key was not set somehow, I get that warning in the logs:
11-17 06:30:41.071 2366-2366/mobi.hopr I/chromium: [INFO:CONSOLE(210)] "Google Maps API warning: NoApiKeys https://developers.google.com/maps/documentation/javascript/error-messages#no-api-keys", source: https://maps.googleapis.com/maps-api-v3/api/js/27/1/util.js (210)
I then downloaded your sample to see what I was doing wrong and noticed that if I set the manifest's com.google.android.maps.v2.API_KEY to empty, the sample still functions completely (native and web view maps). How is this possible? And where is the javascript key actually set for the webview maps? Not sure what I could be doing wrong but this might point me in the right direction.
Starting at version 1.5.0, we've seen a weird NPE crash in your app:
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'com.airbnb.android.airmapview.AirMapInterface com.airbnb.android.airmapview.AirMapView.getMapInterface()' on a null object reference
at br.com.moobie.android.carMaps.CarMapFragment.onMapInitialized(CarMapFragment.java:308)
at com.airbnb.android.airmapview.AirMapView.onMapLoaded(AirMapView.java:416)
at com.airbnb.android.airmapview.NativeGoogleMapFragment$1.onMapReady(NativeGoogleMapFragment.java:78)
at com.google.android.gms.maps.zzaj.zza(Unknown Source)
at com.google.android.gms.maps.internal.zzaq.onTransact(Unknown Source)
at android.os.Binder.transact(Binder.java:387)
at fv.b(:com.google.android.gms.DynamiteModulesB@11745436:20)
at com.google.android.gms.maps.internal.bf.a(:com.google.android.gms.DynamiteModulesB@11745436:5)
at com.google.maps.api.android.lib6.impl.bc.run(:com.google.android.gms.DynamiteModulesB@11745436:5)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:7325)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
I've tried to reproduce the error but I couldn't so far.
In the latter version (1.4.0) everything was working properly, I'm suspecting it might be related with the Google Play Services bump #98, but I'm not sure.
My onMapInitialized:
@Override
public void onMapInitialized() {
map.getMapInterface().setMapToolbarEnabled(false);
....
}
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
map.setOnCameraChangeListener(this);
map.setOnMarkerClickListener(this);
map.setOnMapInitializedListener(this);
map.initialize(getChildFragmentManager());
}
Is there anyone else facing this issue?
Thanks!
As the title suggests, there are methods which take an int
zoom level that have no explanation as to hot the argument is supposed to behave.
Needs to be done after we make the repo public
With the sample app installed on a UK based device, Nexus 6 running Lollipop
If you change the language to certain Asian ones - Chinese, Thai for example, the markers are correctly placed.
The map view can be set to track the user's current location, but it is not retrievable. Would it be possible to expose this?
Hi,
i have tried to create a sample with this code:
import com.airbnb.android.airmapview.AirMapMarker;
import com.airbnb.android.airmapview.AirMapPolyline;
import com.airbnb.android.airmapview.AirMapView;
import com.airbnb.android.airmapview.DefaultAirMapViewBuilder;
import com.airbnb.android.airmapview.listeners.OnMapInitializedListener;
import com.google.android.gms.maps.model.LatLng;
import java.util.Arrays;
public class SelectMapAreaGame extends AppCompatActivity implements OnMapInitializedListener {
private AirMapView map;
private DefaultAirMapViewBuilder mapViewBuilder;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_select_map_area_game);
mapViewBuilder = new DefaultAirMapViewBuilder(this);
map = (AirMapView) findViewById(R.id.map_view);
map.setOnMapInitializedListener(this);
map.initialize(getSupportFragmentManager());
}
private void addMarker(String title, LatLng latLng, int id) {
map.addMarker(new AirMapMarker.Builder()
.id(id)
.position(latLng)
.title(title)
.iconId(R.drawable.ghost)
.build());
}
@Override public void onMapInitialized() {
System.out.println("Map onMapInitialized triggered");
final LatLng airbnbLatLng = new LatLng(37.771883, -122.405224);
addMarker("Airbnb HQ", airbnbLatLng, 1);
addMarker("Performance Bikes", new LatLng(37.773975, -122.40205), 2);
addMarker("REI", new LatLng(37.772127, -122.404411), 3);
addMarker("Mapbox", new LatLng(37.77572, -122.41354), 4);
map.animateCenterZoom(airbnbLatLng, 10);
// Add Polylines
LatLng[] latLngs = {
new LatLng(37.77977, -122.38937),
new LatLng(37.77811, -122.39160),
new LatLng(37.77787, -122.38864)};
map.addPolyline(new AirMapPolyline(Arrays.asList(latLngs), 5));
// Add Circle
map.drawCircle(new LatLng(37.78443, -122.40805), 1000);
// enable my location
map.setMyLocationEnabled(true);
}
}
and i have a blank view with this in the console:
W/webcore: java.lang.Throwable: EventHub.removeMessages(int what = 107) is not supported before the WebViewCore is set up.
at android.webkit.WebViewCore$EventHub.removeMessages(WebViewCore.java:1684)
at android.webkit.WebViewCore$EventHub.access$7900(WebViewCore.java:927)
at android.webkit.WebViewCore.removeMessages(WebViewCore.java:1796)
at android.webkit.WebView.sendOurVisibleRect(WebView.java:2953)
at android.webkit.ZoomManager.setZoomScale(ZoomManager.java:593)
at android.webkit.ZoomManager.access$1700(ZoomManager.java:49)
at android.webkit.ZoomManager$PostScale.run(ZoomManager.java:984)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
how i can fix?
Can we expose the "never ask again" callback in AirMapInterface for dynamic permissions?
So we can show a more friendly UI for users when they choose "never ask again" but come back later.
Hi all.
I'm using AirMapView
and have a question that How to move map without moving a marker (indicate my current location on map). My solution is adding an ImageView
that is centerInParent
of the map, but when taking the snapshot of the map, it does not have a marker.
Could you all support my question above ?
Thanks
Setting location enabled here sets the global variable myLocationEnabled
to true but if permissions are rejected the googleMap
's location is never enabled. Trying to set the location enabled at a later point calling setMylocationEnabled(true)
will no longer do anything unless you disable the location that was never enabled.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.