google-maps-api-3

Custom Google Map won't show in div element

北战南征 提交于 2020-01-25 09:49:26
问题 I'm trying to customize google map but I have a small problem. Here is the css code: #map-canvas { width: 100%; height: 500px; } and the js code: <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script> <script> function initialize() { var myLatlng = new google.maps.LatLng(-25.363882,131.044922); var mapOptions = { zoom: 4, center: myLatlng } var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); var marker = new google.maps.Marker({

async-await not working when exporting Google distance Matrix from a class

元气小坏坏 提交于 2020-01-25 09:18:06
问题 I'm using the google places autocomplete and the Distance Matrix to put two locations in and print out the distance between the two. I have two javascript es6 classes to separate the Google API's as services. My problem is I'm trying to await the response on getting the distance from the distance matrix service then log it to the console, but I get undefined when I log it. the distance matrix service is returning the response after I log it. This must mean that my await in the method is not

Mouse scroll not working on appended div on Google map

血红的双手。 提交于 2020-01-25 02:05:18
问题 I have added a fixed marker in center of Google map: css for div: .centerMarker{ width:30px; height:60px; margin:auto; position:absolute; top:50%; left:50%; z-index:2; background:url('fixedMarker.png') no-repeat center; background-size:30px 60px; margin-top:-60px; margin-left:-15px; } Script to add div to the map: $('<div/>').addClass('centerMarker').appendTo(map.getDiv()) This causes the scroll (for zoom) not working on the appended div (but works on other parts of map). How can I make the

Mouse scroll not working on appended div on Google map

拈花ヽ惹草 提交于 2020-01-25 02:03:41
问题 I have added a fixed marker in center of Google map: css for div: .centerMarker{ width:30px; height:60px; margin:auto; position:absolute; top:50%; left:50%; z-index:2; background:url('fixedMarker.png') no-repeat center; background-size:30px 60px; margin-top:-60px; margin-left:-15px; } Script to add div to the map: $('<div/>').addClass('centerMarker').appendTo(map.getDiv()) This causes the scroll (for zoom) not working on the appended div (but works on other parts of map). How can I make the

Can I force Google Maps to draw polygons with overlapping paths as a union rather than intersection?

瘦欲@ 提交于 2020-01-25 00:58:10
问题 I'm working on a custom Google Map where I need to have place marks made up of several polygons. When I was using a KML file, the polygons would union together, however I had to abandon KML due to the need to present the infowindow programmatically from other items on the page. Now that I'm drawing polygons directly (new google.maps.Polygon) I find that sometimes the items are joined via union and somethings via intersect. This appears to be related to how much overlap there is. My polygons

Don´t preload images in XML (google maps API v3)

我的梦境 提交于 2020-01-24 23:43:27
问题 Hey i have a question that seems very tricky. I want to add images for every Infowindow in my map. But the clue is that the images shouldn't parse directly from the XML, because if there are 300 markers and for every marker an image, that would by a very big data which have to load on mapstart. Is it possible to load the image only if the marker has cliked ? Heres my code: <script type="text/javascript"> var side_bar_html = ""; var sidebarMarkers = []; var infoWindow = new google.maps

MissingKeyMapError when configuring Google Maps API

强颜欢笑 提交于 2020-01-24 22:50:30
问题 I am trying to configure the Google Maps API key on my website like this: <div class="rd-google-map"> <div class="border-bottom"></div> <div id="google-map" class="rd-google-map__model" data-zoom="10" data-x="77.079627" data-y="28.643150"></div> <ul class="rd-google-map__locations"> <li data-x="77.079627" data-y="28.643150"> <p>58, Ist Floor, DDA Local Shopping Centre, Block J, Vikaspuri, Delhi, 110018</p> </li> </ul> </div> I get the following error: "Google Maps API error:

Wordpress Geocoding using direction or a map

给你一囗甜甜゛ 提交于 2020-01-24 16:18:39
问题 I'm trying to make a Wordpress page where the user can point to a location by writing the adress or browsing a map`. As you can see in the page (http://www.levinor.es/pruebas/pagina-ejemplo/) the map isn't loading and I don't know why... I checked the API Key, and the allowed domains ( .levinor.es/ ) of the key... Please I need some help... To do so I created this javascript (google-maps.js) and placed it in the script folder of my theme: //Declaramos las variables que vamos a user var lat =

How to get some information in google maps without click event on marker and show this in a div, other than infoWindow

雨燕双飞 提交于 2020-01-24 07:17:49
问题 Hi I am showing some markers on my google map and on click of the marker, I am calling the click event and showing some info about that place to the right side(area other than Map and not as an infoWindow). Now this event gets fired on click, and by default when page loads my div remains blank, How can I have the div the basic information being shown up once the map loads up. I need to show the information that corresponds to the marker that is the center point of the map, and later when the

Custom Markers in Google Maps not Showing up in Firefox

☆樱花仙子☆ 提交于 2020-01-24 02:08:31
问题 I have a map that I have created in rails using the google maps for rails gem. It works in Chrome and Safari but it does not display custom .svg markers in Firefox 29. It does display the custom image for clusters (which is a png). I have bumped into a number of threads from the far past (FF 8 and 9) that said there was an issue that was resolved in 9 or 10 related to cors. However, it does not seem like it has been an issue for awhile, and especially not for 29. Does anyone know if this is a