GithubHelp home page GithubHelp logo

Maps integration about nativescript-snacks HOT 3 OPEN

jlooper avatar jlooper commented on June 2, 2024
Maps integration

from nativescript-snacks.

Comments (3)

creambyemute avatar creambyemute commented on June 2, 2024

@lukashlobil
I have google maps by dapriett integrated with adding multiple markers.
Dragging markers would be an easy example as well.

By "getting tapped location" do you just mean latitude/longitude or the Address (with GeoCoding API)?
By "typing in address and have that location shown selected on the map" Is the address you want to be "selected" a marker which has this address or lat/long combination? Or is it more like type in address and zoom there in the map?

from nativescript-snacks.

lukashlobil avatar lukashlobil commented on June 2, 2024

I have just implemented a solution with dapriett's plugin as well. Just starting on draggable markers.

getting tapped location - If I get lat and lng, I can get the address easily, but for the demo purpose, it would be best if we showed the whole process of getting the address as well.
selected address - should add a marker and zoom in on it? Basically for the demo, it should showcase the plugin's capabilities.

I forgot to mention I am looking for a solution in Angular.

How do you get tapped location?
<MapView (coordinateTapped)=onMapTap($args)> ?

from nativescript-snacks.

creambyemute avatar creambyemute commented on June 2, 2024

I have the map implemented in Angular

For the tapped location:
Add (coordinateTapped)="onCoordinateTapped($event)" to the MapView layout like this

In your .ts file
onCoordinateTapped(event) { console.log("Coordinate Tapped, Lat: " + event.position.latitude + ", Lon: " + event.position.longitude, event); // Do whatever you want here with the lat/long }

That's it to get the tapped location (I didn't try it out, just looked at the plugins code and demo app). In order to get the address you'd now need geocoding which requires some setup regarding apiKey (it's very easy to get the address after you've setup that). I haven't looked into that now, but I guess you can use a simple http request to access the geocoding api or use the in-built ones from android/iOS (which requires a bit more work I think)

For the address search you'd then need to again use geocoding to convert the address to lat/long and then it's an easy task again to add a marker there and zoom in.

Ps; If you still need a video tutorial, I can make one, but not before christmas as I won't find time before

from nativescript-snacks.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.