Jumping markers on Google maps - ruby-on-rails

I'm building a small site that uses Rails 4 and Gmaps4Rails gem to add a Google Map to the page.
It works quite well except that the markers that are placed on the map based on their geo coded location jump around when I pan or zoom the map. What I mean with this is that the same marker ends up at a slightly different location!
The markers are based on the map's boundary, i.e. I use Geokit to get the markers that are visible on the current map. This process is triggered every time the map becomes idle, i.e. stopped panning or zooming. So, the markers will be replaced - old ones are removed and new ones are added.
My expectation is that the same marker would end up at the same location every time it is added to the map. It does not! Is this a well known "feature" or maybe I have something wrong on my side?
I use Rails 4.0.1 and Gmaps4Rails 2.1.0.
Please let me know what other information I can share in order to find out what I might have done wrong on my side.
Thanks in advance!

Its a feature to prevent overlapping. Its documented in the code here.
You can customise or remove the behaviour, example:
handler = Gmaps.build('Google', { markers: { maxRandomDistance: null } });

Related

iOS How can I move googlemap marker to the front?

I added two marks on Google maps. Now the two markers are overlapping. I want the selected marker to be always in the front. That means when you select a marker this marker covers another marker. I looked at the Google maps development documentation, which does not provide the relevant API.
How can I do this?
A simple resolution is using the propertie zIndex, just set to 1.
customMark.zIndex = 1
For more informations, you can see https://developers.google.com/maps/documentation/ios-sdk/reference/interface_g_m_s_marker

Draw a square or a curb line on Google Maps using iOS SDK

I am trying to enhance Google Maps bit deeper. I want to draw a curb line or you can say square on GMSMapview.
How ever I have tried to draw a lines using GMSPolygon. Lines are drawn as well but also want to get touch event when anyone wants to touch curb line I should get some event.
I am not sure at this moment that Google Maps will fulfil my requirements or not.
P.S : I have used google maps already in my app and now want to draw curb line(square) and should be notified when user tap on it and I should also have facility to clear that curb line from map.
You can user the delegate method mapView:didTapAtCoordinate to get the coordinate and then use the method GMSGeometryIsLocationOnPath or GMSGeometryIsLocationOnPathTolerance in the GMSGeometryUtils module
As an alternative, as long GMSPolygon is an GMSOverlay, you can use the delegate method mapView:didTapOverlay: to check if the coordinate lies on the path

Highmaps redraw bug after update points (with enabled zoom)

I found this highmaps version with lat/lon support (http://github.highcharts.com/latlon/highmaps.js) and then i created example to show what's happened when i try to zoom map and update points of the map dynamically. The common problem is that the points on the map are draggable (in the current zoom position) after update() method of point.
My example: http://jsfiddle.net/f97jkgz6/67/
I think function map.redraw() does not work properly, when zoom of map is enabled and more than default value.
Please, help me to find the solution of this problem.
Ok. I found the solution. This was a bug of highmaps library. Now with version 1.1.0 or higher redraw() function works properly.
This is updated fiddle: http://jsfiddle.net/f97jkgz6/69/

Simple marker clustering on apple map

Hello I want to do Pin point's clustering on apple map. What is the possible solutions of it.Now the apple map with one pin point is display on my screen. What is the code after it for Pin point's grouping. Thanks in advance
A possible (and successful, I'm using it at work) solution for clustering/displaying lots of points on a map is
http://robots.thoughtbot.com/how-to-handle-large-amounts-of-data-on-maps

CSS Zoom in Google Maps with iOS / Phonegap

I have an iPad App which includes a Google Map. On that Map I can draw lines and place markers with Google Map API V3. All done with jQuery Mobile and PhoneGap.
The Problem I have is that I need a higher Zoom on the Map, than Google provides me.
I did that with setting CSS scale to the Google Map div. The Zoom is working.
The problem is:
If I place Markers on the zoomed Map they are not on the Place, where I click. They appear somewhere else on the map, because of the Div Zoom is changing coordinates.
If I scale the App on iPad, it is working. However I only want to scale the map and not the whole app.
Thanks for any help or ideas.
Use the <meta name="viewport"> tag to control scaling.
Don't use CSS zoom. Use the setZoom method on the Map object in the Maps API.
See the reference.
I would change your approach by using the zoom CSS property (which should be supported by iOS WebKit) instead of a CSS transform. So your FSuperZoom function becomes
function FSuperZoom(wert) {
ZoomWert = wert/10;
$("#map_canvas > div > div:first-child").css("zoom",ZoomWert);
}

Resources