google-maps-markers

Dynamic Markers - Google Maps API - Markers not incrementing with i value in loop

我的未来我决定 提交于 2019-12-02 07:24:46
I have created the maps api below and have an array of addresses that come from a database. The map loads correctly, however I have the following issue. The dynamic Markers are not incrementing with the value of "i".. so the map displays all markers with "1" and not "1,2,3,4,5" // Define Vars var pinColor = "FE7569"; var marker, i; // Set default map center location var latlng = new google.maps.LatLng(-27.79014,153.18049); // Create pinShadow for each marker var pinShadow = new google.maps.MarkerImage("http://chart.apis.google.com /chart?chst=d_map_pin_shadow", new google.maps.Size(40, 37),

Any change in zoom level causes all my markers to re-appear on my Google map

痞子三分冷 提交于 2019-12-02 07:24:26
问题 Any change in zoom level causes all markers to appear on the map that have been on the map at any time since the last page load. This is true whether the zoom level change is due to a setZoom() call in my code or because I operate the zoom slider. I have a map control widget with buttons to add markers that correspond to different categories. So you click the button for Groups and the map populates with markers that represent Groups. Then you click on the Individuals button and the Groups

Drag Polyline onMarkerDrag Android Google Maps v2

冷暖自知 提交于 2019-12-02 06:39:46
问题 I'm currently developing an android application that would allow users to draw Polylines with Markers on the map. Right now, I would like to implement a feature whereby the polyline will be draggable whenever the marker is being dragged and update the Polyline when the onMarkerDragEnd() method is being called. Does anyone know how I can achieve this? Below is a snippet of my codes. Thanks! googleMap.setOnMapClickListener(new OnMapClickListener(){ @Override public void onMapClick(LatLng point)

add marker with Google-Maps-for-Rails

痴心易碎 提交于 2019-12-02 06:32:57
问题 I was playing with https://github.com/apneadiving/Google-Maps-for-Rails and i'd like to clear all the marker on a map and add a new one at the position clicked by the user on the map, I added the following code in my page <script type="text/javascript" charset="utf-8"> function gmaps4rails_callback() { google.maps.event.addListener(Gmaps4Rails.map, 'click', function(object){ alert(object.latLng); }); </script> And in this way i can see an alert with the lat and long value, now how can i

Google Maps - Create a polygon around existing markers

心不动则不痛 提交于 2019-12-02 06:09:37
问题 I dont know if this is possible but I use a google map to plot out positions of entities via markers on an overlay. I would like to be able to create a polygon or some other sort of overlay object around all the created markers, highlighting the extent of the markers, sort of a catchment area diagram. I wont know before all the markers are retrieved from the database and mapped what the extent is. Anyone have any ideas how to approach this..? Thanks 回答1: I think you are looking for the Convex

GoogleMap Markers are Not Clickable on the Mobile Devices

丶灬走出姿态 提交于 2019-12-02 06:09:19
问题 GoogleMap Markers are Not Clickable on the Mobile Devices (Touch Screens). But, ok on any PC, so I can't figure out what is the point. Here is my code: var map = new google.maps.Map(document.getElementById('map'), { zoom: 10, center: new google.maps.LatLng(60.037760, -44.100494), mapTypeId: google.maps.MapTypeId.ROADMAP }); var locations = [ ['4lvin', 60.074433, -44.011917], ['5irius', 60.037760, -44.100494] ]; for (var i = 0; i < locations.length; i++) { var marker = new google.maps.Marker({

How do I clean up an InfoWindow when the associated Marker is hidden?

╄→гoц情女王★ 提交于 2019-12-02 05:49:49
问题 I know that many of us are writing code to open an InfoWindow when a marker is clicked. But the InfoWindow will stay in place until the upper-right X is clicked, which means that setting the associated Marker visibility to false will create what is essentially an orphaned InfoWindow . And there could be multiple InfoWindow instances displayed on the Map at the same time. I guess it's simple enough for the user to just click the InfoWindow closed, but it feels like hiding the Marker should

Google Map from SQL Database

不打扰是莪最后的温柔 提交于 2019-12-02 05:37:45
I have a set of coordinates in a database that I want to be used to add markers on a google map. How would I go about doing this? I have my code set up to look like: http://www.macrostash.com/2011/09/17/demo-use-a-php-mysql-database-to-load-markers-on-a-google-map/ and the database set up the same way. However the example isn't working well. I am fairly new to this so any help would be appreciated. Thanks That's a good tutorial! I got it to work using sourcecode links from the broken demo site. Handy, and I've been looking for a source like this. You need to organize your datatable fieldnames

How to add multiple (separated with a plus symbol) waypoints to a map

不羁的心 提交于 2019-12-02 05:18:24
Thanks to geocodezip , I have managed to create a map with directions functionality and XML markers loaded. There is a problem left though: How can I add waypoints to it? They should be separated by plus symbol or something else appropriate. Here is the current code: <script type="text/javascript"> //<![CDATA[ // global "map" variable var map = null; var rendererOptions = { draggable: true }; var directionsDisplay = new google.maps.DirectionsRenderer(rendererOptions);; var directionsService = new google.maps.DirectionsService(); // A function to create the marker and set up the event window

Use Google Maps API MapView without permission

你离开我真会死。 提交于 2019-12-02 04:37:31
Does anyone know if it's possible to use the Google Maps API for Android's MapView without giving it location permission? I just want to render a map and place a marker on it. I am not asking for the user's location in any way. I cannot use the MapFragment because I am housing this view inside another Fragment, and nested fragments aren't supported until Android 4.2. Per the specify Android permissions section : The following location permissions are recommended, but you can omit them if your application doesn't access the user's current location, either programmatically or by enabling the My