google-maps-markers

In Google Maps V3, how can I get a draggable marker to pan the map?

时光总嘲笑我的痴心妄想 提交于 2019-12-02 23:05:11
I have found several V2 examples of how to pan the map while a marker is being dragged. For example: http://www.putyourlightson.net/projects/coordinates // create map and add controls var map = new GMap2(document.getElementById("map")); map.addControl(new GLargeMapControl()); map.addControl(new GMapTypeControl()); // set centre point of map var centrePoint = new GLatLng('53.34870686020199', '-6.267356872558594'); map.setCenter(centrePoint, 14); // add a draggable marker var marker = new GMarker(centrePoint, {draggable: true}); map.addOverlay(marker); // add a drag listener to the map GEvent

Best way to display a custom Google maps multiple image marker icon

一世执手 提交于 2019-12-02 23:01:13
问题 I have two images, one is like an icon and the other is the icon background, what is the best way to combine these two images and make a google marker v3 icon? They are not svg or paths, they are just two png images. 回答1: Simplest way: Use an image editor to make a single image and use that as the icon for your custom marker. If you can't or don't want to do that you can make a custom overlay (reference) that behaves like a marker and use it to overlay the two images in the correct order on

Google Maps API v3 SVG markers disappear

做~自己de王妃 提交于 2019-12-02 22:33:05
I am using SVG path notation to create markers along with a polyline using Google Maps API v3. Sometimes, after adding a few markers, they just stop showing from the map. If I pan the map, even just 1px, they show again. SVG markers stop showing after adding a few SVG markers show again after pan This happens in FF, Safari, Chrome and iPhone browsers. Here is my code for the polyline: var lineSymbol = { path: g.SymbolPath.FORWARD_OPEN_ARROW, scale:1.5 }; polyOptions = { strokeColor: '#0026b3', strokeOpacity: 1.0, strokeWeight: 1, geodesic: true, icons: [{ icon: lineSymbol, repeat: '100px' }],

X marks along the direction

北城余情 提交于 2019-12-02 21:53:36
问题 I have never worked with Google maps API. For the school project I am working on; I need to get a direction between two locations (this is easy part and I think I can do this), However I also need to put an X mark; at every 10 miles along the way. Is this even possible? Thank You. 回答1: Ok, here's a working solution that draws markers every 200 miles (I was working on big distances to check it worked on geodesic curved lines, which it does). To make this work for you, just change all the

Drop marker slowly from top of screen to location on android map V2

拜拜、爱过 提交于 2019-12-02 21:30:34
I am using android maps v2works fine I can add and remove markers onLong Touch on locations. Problem: I would like to drop the marker slowly into the touched location i.e. I want the user to see the marker floating from the top of the screen to the point where it is dropped(touched location). Currently; the marker just appears on the touched location such that you have to lift you finger to see that it has been dropped. It would be nice to see it coming from the top of the screen. Thanks. You can achieve this with a code similar to this (untested): final LatLng target = ...; final long

How to correct smooth moving the marker in google maps v2?

北战南征 提交于 2019-12-02 19:49:08
In my application needs to display a smooth "move" google maps marker from one point to another. I use the following method for the animation: public void animateMarker(final Marker marker, final LatLng toPosition, final boolean hideMarker) { final Handler handler = new Handler(); final long start = SystemClock.uptimeMillis(); Projection proj = mMap.getProjection(); Point startPoint = proj.toScreenLocation(marker.getPosition()); final LatLng startLatLng = proj.fromScreenLocation(startPoint); final long duration = 500; final Interpolator interpolator = new LinearInterpolator(); handler.post(new

How to create multiple infowindow in google map api

爷,独闯天下 提交于 2019-12-02 19:12:17
I create 3 markers in the map whose data comes from a json. but when I click on a marker and try to open the Info window only the last marker will response correctly.. please help me.... this the code.... <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script> <script type="text/javascript" src="js/jquery-1.8.3.min.js"></script> <script src="http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/src/markerclusterer.js" type="text/javascript"></script>

Change Google map marker orientation according path direction

≯℡__Kan透↙ 提交于 2019-12-02 18:38:16
问题 I'd like to know if it possible to change the marker orientation according the path drawn on the map. Here is a example: As you can see the marker is a car (with front bumper and tail lights). I'd like to orientate the car in the direction the path is going (in this exemple orientate the car around 45 degrees to the right). I'm using DirectionsService to draw the path and I have a random number of point. Sometime only one, sometime 10 points. I'm adding the markers before drawing the paths.

How to use Google Maps to search my own location data (Same functionality as Places search API, but for my own “places”)

非 Y 不嫁゛ 提交于 2019-12-02 17:44:06
See related question: google maps custom local search / search control I know I can create Custom Locations and Information Windows in a Google Map e.g. http://code.google.com/apis/ajax/playground/#info_windows_sharing_v3 And I understand that Local Search can find near-by places (public ones) e.g. http://code.google.com/apis/ajax/playground/#localsearch_with_markers However my question is simple: how do I combine both? How do I enable the same as the local/places search functionality but only on custom marker locations (e.g. my own location data rather than Google's places/local data)? For

Open URL from custom info window, Android Google Maps V2

孤街醉人 提交于 2019-12-02 17:28:28
问题 I am using android google maps api v2 with many markers displayed on it. Each time you click on a marker a custom info window with specific tittle/snippet is open. The problem is that I cannot click on the URL "www.news.com". Please find below the options of my marker. How can I specify that the "www.news.com" is a HTML URL link inside the .snippet attribute, and when user clicking on it to open directly in mobiles explorer? mMap.addMarker(new MarkerOptions() .position(new LatLng(39.686286,