Map pinning in react native - google-maps

I am looking for a way to capture user click and create a pin on the map view. Does anyone has any idea where can I start, I was not able to find anything.

There are two solutions for your issue.
Using RN's native MapView component, there are no easy solutions. You can create a pin when `onRegionChangeComplete is triggered. But you'll get the coordinates of the center of the map only. I've set up a running example for you here.
You can use this very well done package. In this package, there is an onPress method that you can use. It'll return you the coordinate of the point you just pressed.

You should look at the onRegionChange prop from the MapView component. That's a function that will be triggered whenever the user drags the map. Between that and the annotations props you should be able to achieve what you want.

Related

how to change a CesiumJS viewer's baselayer url

i am using a CesiumJS instance to display a base map of the earth using a imageryProvider from source A.
var viewer = new Cesium.Viewer('cesiumContainer', imageryProvider:providerA);
Now while using the Viewer I would like to be able to change this map to get images from providerB at a certain event.
I tried:
viewer.scene.imageryLayers.get(0).imageryProvider.url = providerB.url
However that does not seem to work and also feels quite like hack anyway.
I could not find anything in Cesium's documentation .
Is this at all possible without restarting / recreating the viewer instance?
I know that there is a Cesium.BaseLayerPicker (https://cesium.com/docs/cesiumjs-ref-doc/BaseLayerPicker.html)
However I do not see what method this picker calls on "select" )
Thanks a lot.
The BaseLayerPicker widget calls this code when the user selects a new layer.
There's a lot of boilerplate widget management in that block of code, but for your sake, only a couple of the lines are critical. First, the old existing active imagery layer is searched for, and removed:
imageryLayers.remove(layer);
Then, a new imagery provider is constructed and added at index 0, the first position, which is the base imagery layer:
imageryLayers.addImageryProvider(newProviders, 0);
You can directly change the URL of the provider but you should also change appropriate parameters("layers" in case of WMS, "layer", "style", "format", "tileMatrixSetID " ... in case of WMTS) depending on the type of provider(WMS or WMTS).

Collaborative Button using google Drive Realtime Api

i'm new to the realtime api and i want to implement a trivial test project that will help me understand the structure of the api. Sorry if my question sound stupid but i don't think i really understand how to use the api.
What i want to do is create a button and when you press the button on the one app the same button will be pressed on the other apps.
What i would like to know is how to model this button in the collaborative data model.
Could i use variables like isPressed or isRollOver to pass the buttons state or i can create a hole button object somehow?
i want to use java or javascript.
thank you!
The realtime data model can consists of a combination of CollaborativeMap, CollaborativeList, CollaborativeString, and primitive javascript types.
I think for your use case you'd probably want a CollaborativeMap where you map a button name to a boolean value. You can then add an event listener to the CollaborativeMap to find out when the button's value changes.

TileMap not generated; add to stage?

I'm failrly new to LibGDX and I'm running into a problem.
I'm building a classically styled RPG/Adventure game in which I'm using a TiledMap(-Renderer) to create the map. I've followed different tutorials but can't get it to work. (last one was DPG's: Full working example link)
What I need, is a column of buttons on the right side of the screen (implemented that through ImageButtons). One of these buttons lead to a settings-kind of screen and another one should lead to the game map. Under a ClickListener of the button I've added DPK's code of
MapHelper map = new MapHelper();
map.setPackerDirectory("data/packer");
map.loadMap("data/world/level1/level.tmx");
map.prepareCamera((int)stage.getWidth(), (int)stage.getHeight());
map.getCamera().update();
map.render();
The MapHelper class is an exact copy of dpk's, only change above is the setting of the width and height of the camera. Any suggestion what I'm doing wrong here?
I don't think you want to invoke map.render() in the ClickListener callback. That would mean the map is only rendered when you click, and then not re-rendered (generally everything gets re-rendered on every screen re-fresh).
I think you need to track the map in your application class, and in the ClickListener callback you need to set a flag or somehow "enable" the map (perhaps setting it to something other than null). Then in the application's render() method you can check to see if the map should be rendered or not, and render it if so.
Specifically, move the calls to prepareCamera, getCamera and render out of the ClickListener.

how to know when Map control was first manipulated?

I am using the Map control in Windows Phone 8.
I need to implement a page where user can select his location using the map control.
I am trying to know when the app was first manipulated by the user.
Some background info:
I saw that when the control is shown, it automatically centers the world map, and CenterChanged event is raised.
I am not able to understand how ManipulationStarted, ManipulationDelta and ManipulationCompleted work.
the first time I drag, ManipulationStarted is not called, only ManipulationCompleted.
I could consider the first manipulation by user as being the 2nd time the CenterChanged is fired.
But this is a hack or a guess, I am not happy not having a good understanding how it works.
The Map control intercepts and handles Manipulation events and as such you don't get all of them. Remember, once routed events are marked at e.Handled=true they no longer bubble up.
Depending on your Scenario WP8 exposes the UseOptimizedManipulationRouting property which might prove useful. Setting UseOptimizedManipulationRouting=false causes Map, Pivot and other controls to not swallow events for nested controls.
If that doesn't help, have a look at the following Nokia Wiki article where the author ran into the same problem as you did and used Touch.FrameReported to get out of it # http://www.developer.nokia.com/Community/Wiki/Real-time_rotation_of_the_Windows_Phone_8_Map_Control

Window settings for Google Maps widget

I've got a plain-vanilla google maps widget sitting in a page and I'd like it if the driving directions opened up in a new window instead of taking over the current window. Is there a setting for this?
The driving directions go into whatever HTML element you specify as the second argument when you construct the GDirections object. So I guess that means you'd have to create the window before you create the GDirections object, which is likely not what you want.
The other thing that jumps out, looking at the documentation, is that you can call the load() method with the option getSteps = true. It's not clear what the "steps" data looks like, but I assume it essentially comes back as an HTML string. (Actually, it's not even clear how you get the data in the first place, but I assume it's GDirections.getSteps() or something similar.) So then when the "load" event happens, you can create the new window then put the "steps" data in it.