Comments (18)
Hey @rufisayev ,
This repo was originally written as just an example app rather than a consumable library... I'm working now on turning this into a consumable library on npm but it's not there yet.
With some work, you should be able to look in the MainActivity.java in this project and copy the registration thats done there...
from react-native-maps.
I write MainActivity.java like you but i get error like this:
error: cannot find symbol
.addPackage(new AirPackage())
Although i attached all java files(which you set into java folder) into my project
from react-native-maps.
Hello, I would like to use your better implementation of mapview
straight away. I see that this is not released on NPM. Do you have any instructions on what we need to do in order to include it on our project? For now, I am only interested for the iOS part. Thanks!
from react-native-maps.
@rufisayev you will need to import com.rn_mapview
if you havent done that. Also, you should try and follow the instructions in #5
@af7 I'm working on getting this published as a library on npm. This repo started getting attention before I could finish it. Hopefully I will be able to do that this weekend, along with detailed instructions.
from react-native-maps.
@lelandrichardson i import my package,i write my code like this,is there are any problem?
package com.mapapp;
import android.app.Activity;
import android.os.Bundle;
import android.view.KeyEvent;
import com.facebook.react.LifecycleState;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactRootView;
import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler;
import com.facebook.react.shell.MainReactPackage;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks;
import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener;
public class MainActivity
extends Activity
implements DefaultHardwareBackBtnHandler {
private ReactInstanceManager reactInstanceManager;
private ReactRootView reactRootView;
private GoogleApiClient mGoogleApiClient;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
reactRootView = new ReactRootView(this);
reactInstanceManager = ReactInstanceManager.builder()
.setApplication(getApplication())
.setBundleAssetName("index.android.bundle")
.setJSMainModuleName("index.android")
.addPackage(new MainReactPackage())
.addPackage(new AirPackage())
.setUseDeveloperSupport(BuildConfig.DEBUG)
.setInitialLifecycleState(LifecycleState.RESUMED)
.build();
reactRootView.startReactApplication(reactInstanceManager, "rn_mapview", null);
// Create a GoogleApiClient instance
// mGoogleApiClient = new GoogleApiClient.Builder(this)
// .addApi(Drive.API)
// .addScope(Drive.SCOPE_FILE)
// .addConnectionCallbacks(this)
// .addOnConnectionFailedListener(this)
// .build();
setContentView(reactRootView);
}
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_MENU && reactInstanceManager != null) {
reactInstanceManager.showDevOptionsDialog();
return true;
}
return super.onKeyUp(keyCode, event);
}
@Override
public void onBackPressed() {
if (reactInstanceManager != null) {
reactInstanceManager.onBackPressed();
} else {
super.onBackPressed();
}
}
@Override
public void invokeDefaultOnBackPressed() {
super.onBackPressed();
}
@Override
protected void onPause() {
super.onPause();
if (reactInstanceManager != null) {
reactInstanceManager.onPause();
}
}
@Override
protected void onResume() {
super.onResume();
if (reactInstanceManager != null) {
reactInstanceManager.onResume(this, this);
}
}
// @OverRide
// public void onConnected(Bundle connectionHint) {
// // Connected to Google Play services!
// // The good stuff goes here.
// }
//
// @OverRide
// public void onConnectionSuspended(int cause) {
// // The connection has been interrupted.
// // Disable any UI components that depend on Google APIs
// // until onConnected() is called.
// }
//
// @OverRide
// public void onConnectionFailed(ConnectionResult result) {
// // This callback is important for handling errors that
// // may occur while attempting to connect with Google.
// //
// // More about this in the 'Handle Connection Failures' section.
//
// }
}
from react-native-maps.
@lelandrichardson If you could do it this weekend it would be great for me! Thanks again!
from react-native-maps.
@lelandrichardson @af7 I'm working on this a bit now. Starting with iOS.
Have you guys already started with some of the changes?
from react-native-maps.
@christopherdro I havent started yet. Feel free to start on it. Would be nice if we could not duplicate work...
from react-native-maps.
Yea that's what I wanted to avoid as well. I ended up created a new project as a framework instead of a application to start and setting up the header search paths so that it will work properly for development and as a library.
Could you push the package.json that you used to publish to npm recently?
I was thinking it would be a good idea to rename the library to something different than rn_mapview.
I named it RNMapView for now, but feel free to tell me how you would like it to be named and i'll change it.
Maybe AIRMaps?
from react-native-maps.
@christopherdro you can get the package.json here: https://gist.github.com/lelandrichardson/83901244c78d081b69b5
Feel free to change it however you see fit (ie, react-native should be removed as a dep).
RNMapView works as a name... or maybe AIRMapView?
from react-native-maps.
@lelandrichardson finally i can build my project,now i can open view,but when i click one of buttons i t give me an error..
from react-native-maps.
@rufisayev which buttons? All of them? What error does it give?
from react-native-maps.
All of them i get the same error like this:
AirMapView.java:66
from react-native-maps.
@rufisayev there is a known issue where we are using getMap()
instead of getMapAsync()
which appears to not work correctly on all android devices. If possible, try to change your emulator. I'm using a nexus 5 emulator and its working. We are working on a fix for this.
from react-native-maps.
@lelandrichardson I like AirMapView
from react-native-maps.
I install nexus 5 emulator,now i still get error like this:
Attempt to invoke virtual method 'void com.google.android.gms.maps.GoogleMap.setInfoWindowAdapter(com.google.android.gms.maps.GoogleMap$InfoWindowAdapter)on a null object reference
AirMapView.java:66
from react-native-maps.
I tried in different emulators bu still i get the same error,how can i solve it?And exactly in which emulator it works on you?
from react-native-maps.
The emulator that is working for me is Google Nexus 5 - 5.1.0 - API 22 - 1080x1920
. Unfortunately I'm not sure what to tell you beyond that. I am working on getting the component to work with the Async API and will maybe/hopefully have some progress on that this weekend.
from react-native-maps.
Related Issues (20)
- Custom marker start flicking without changing the state. HOT 14
- Task :react-native-maps:compileDebugJavaWithJavac FAILED HOT 1
- download map and save in pdf,png HOT 1
- Custom marker is croping from right to bottom. Only in IOS.
- Apple Privacy Manifest HOT 7
- Marker blinking issue HOT 5
- Markers are blinking on Android and Google Maps HOT 1
- CocoaPods could not find compatible versions for pod "react-native-google-maps" HOT 3
- Maptile works well on IOS , but it does not update on Android HOT 5
- Subview flickering on children index changes HOT 5
- Expo sdk50 cannot use it
- Marker don't display HOT 2
- Subview flickering on children index changes HOT 1
- [iOS] With Google Maps, zoomTapEnabled can't be modified and sometimes it's ignored. HOT 1
- 'onRegionChange' called long after changes has stopped HOT 1
- Invariant Violation: Event cannot be both direct and bubbling: topSelect HOT 1
- MapMarker onSelect does not fire with Google Maps on iOS HOT 1
- "googleMapId" not working on IOS HOT 2
- Error on startup on react-native 0.74 Bridgeless New Architecture HOT 17
- ANDROID DEVICE: addViewAt: failed to insert view [664] into parent [646] at index 0 The specified child already has a parent. You must call removeView() on the child's parent first. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-maps.