Simple Google Maps with Ionic 2

Asked

Viewed 837 times

-1

Talk personal, all right? Next, I’m developing an application in Ionic 2 that will need google maps. However the use is not via geolocation, it is only the presentation of the map with a predefined address(or long + lat).

I found a lot about google maps, but they all consist of using plugins... Is there any way to do what I need in a simple way?

  • https://github.com/mapsplugin/cordova-plugin-googlemaps/wiki/Tutorial-for-Windows Good luck, I’m available!

2 answers

0

You need a plugin to do this, see this which is recommended on the official website of the framework

https://ionicframework.com/docs/native/google-maps/

https://github.com/mapsplugin/cordova-plugin-googlemaps

The documentation is clear, consistent. See that there are examples in the second link doing what you want, display a point on google maps, more or less like this:

map.addMarker({
  position: {lat: ..., lng: ...},
  title: "Hello Cordova Google Maps for iOS and Android",
  snippet: "This plugin is awesome!"
}, function(marker) { ... })

0

You made an excellent choice on Ionic 2.

Let’s talk a little about the plugins. They are elements built with the focus on making the link between your Javascript and Java, which is the language that devices can understand. Quite simply when using a native plugin like Google Maps plugin Ionic 2 or even the Original Cordova, you will get full performance of a native feature, because when running the app for Android. apk your JS will communicate with the device’s native features and thus run without any problem that has been prompted. The other solution is if you do something in Java that communicates your JS to the device, but it will still be a Plugin, only done by you. The only thing that I do not indicate is to use in Ionic/Cordova Google Maps for web, which also works, but limits you and makes the application slower. I hope to have helped and good studies with Ionic 2, it has grown a lot in the Brazilian market.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.