React google maps /api - google-maps-markers

I made a Google Maps map with a draggable marker in react. When the user drags the marker, I need to know the new latitude and longitude.
How can I retrieve the new coordinates?
I don't understand what is the best approach to doing that in react.

Related

How to rotate pushpin image in bing map?

I am trying to rotate the pushpin image base on the degree for example "120" to show which direction it is going.
var pushpin = new Microsoft.Maps.Pushpin(curlocation, {
icon: '/images/Airplane_icon.png',
anchor: new Microsoft.Maps.Point(20, 20),
color: 'red'
});
It is possible to rotate a pushpin in Bing Maps but requires a bit of code to achieve. There is a code sample here: https://bingmapsv8samples.azurewebsites.net/#Pushpin_RotatedImage This approach would work fine for a few pushpins, but if you have a lot of pushpins that all have difference rotations, or the rotation of a pushpin is updated frequently, this solution likely wouldn't be the best option.
Another consideration is to take a look at Azure Maps which is another Microsoft mapping platform which does support rotating icons on the map. Here is a sample: https://azuremapscodesamples.azurewebsites.net/index.html?sample=Symbol%20Layer%20Options (click on the icon options tab and move the rotation slider). Azure Maps can handle dynamic rotation values on large data sets easily. Here are a couple of related examples: https://azuremapscodesamples.azurewebsites.net/index.html?sample=Animate%20a%20Symbol%20along%20a%20Path
https://azuremapscodesamples.azurewebsites.net/index.html?sample=Add%20Arrow%20along%20a%20Path

d3 globe as leaflet layer?

I am working on a mobile-friendly geolocation web app for backpackers. I already use D3 for data vis and Leaflet to navigate Google Maps (and other map layers). My app has features for offline use, such as saving coords to localstorage then uploading them when an internet connection is found.
I'm currently considering using d3 to plot GPS coordinates onto an svg map projection, effectively allowing me to have an offline world map which can display the users approximate location. Here are 2 demo's I've found which use GPS coords:
http://www.kgryte.com/gists/d3/maps/places/
http://dwtkns.com/pointplotter/
My question is: Would it be possible to integrate something like the d3 globe in the first link with Leaflet as a Layer?
My reason for this is I would use the SVG map as a backup for offline use, but I'd like to get Leaflet to handle markers, marker popups, zooming etc. I would get both solutions working off the same dataset for marker locations and content, so it's 'just' a case of swapping out the map.
Are there any demos/plugins for something like this? Is Leaflet only for tile-based maps?

Mapping user input from one DOM element to the renderer element using Three.js and TrackballControls.js

I am trying to create a small container where the user will be able to move the mouse/drag his finger in order to control the renderer DOM element, in another container. The problem is that TrackballControls.js, a controller script included with THREE.js, maps the controls to event.clientX and event.clientY, so when I drag with in the small container I created, I don't see the desired effect. I was wondering what a proper way to map the input from a small area and effect the renderer element as if the user had the entire rendering area to give input?
The reason I need to do this is because I am integrating a CSS3D view into a normal, 2D page, and the mobile experience is awful if I do not disable to touch controls on TrackballControls.js- the user will be scrolling down the page as normal, and when he hits the 3D div, the 3D controls take over and the user can no longer scroll out of that area back to the rest of the page content. So I need a little small area where the user can spin, zoom, and pan my 3D visualization but then be able to scroll on the rest of it to escape.
Thanks!

Bing Maps optimal zoom

I'm developing an app using Silverlight control for Bing Maps.
User can search a location entering a description and pressing a button: Geocode service returns a Location array I use to set map center.
What I'm not able to do is to display map with optimal zoom after search.
I mean, if I search for Italy, map should set mapview to enclose whole Italy; if I search for Venice zoom should be higher and show me the whole city; finally if I search for a street I'd like to see the whole street (if zoom is not too high naturally).
Because of user can zoom in/out before a search, I need to reset zoom everytime... but I didn't find a way to understand which is optimal zoom.
If you're using Bing geocoding services, I would recommend using the GeocodeResult.BestView property with the MapCore.SetView method.
I can't test it right now, but it should do the job.

openlayers updating a layer based upon viewable area

For a project we are wishing to use use openlayers. I know how to plot points and have a popup bubble. However since there is going to be quite a lot of points plotted on the map for the UK. What i am wanting to do is send the central point of the viewable area and in the backend send a layer update of all the points in the current viewable area. In openlayers is there anyway of doing this?
Yes. You can either use a WMS server to serve maps as images, or use the BBOX Strategy to only get the content within the viewport.

Resources