
Product
Unify Your Security Stack with Socket Basics
A single platform for static analysis, secrets detection, container scanning, and CVE checks—built on trusted open source tools, ready to run out of the box.
@capacitor-community/capacitor-googlemaps-native
Advanced tools
Plugin using native Maps API for Android and iOS.
@capacitor-community/capacitor-googlemaps-native
Capacitor Plugin using native Google Maps SDK for Android and iOS.
Maps SDK for Android & iOS bring better performance and offline caching compared to JS SDK and they're free to use.
Maintainer | GitHub | |
---|---|---|
Hemang Kumar | hemangsk | hemangsk@gmail.com |
Features | Android | iOS | Current Status | Pending |
---|---|---|---|---|
Map Objects | ✓ | ✓ | create() | |
Markers | WIP | WIP | addMarker() is implemented which allows you to show a marker with default tooltip design. didTap | Info windows |
Business & POIs | ✓ | ✓ | didTapPOIWithPlaceID | |
Lite Mode | ✓ | ✕ | create(liteMode?: boolean) | Not available for iOS |
Street View | ✕ | WIP | createStreetView() | |
Launch URL | ✕ | ✕ | ||
Controls & Gestures | WIP | WIP | settings() allow to set all the map UI settings. | Allow users to get current state of map settings. |
Events | WIP | WIP | ||
Camera & View | ✓ | ✓ | setCamera() | Allow users to get current camera position |
Location | WIP | WIP | enableCurrentLocation() onMyLocationButtonClick , onMyLocationClick enableCurrentLocation() , myLocation() | API wrapping needs improvement so that it becomes consistent for both platforms |
Drawing on Map | WIP | WIP | Shapes, Ground Overlays, Tile Overlays | |
Utility Library | ✕ | ✕ |
npm i --save @capacitor-community/capacitor-googlemaps-native
npx cap sync
You'll have two API keys by the end of this step. Lets proceed:
Android in AndroidManifest.xml:
<application>
...
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="YOUR_ANDROID_MAPS_API_KEY"/>
...
</application>
As of Capacitor 3, the plugin needs to be registered in MainActivity.java:
import com.hemangkumar.capacitorgooglemaps.CapacitorGoogleMaps;
//...
public class MainActivity extends BridgeActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// ...
registerPlugin(CapacitorGoogleMaps.class);
}
}
import { CapacitorGoogleMaps } from '@capacitor-community/capacitor-googlemaps-native';
/* initialize() is important for iOS,
Android doesn't need any initialization.
*/
await CapacitorGoogleMaps.initialize({
key: "YOUR_IOS_API_KEY"
});
component.html
<div id="map" #map></div>
component.css
#map {
margin: 2em 1em;
height: 250px;
border: 1px solid black;
}
component.ts
@ViewChild('map') mapView: ElementRef;
async ionViewDidEnter() {
const boundingRect = this.mapView.nativeElement.getBoundingClientRect() as DOMRect;
CapacitorGoogleMaps.create({
width: Math.round(boundingRect.width),
height: Math.round(boundingRect.height),
x: Math.round(boundingRect.x),
y: Math.round(boundingRect.y),
latitude: -33.86,
longitude: 151.20,
zoom: 12
});
CapacitorGoogleMaps.addListener("onMapReady", async function() {
/*
We can do all the magic here when map is ready
*/
CapacitorGoogleMaps.addMarker({
latitude: -33.86,
longitude: 151.20,
title: "Custom Title",
snippet: "Custom Snippet",
});
CapacitorGoogleMaps.setMapType({
"type": "normal"
})
})
}
ionViewDidLeave() {
CapacitorGoogleMaps.close();
}
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!
FAQs
Plugin using native Maps API for Android and iOS.
The npm package @capacitor-community/capacitor-googlemaps-native receives a total of 39 weekly downloads. As such, @capacitor-community/capacitor-googlemaps-native popularity was classified as not popular.
We found that @capacitor-community/capacitor-googlemaps-native demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 35 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
A single platform for static analysis, secrets detection, container scanning, and CVE checks—built on trusted open source tools, ready to run out of the box.
Product
Socket is launching experimental protection for the Hugging Face ecosystem, scanning for malware and malicious payload injections inside model files to prevent silent AI supply chain attacks.
Research
/Security News
The Socket Threat Research Team uncovered a coordinated campaign that floods the Chrome Web Store with 131 rebranded clones of a WhatsApp Web automation extension to spam Brazilian users.