google-maps-markers

InvalidValueError: not an instance of HTMLInputElement

有些话、适合烂在心里 提交于 2019-11-27 02:06:25
问题 FYI, I'm not a JavaScript Ninja but felt like I'll become one when I did a lot of things based on Google Maps recently. I implemented a map. User can search for google places and place a marker for it. there's a text box for that. Or user can click on the map to place a marker to the place he's looking for or drag the marker. Code remains the same. Design changed. Input field's id and name also same. No change to JS code. But this thing ain't working. Here's the website Google map is

move marker on google maps api 2

十年热恋 提交于 2019-11-27 00:47:30
问题 How do I move marker on Google maps api V2 ? I am using below code but it does not move marker on the map. What am I doing wrong here ? This should work when location changes, so I have added onLocationChanged method and in that, am getting location details and trying to move marker on new details, but this doesn't work. Here is my code: import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common.GooglePlayServicesUtil; import com.google.android.gms.maps

Rotate marker as per user direction on Google Maps V2 Android

淺唱寂寞╮ 提交于 2019-11-27 00:38:45
问题 I want to rotate marker as per bearing or sensor value received from Accelerometer to show the user where actually he is moving. I have set marker icon and flat value to true but its not working as required. mCurrentLocationMarker.position(new LatLng( LocationUtils.sLatitude, LocationUtils.sLongitude)); mCurrentLocationMarker.icon(icon); mCurrentLocationMarker.flat(true); mCurrentLocationMarker.rotation(LocationUtils.sBearing); if (currentMarker != null) { currentMarker.setPosition(new LatLng

Change marker size in Google maps V3

旧时模样 提交于 2019-11-27 00:37:31
I am using this explanation of how to color a google maps marker by setting the icon using a MarkerImage , and the coloring works well. But I can't make the scaledSize argument change the size of the marker. var pinColor = 'FFFF00'; var pinIcon = new google.maps.MarkerImage( "http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=%E2%80%A2|" + pinColor, new google.maps.Size(21, 34), new google.maps.Point(0,0), new google.maps.Point(10, 34), new google.maps.Size(2, 4)); marker.setIcon(pinIcon); What is the correct use of the scaledSize argument to change the marker size? For example, how

Using Icon Fonts as Markers in Google Maps V3

风流意气都作罢 提交于 2019-11-27 00:21:13
I was wondering whether it is possible to use icon font icons (e.g. Font Awesome) as markers in Google Maps V3 to replace the default marker. To show/insert them in a HTML or PHP document the code for the marker would be: <i class="icon-map-marker"></i> Here's my attempt at the same thing (using "markerwithlabel" utility library) before I realised Nathan did the same more elegantly above: http://jsfiddle.net/f3xchecf/ function initialize() { var myLatLng = new google.maps.LatLng( 50, 50 ), myOptions = { zoom: 4, center: myLatLng, mapTypeId: google.maps.MapTypeId.ROADMAP }, map = new google

Change Google map marker orientation according path direction

喜夏-厌秋 提交于 2019-11-27 00:15:11
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. Here is how I'm drawing the path: // Intialize the Path Array var path = new google.maps.MVCArray(); //

Javascript, Change google map marker color

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-26 23:59:51
问题 May I know a way to change the Google Map marker color via Javascript.. I am new at this and any help would be much appreciated, Thank you. I used the following code to create a marker marker = new google.maps.Marker({ position: new google.maps.LatLng(locations[i][1], locations[i][2]), animation: google.maps.Animation.DROP, map: map }); 回答1: In Google Maps API v3 you can try changing marker icon. For example for green icon use: marker.setIcon('http://maps.google.com/mapfiles/ms/icons/green

Auto-center map with multiple markers in Google Maps API v3

纵然是瞬间 提交于 2019-11-26 23:45:26
问题 This is what I use to display a map with 3 pins/markers: <script> function initialize() { var locations = [ ['DESCRIPTION', 41.926979, 12.517385, 3], ['DESCRIPTION', 41.914873, 12.506486, 2], ['DESCRIPTION', 41.918574, 12.507201, 1] ]; var map = new google.maps.Map(document.getElementById('map'), { zoom: 15, center: new google.maps.LatLng(41.923, 12.513), mapTypeId: google.maps.MapTypeId.ROADMAP }); var infowindow = new google.maps.InfoWindow(); var marker, i; for (i = 0; i < locations.length

Selecting last element in JavaScript array [duplicate]

时光总嘲笑我的痴心妄想 提交于 2019-11-26 23:25:28
This question already has an answer here: Get the last item in an array 44 answers I'm making an application that updates a user's location and path in real time and displays this on a Google Map. I have functionality that allows multiple users to be tracked at the same time using an object, which is updated every second. Right now, when a user pressed a button in the Android app, the coordinates are sent to a database and each time the location changes, a marker is updated on the map (and a polyline is formed). Since I have multiple users, I send a unique and randomly generated alphanumeric

How to attach a flexible marker on map something like Uber and Lyft?

扶醉桌前 提交于 2019-11-26 23:22:41
问题 How to attach a flexible marker on map something like Uber and Lyft ? am using Google maps v2. Basically, i want to display a marker on map while the position of the marker is changed upon moving the map. edited: Ok i solved my problem. first : add an imageview to the same layout and position equal to center. second: to get the coordinate of the center of the map use the following approach 1- get viewgroup ( FrameLayout ) in my case where the map fragment is located. FrameLayout myContainer =