google-maps-api-3

Google Map API - Directions Service does not auto zoom when the map in a modal

北城余情 提交于 2020-01-16 08:04:09
问题 I have the following function to show direction between 2 lats and lngs to user $(document).ready(function(){ initialize_direction(); }); function initialize_direction() { var directionDisplay; var directionsService = new google.maps.DirectionsService(); var direction_map; directionDisplay = new google.maps.DirectionsRenderer(); var myOptions = { mapTypeId: google.maps.MapTypeId.ROADMAP, } direction_map = new google.maps.Map(document.getElementById("direction_canvas"), myOptions);

How to make a PhoneGap application save current geolocation less often?

≯℡__Kan透↙ 提交于 2020-01-16 05:17:05
问题 I'm working on an app for fun which allows you to record routes you take. I'm using this to learn about the Google Maps API as well as Phonegap Build, so those are the tools I'm using here. I made a rudimentary app which collects position data (lat,lng) into an array, then uses Google's API to display the results on a map. In the future I'd like to connect them with a line, allow comments, et cetera. Here's what a drive around my neighborhood looks like: Pretty neat. However, something's

Google Maps API v3 draggableCursor options such as position

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-16 05:01:04
问题 This is a long shot, but I was wondering if there were any settings in Google Maps API v3 that would allow me to set where on my custom "draggableCursor" the tip/end (for lack of a better word) of the cursor should be. The default settings seem to be that the top left hand corner of the image is the cursor point, but I want it to be the bottom left hand side. Here is my code so far: map.setOptions({ draggableCursor: 'url(images/markers/you_marker.cur), default' }); 回答1: The hotspot for a

mouse event of infowindow in google map api

喜夏-厌秋 提交于 2020-01-16 03:49:05
问题 Is there any mouse event on infowindow of google map api v3. Like closeclick event. Actually i m closing the info window after 3 seconds. but i want that if mouse pointer is over infowindow then it should not be close plesae give me example to do it.. Thank you very much. My Code is written as follow--- function generateMarkers(locations, is_paid) { var marker; for (var i = 0; i < locations.length; i++) { var marker; for (var i = 0; i < locations.length; i++) { createMarker(new google.maps

Google Maps Info window resizing

杀马特。学长 韩版系。学妹 提交于 2020-01-16 02:10:44
问题 I have a API V3 map, with a content window for each marker. Each marker has an info window containg a .SVG file. The content of the infowindow stretches across multiple lines, but the infowindow does not resize to fit it all, causing an iframe-like scroll to appear. Also i can't even close the info windo. Is there anyone help me how to fix my problem. Here is my code function initialize(){ var myCenter = new google.maps.LatLng(36.4333, -117.9509); var sfv = new google.maps.LatLng(34.18258,

Reducing global variables and maintaining function flow

可紊 提交于 2020-01-15 15:34:04
问题 Javascript is not my first language of choice, nor is it one I am all that well versed in. Functional stuff fine, objects, not so much. I am looking to see if anyone can suggest options for dealing with the following scenario. function postcodeEntry(destination,postcode) { "use strict"; document.getElementById('googlemappostcode').innerHTML = <?php if ($_GET['page']==="fun") echo "<div id=\"map\"></div>' + ";?>'<form id="postcodeEntry" method="post" action="/" onsubmit="calcRoute(\'driving\'

Reducing global variables and maintaining function flow

自作多情 提交于 2020-01-15 15:33:59
问题 Javascript is not my first language of choice, nor is it one I am all that well versed in. Functional stuff fine, objects, not so much. I am looking to see if anyone can suggest options for dealing with the following scenario. function postcodeEntry(destination,postcode) { "use strict"; document.getElementById('googlemappostcode').innerHTML = <?php if ($_GET['page']==="fun") echo "<div id=\"map\"></div>' + ";?>'<form id="postcodeEntry" method="post" action="/" onsubmit="calcRoute(\'driving\'

Reducing global variables and maintaining function flow

巧了我就是萌 提交于 2020-01-15 15:33:57
问题 Javascript is not my first language of choice, nor is it one I am all that well versed in. Functional stuff fine, objects, not so much. I am looking to see if anyone can suggest options for dealing with the following scenario. function postcodeEntry(destination,postcode) { "use strict"; document.getElementById('googlemappostcode').innerHTML = <?php if ($_GET['page']==="fun") echo "<div id=\"map\"></div>' + ";?>'<form id="postcodeEntry" method="post" action="/" onsubmit="calcRoute(\'driving\'

Reducing global variables and maintaining function flow

房东的猫 提交于 2020-01-15 15:33:49
问题 Javascript is not my first language of choice, nor is it one I am all that well versed in. Functional stuff fine, objects, not so much. I am looking to see if anyone can suggest options for dealing with the following scenario. function postcodeEntry(destination,postcode) { "use strict"; document.getElementById('googlemappostcode').innerHTML = <?php if ($_GET['page']==="fun") echo "<div id=\"map\"></div>' + ";?>'<form id="postcodeEntry" method="post" action="/" onsubmit="calcRoute(\'driving\'

Google Map won't display points - XML is null

爱⌒轻易说出口 提交于 2020-01-15 11:32:06
问题 I'm developing a website that will read the lat and lng from the MySQL database that I've created to show them on Google Maps. I'm using this Google example as a reference. The table users from which I read the lat and lng has the following fields: user_id username password name address lat lng country institute email phone photo role This is the genxml.php that produces the XML output of the info. <?php include("database.php"); function parseToXML($htmlStr) { $xmlStr=str_replace('<','<',