Workflow with Google Maps API - javascript

I just need to know where to start. I'm developing an app with Meteor framework, where I need to have let's say a custom marker, which I get from user's input, so this marker shows up in a place where user stands through geolocation. I need to get this input when a user taps a button like "i'm here", so what's the best way to make it so? Some JS on button? Any examples would be appreciate, thanks.

Use dburles:google-maps . The documentation is well written and easy to use. Use GoogleMaps.maps.exampleMap.instance to set the current location on the button click.Grab the users location using either HTML5's location ability or a cordova plugin that provides the same functionality, depending on the app's user base. You could also completely eliminate the need of the button and initialize the map with the users location. See the above package documentation.

Related

Implement a customized Google Calendar with React Js?

My website currently runs a react-big-calendar Calendar with data I manually manage with graphql / Apollo
I decided to use Google Calendar for data management using the Google Calendar API instead of managing everything on my own database.
However, I was wondering if there was a way to directly include a custom Google Calendar ( the UI I mean ) in my website, so the Front-End part would be also managed by Google Calendar ( can be in an iframe, or a Google Component directly, if such a thing exists ).
This way I would leave most of the calendar front/back end logic to Google only, instead of having to call the Google API everytime I do a change on my react-big-calendar.
I say custom, because I would still need to edit some component, such as the pop-up opening when you want to create an event:
Most of the information have no use for me, and I would like to add others. I would also like to get rid of "search for people" or the create button on the sidebar, as an exemple.
Is there a way to include such a customized Google Calendar in my website? Or do I need to keep using my own react-big-calendar with data from the Google Calendar API?
Thanks in advance.
Unfortunately what you want cannot be achieved as Calendar doesn’t offer the possibility of editing/modifying any of its content.
Hence, the only available options in this situation are:
to embed it as explained in this article here;
make use of the Calendar API and build your own interface for it, just like you mentioned above.

How to open "Contact" and select a number

I want to create a input field which will open "Contact" or "Phonebook" and let the user to choose a contract number from there. I couldn't find any html input type to do that.
It is not possible to access your phone with plain html/css/js. If you want functionality to access Contacts, Camera, GPS and so on, you could create a hybrid app with Cordova. Then you can use the many plugins that make your dreams come true.
This is possible. The way to do this is using the Contact Picker API. This is available from chrome 80, and also now available in iOS advanced browser setting.
Check the following resources;
https://developer.mozilla.org/en-US/docs/Web/API/Contact_Picker_API

Customize 'share' message in Google Chrome

I want my website to enable people to share their score via instant messengers.
So there is this nifty feature where you can share websites in Google Chrome on Android
with other people (on the screenshot it says 'Teilen'):
Right now all it does is for example messages people on whatsapp the title of the webpage and its URL, so I wondered if I could somehow customize this behavior.
So, is it possible?
Also, is there a way to trigger this share functionality via javascript?
It is not possible to influence this directly from a website, but there are two things you can do.
Change url to highscore specific score
As soon as the user get's a new score use the history API .replaceState function to change the URL to a URL that for others will load a page with his highscore. And set window.title to what you want the title to be (though make sure this is something sensible for the player as well).
Triggering the share dialog from code is not possible.
Cordova (+crosswalk)
If you really wish to trigger the share dialog from code you would have to bundle your application as a native application using Cordova (and crosswalk if it's a game). There are next various plugins that expose the share dialog from Javascript.

Hide geolocation of embedded map from user

I want to embed a googlemap in a page but I don't want the user to be able to determine the geolocation by inspecting the code.
I've tried using the Javascript API to insert the map and loading in the Geolocation in a separate JS file which has been minified but the lon-lat are still easily identified.
Any tips on how I might go about doing this?
p.s. I know it sounds like a weird thing to want to do! It's for a puzzle and I don't want people to be able to cheat :-)
How about calling a service to get the geolocations? You could iterate over the results add the markers (I do it with google.maps.event.addListener to include a tooltip as well).
A user would have to inspect the result from the service.
If you want, you can use unique identifiers for your service calls, that are only valid once. A disadvantage would be that page refresh aren't possible anymore, because you would call the service with the same parameters again.

iphone, uiwebview with JS (google maps API)

two question for you:
reading google documentation i've make an html with the JS for make a google maps api call.
I've put this file in my project, and in a TABView i read and render this file in a uiwebview.
Works great but every time i start my app and go to this view i got this message: "appleweb://someID want to use your current location".
Is my fault or is normal? why my authrization is not saved in position auth?
Second: if i must make some other request on my map and passing new data or refreshing existent data is better that i do this via javascript or there's some option in cocoa to refresh my view?
It is surely not your FAULT, and yes it is normal. user location authorization SHOULD NOT be saved because the next time user launches his app he wont be knowing that his current location is being used (just in case he wants to avoid that for whatever reason).
I dont know the answer to you second question but just a suggestion: why don't you use MapKit API provided by apple instead of going with html and js for google maps? It is pretty easy to use and theres enough documentation and sample codes available on ADC.

Categories

Resources