javascript,google-maps,google-maps-api-3Related issues-Collection of common programming errors


  • John Snow
    javascript google-maps animation google-maps-api-3 google-maps-markers
    I have a simple javascript maps application that I’m working on that requires me to animate the movement of multiple markers between different coords. Each marker is free to move on its own and all markers are stored in an array list. However, I have been having trouble getting them to smoothly transition locations.I’ve done a ton of research and trial/error but no luck, anyone have any luck with this?

  • pvorb
    javascript node.js foreach v8
    I wanted to use for each … in with Node.js (v0.4.11).I use it like this:var conf = {index: {path: {first: “index.html”,pattern: “index/{num}.html”},template: “index.tpl”,limit: 8},feed: {path: “feed.xml”,template: “atom.tpl”,limit: 8} }for each (var index in conf) {console.log(index.path); }I get the following error:for each (var index in conf) {^^^^node.js:134throw e; // process.nextTick error, or ‘error’ event on first tick^ SyntaxError: Unexpected identifierat Module._compile (module.js:397

  • Peter Mortensen
    javascript programming-languages crockford
    This question already has an answer here:Calling member function of number literal3 answersI’m reading through Douglas Crockford’s JavaScript: The Good Parts, and I’m at the point where he defines a fade function. Part of this code boils down to this:var level = 1; var hex = level.toString(16);So I run this in my browser’s console to see what I get….var level = 1; level.toString(16);Hey, it returns “1”… Fabuloso! Wunderbar!Then to be cheeky, I try this to see what I get…1.toString(16);and

  • LukeS
    javascript jquery html scrolling mobile-browser
    I am trying to scroll to a specific location in a scrolling DIV. Right now I am using a pixel offset with the jQuery scrollTop() function which works great on desktop browsers but it does not work on android mobiles browsers with the exception of Google’s Chrome Android browser (do not have an iOS device to test if that works). All the solutions I have found are for page (window) scrolling and not for scrolling in a DIV, anyone have any suggestions on what else I can use to accomplish the same

  • muntoo
    javascript dhtml
    I want to create a simple bit of JS code that creates an image element in the background and doesn’t display anything. The image element will call a tracking URL (such as Omniture) and needs to be simple and robust and work in IE 6 =< only. Here is the code I have:var oImg=document.createElement(“img”); oImg.setAttribute(‘src’, ‘http://www.testtrackinglink.com’); oImg.setAttribute(‘alt’, ‘na’); oImg.setAttribute(‘height’, ‘1px’); oImg.setAttribute(‘width’, ‘1px’); document.body.appendChild(

  • Tim
    javascript jquery asp.net ajax
    I have a modal dialog on my page using jQuery that a user enters a password into.It’s a standard jQuery dialog and it works fine. I have linkbuttons in a datagrid that open the dialog using this code:$(‘.needsVal’).click(function () {$(“#login1”).dialog(‘open’);id = $(this).attr(‘id’);return false;});The problem is later on in the page I make an Ajax call, and based on the value returned, I want to selectively fire a postback for the page. The problem is the postback never fires. My postback cod

  • Marek Lipka
    javascript ruby-on-rails heroku
    So I’m a newbie and I am having issues deploying my code onto Heroku. I keep getting this error response. It looks like a JS Parse Error, which I have no idea what it could be. ANY help would be amazing. Thanks!I was successfully able to upload my previous application. I worry that it was because I tried to install some JQUERY plugins and it deleted the info inside my JS folderRunning: rake assets:precompileI, [2013-12-10T02:45:51.431542 #852] INFO — : Writing /tmp/build_63a972cd-66ca-44

  • khellang
    php javascript jquery ajax
    Basically I am trying to post a comment via AJAX and then load the new comment into the HTML. I am having a problem with what I think is my AJAX success function. The data gets added to the database fine, but I still get an error “Sorry, unexpected error. Please try again later.” as set inside the success function itself.JS:function newComment(event) { event.preventDefault();//Get the data from all the fieldsvar comment = $(‘textarea’);var product_id = $(‘input[name=product_id]’);var form

  • JrnDel
    javascript multidimensional-array
    I’m trying to construct a multidimentional array in javascript, so far without succes. I’ve read some other posts here on Stackoverflow, and read/watched tutorials on the subject, all have helped me but but I can’t get it to work.Most of the time I get the following error:Uncaught SyntaxError: Unexpected tokenBasically, I’ve got a form where the visitor of my website can input their age, bloodpressure, cholesterol and if they’re a smoker of not.riscTable = { ’68’: { // AGE’170′: { //

  • Connor Leech
    javascript angularjs gruntjs angularjs-ng-include
    When I deploy my unminified code everything works great. Then I run grunt build and deploy from the dist folder, as you do. When I check out one of the pages though it breaks and I get an error in the console: Error: [$parse:lexerr] Lexer Error: Unexpected next character at columns 0-0 [\] in expression [\]. http://errors.angularjs.org/1.2.6/$parse/lexerr?p0=Unexpected%20nextharacter%20&p1=s%200-0%20%5B%5C%5D&p2=%5Cat https://353a23c500dde3b2ad58-c49fe7e7355d384845270f4a7a0a7aa1.ssl.cf2

  • John Snow
    javascript google-maps animation google-maps-api-3 google-maps-markers
    I have a simple javascript maps application that I’m working on that requires me to animate the movement of multiple markers between different coords. Each marker is free to move on its own and all markers are stored in an array list. However, I have been having trouble getting them to smoothly transition locations.I’ve done a ton of research and trial/error but no luck, anyone have any luck with this?

  • Coen
    google-maps google-chrome google-maps-api-3 safari
    Test link: http://kwestievan.nl/reizenWhat I’m doing here: implemented my own OverlayView to draw curved lines from marker to marker with arrowheads at the end of each line with SVG. I add a div element to the map that is of a certain width and height to contain the line and arrowhead. I then put inline SVG code in that div to let the browser draw the line and arrow.If viewed in Safari or Chrome some very annoying and unexpected behavior occurs. In Safari the whole SVG graphic disappears beyond

  • Rocotilos
    iphone ios api google-maps mkmapview
    I am making an iphone app that enables users to search for a city/town/countries/states by keying in texts in a UISearchbar, I managed to get the reply from google via JSON. It works ok, but I have some unexpected replies for certain places.When I search for, say, “Vietnam”, “China”, “Malaysia”, “Indonesia” it gives 0 results. But when I search for, “Singapore”, “Cambodia”, then, it gives a result fine.I don’t get it, why does some countries aren’t available as the search results?Thanks.Codes:

  • RIDER
    javascript jquery google-maps google-maps-api-3
    I am trying to insert a button that when clicked brings up a Google Form (which is tied to my fusion table). The button is in the upper right hand corner. On my jsfiddle, the button works as expected and the div holding the Google Forms iframe pops up. But when I move all the code to the server, the button ceases to work. Here is the jsfiddle. And here is the same code on the server. It now produces unexpected results. $(document).ready(function() {$(‘.button2’).click(function() {type = $

  • AAA
    javascript jquery google-maps
    This question already has an answer here:Javascript closure inside loops – simple practical example18 answersI’m trying to iterate through an array, like so:var locs = [[‘Location 0’, 50, 91], [‘Location 1’, 50, 100] ];for (i = 0; i < locs.length; i++) {$(‘#’ + i).click(function(i) {map.panTo(new google.maps.LatLng(locs[i][1], locs[i][2]));})}But I get the unexpected identifier because of the way loops work in Javascript. I need it to iterate through the locs array. How do I do this? So frust

  • geocodezip
    android google-maps
    the docs say I can specify the following xml to define a v2 map…<fragment xmlns:android=”http://schemas.android.com/apk/res/android”xmlns:map=”http://schemas.android.com/apk/res-auto”android:id=”@+id/map”android:layout_width=”match_parent”android:layout_height=”match_parent”class=”com.google.android.gms.maps.SupportMapFragment”map:cameraBearing=”112.5″map:cameraTargetLat=”-33.796923″map:cameraTargetLng=”150.922433″map:cameraTilt=”30″map:cameraZoom=”13″map:mapType=”normal”map:uiCompass=”fals

  • S.P
    google-maps google-maps-api-3
    When the map is loading the location, e.g. waiting for geolocation access, the search box renders on the edge of the map like this Anyone know any tricks to stop this ? Either don’t show the box at all, or put the box in the map where it should be.As for code, even the Google example suffers from this problem: https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete

  • Lucica
    google-maps google-maps-api-3
    I have a problem display google maps in tabs,This is wath i have tried but no sucess, in IE works fine but in Firefox the tab is not showing corect and the line on Route Planner is not work-ing. Point A to Poin B – there shoud be a line..Please see this link: http://s1.xfactor-online.com/Wath i have done rong?This is my HTML <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”> <html xmlns=”http://www.w3.org/1999/xhtml”

  • choc
    ajax google-maps jquery-ajax google-maps-api-3
    I have a main page that uses ajax to load subpages and one of these subpages contains a google map, and so it loads the google maps api using the <script> tag:<script type=”text/javascript” src=”http://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&sensor=SET_TO_TRUE_OR_FALSE”>I noticed that this loads a bunch of css and js files into both my main page and subpage. When I click on a different link in my main page, I want to be able to unload all of these files and remove any js

  • Zac
    php javascript wordpress google-maps
    Is it possible (and if so please explain how) to echo php into javascript, specifically for my purpose I am trying to echo the input of a custom field from the wordpress platform into the description of a google map. I am hoping I can give the client a cms backend to input the text that appears in the marker points on a map. What I am trying with no success is:var point = new GLatLng(49.295308,-123.149297); var marker = createMarker(point,”Site Title”,'<div class=”maptext”><p class=”p

  • John Snow
    javascript google-maps animation google-maps-api-3 google-maps-markers
    I have a simple javascript maps application that I’m working on that requires me to animate the movement of multiple markers between different coords. Each marker is free to move on its own and all markers are stored in an array list. However, I have been having trouble getting them to smoothly transition locations.I’ve done a ton of research and trial/error but no luck, anyone have any luck with this?

  • Coen
    google-maps google-chrome google-maps-api-3 safari
    Test link: http://kwestievan.nl/reizenWhat I’m doing here: implemented my own OverlayView to draw curved lines from marker to marker with arrowheads at the end of each line with SVG. I add a div element to the map that is of a certain width and height to contain the line and arrowhead. I then put inline SVG code in that div to let the browser draw the line and arrow.If viewed in Safari or Chrome some very annoying and unexpected behavior occurs. In Safari the whole SVG graphic disappears beyond

  • RIDER
    javascript jquery google-maps google-maps-api-3
    I am trying to insert a button that when clicked brings up a Google Form (which is tied to my fusion table). The button is in the upper right hand corner. On my jsfiddle, the button works as expected and the div holding the Google Forms iframe pops up. But when I move all the code to the server, the button ceases to work. Here is the jsfiddle. And here is the same code on the server. It now produces unexpected results. $(document).ready(function() {$(‘.button2’).click(function() {type = $

  • S.P
    google-maps google-maps-api-3
    When the map is loading the location, e.g. waiting for geolocation access, the search box renders on the edge of the map like this Anyone know any tricks to stop this ? Either don’t show the box at all, or put the box in the map where it should be.As for code, even the Google example suffers from this problem: https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete

  • Oxydron
    javascript google-chrome google-maps-api-3 xmlhttprequest google-maps-markers
    This code it’s not displayed in Google Chrome. Why? It worked in Firefox.The code: I’m trying to load from a xml file a set of coordinates+description to render a map and plot them on it.And there’s a mouse handle to return on screen the coordinates on a mouse click.<!DOCTYPE html> <html lang=”pt-br”><head><link rel=”stylesheet” href=”maps.css”><div id=”map_canvas”></div><!– Loading jQuery –><script type=”text/javascript” src=”http://ajax.googleapis

  • Chris Palmer Breuer
    javascript html5 google-maps-api-3
    The problem that I occur has been different to solve for me, because I cannot find the solution. It works on my localost without any problems and error messages, but once I upload it to this webspace http://chris1904.bplaced.net/index.html I get the error message Uncaught SyntaxError: Unexpected token ILLEGAL and this is the line that the error points atgoogle.maps.event.addListener(map, ‘click’, function(event) {You can compare it to this site http://chris1904.webege.com/index.html It is the e

  • Lucica
    google-maps google-maps-api-3
    I have a problem display google maps in tabs,This is wath i have tried but no sucess, in IE works fine but in Firefox the tab is not showing corect and the line on Route Planner is not work-ing. Point A to Poin B – there shoud be a line..Please see this link: http://s1.xfactor-online.com/Wath i have done rong?This is my HTML <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”> <html xmlns=”http://www.w3.org/1999/xhtml”

  • choc
    ajax google-maps jquery-ajax google-maps-api-3
    I have a main page that uses ajax to load subpages and one of these subpages contains a google map, and so it loads the google maps api using the <script> tag:<script type=”text/javascript” src=”http://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&sensor=SET_TO_TRUE_OR_FALSE”>I noticed that this loads a bunch of css and js files into both my main page and subpage. When I click on a different link in my main page, I want to be able to unload all of these files and remove any js

  • Hassen Ch.
    gwt google-maps-api-3
    I am trying to use GWT Google maps API v3 I keep getting this error:Loading inherited module ‘com.google.gwt.maps.GoogleMaps'[ERROR] Unable to find ‘com/google/gwt/maps/GoogleMaps.gwt.xml’ on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source?[ERROR] Line 21: Unexpected exception while processing element ‘inherits’I have copied (to the lib directory) and added the [gwt-maps.jar][1] (Add external jars) I have added this line to the .gwt.xml : <inherits

  • Kara
    ios iphone google-maps-api-3 google-places-api
    I am trying to fetch the data from google place API.I have tried the url with one type,and getting the result.But when I give pipes to seperate the types I am getting Json Error.But I am getting the json array when I run this url on a browserWhat may be the issue ?? NSString *string = [NSString stringWithFormat:@”https://maps.googleapis.com/maps/api/place/search/json?location=10.76894,70.25412&rankby=distance&types=restaurant|park|hospital|school|bar&sensor=false&key=myKey”];NSUR

Web site is in building