Jquery :: Google Maps API Page Showing Error With IE6 / 7
Oct 22, 2009
I have a problem with javascript in IE6/IE7, or specifically with jQuery. There is a page that uses the google maps API which shows an error when you navigate to the website and the page remains blank. When I press refresh I get no error and the page loads as it's supposed to (this happens only ie IE6, IE7/8 appear to work fine). The same thing happens with tinymce and the jquery.tinymce.js plugin, which gives an error in IE6/7 but not in IE8. I can't post the URL since it's a password protected "under construction" website. The error for the Google Maps Api I get in IE6 is
Code:
Line: 215
Char: 26
Error: 'firstChild' is null or not an object
Code: 0
URL: -- left out --
And the error for TinyMCE in IE7 starts with
Code:
Line: 53
Char: 3
Error: Permission denied
Code: 0
URL: --left out--
And then when I press "yes" for "Do you want to continue running scripts on this page?" I get
The google maps api page uses $(document).ready( fn ), while TinyMCE uses window.onload. And, as one would expect, in FF, Opera and Chrome all works fine.
I want to have several maps on my aspx/ascx-Webpage, but only the last one is rendered after PageLoad(). Is there any limitation for that in the goMap() plugin?
I have an array of latitude/longitude data. I need to make a marker appear on the map for each lat/lng pair. But it won't. If I ask the function to print out the coordinates instead of marking them on the, map, it works fine. I don't get an error message either way, so I'm stuck. The page displays the map but without any markers. Here's the code of the function that should add markers:
//adds markers to the map function addMarkers(locarray) { var infowindow = new google.maps.InfoWindow(); var marker, i; for (i = 0; i < locarray.length; i++) { marker = new google.maps.Marker({ position: new google.maps.LatLng(locarray[i][0], locarray[i][1]), map: map }); google.maps.event.addListener(marker, 'click', (function(marker, i) { return function() { infowindow.setContent('some words'); infowindow.open(map, marker); }})(marker, i)); }}
Here's the initialize function (called on body load): function initialize() { geocoder = new google.maps.Geocoder(); var latlng = codeAddress("<?php echo $_POST['postal']; ?>"); var myOptions = { zoom: 11, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP } map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); }
Geocoder and map are declared as global variables. The codeAddress function returns lat and lng of the place I want to center the map around, it's been tested and works perfectly. And here is the script that declares the array and calls the addMarkers function: <script type='text/javascript'> var locations = [ [-33.890542, 151.274856], [-33.923036, 151.259052], [-34.028249, 151.157507], ]; addMarkers(locations) </script>
how can I get my custom markers to show? I have got my code in place, everything works except, doesn't show my custom marker?!
here is my code: <script type="text/javascript"> //<![CDATA[ if (GBrowserIsCompatible()) { // A function to create the marker and set up the event window // Dont try to unroll this function. It has to be here for the
I need a hand with my google maps code Basically what I want to do is display multiple addresses on a single map. I've got that part to work but I need to set-up the bounds and zoom so it zooms out/in and shows all the addresses in the map window...
My problem is after I run the setMapMarker() function in the load() function, I need to pull out the latitude and longitude from the geocoder that is run in the setMapMarker() function... however I can't seem to get it to return those details because the coordinates are pulled in the geocoder function.
Im doing some stuff in the code behind page and then putting that data into javascript respectively. This javascript is then connected to the asp.net page with a literal control. I.E.
Why do I get an error "GlatLng is undifined"? When i put this javascript part of the code just plainly in my asp.net page it gives no errors...
I'm not sure where I have translated this incorrectly. I have one google map embedded on my page which works fine. But I wanted to add a second one. I thought the easiest way to do this would be to have a second page which is called later on with all the details on it for the second map. However although I think (this I presume is where I went wrong) I have replicated the instructions correctly the place holder for the second map just remains blank.
This is the code for my called page with the instructions for the second map:
And this is the script of the main page, just in case I would be better off keeping them both in one place.
<head>
I've cut out the script that doesn't relate to this so I hope I haven't missed anything important.
I'm new to this forum and JS. I simply want to be able to use the Google Maps API v3 to allow a location value entered in my app (by the user) to show that location via Google maps.The code below accomplishes this via an onClick event. How to accomplish the same WITHOUT an onClick? To be clear, it appears I need to be able to perform the geocode lookup to get the long/lat coordinates and then apply them. That all needs to occur on page load.
I am trying to load multiple google maps with advanced directions on one page. I can't seem to get it to work. Any way to run the same multiple times on one page? Here is the code below. The first map and set of directions works, but not the second.
I am trying to create multiple google maps with multiple directions that load on one page. I have tried duplicating the var and function names but I haven't been able to get it to work.code...
I'm developing a land use map and want to use Google Maps. Just want to ask if the Javascript API could actually handle overlays like this sample: URl...Or you would suggest other ways to do this?
I have a javascript error in my home page. Which is annoying. I am having hard time debugging it. [URL] FF is not showing it. IE7, 8 shows the error. I just launched the website and I do not want users noticing an error.
I am a total newbie and am trying to get a google maps type draggable div working for this site www.bingbangbosh.ie. Wondering is it possible to have the div set to a certain width, then when dragged the larger image within the div is dragged around until the cursor meets the edge of the div. would it also be possible to contain this draggable div to a larger div so that it would not be possible for it to disappear off the visible 'window'.[URL]..
I'm in the process of integrating the google maps api into my application. Unfortunately, my events seem to be bubbling. If I open the google maps info window 3 times and click the next button respectively, on the forth time when I click the next button the next event will fire four times. How do I stop this?
I'm using the pretty photo lightbox with the google maps api to load a map into a lightbox window when a link is clicked. There is a basicfunctional example here which is sort of working(click the link x 2 when you get on page): [URL]. I've taken the functionality from a tutorial by the creator of the plugin, and now want to extend it so that i can have multiple links on the same page, that open a different map according to the data attributes for the a tag.
I have this functionality working, to a degree, except that the callback function that initialises the map only fires on the second click of the link, it will not fire on the first clickevent - I've tried debugging in firebug - the click event is registered each time no problem, but the changepicturecallback function provided by prettyPhoto doesnt fire on the first click.
1. In the current script, the markers are set to be random within a radius. What would be an easy way to switch from that to using individual markers that I set from latitudes and longitudes? I'm going to be using around 5 way points surrounding an area and can either hard code or throw in some PHP code.
2. In addition to setting my markers, the navigation is done through generated links like "Point 1", "Point 2", and so forth. How would I insert code to replace .html("Point "+i) with something else? I'm guessing to have a main city, have a few towns around it, and the "Point" links are replaced with text I want to use. Probably hard code or use PHP/MySQL to show a zip code or town related to that marker.Here is a sample of the JavaScript code. I only threw in PHP echo tags for the start lat/long and I have that set:
Code: $(document).ready(function(){ var map = new GMap2($("#map").get(0)); var StartArea = new GLatLng(<?=$latitude?>,<?=$longitude?>);[code].........
I'm using the goMap Google Maps plugin very successfully (and I highly recommend it) - except that I can't seem to set shadows on my map markers. There appears to be support for this in the plugin source code - but there's no documentation I can find.
Anyone got an clues on how to do this? This is a simplified version of the code I'm trying to use. I have checked the obvious/stupid things - file path is correct (the image isn't 404ing in firebug), and there's no js errors being thrown, or any other warnings reported.
I want to know if this can be done using jQuery and Google Maps. In my website I have a Google map where users could add new markers with a description on it and the marker they put would be permanent on my map, meaning if they comeback they would still see the markers they added.
I also want the feature that they could just drag and drop the marker, so it would be easy to the users. What would be my approach and how would I do it?
I want to create a interactive map viewer likeGooglemaps using my own custom map image. On clicking a location on the map, a small popup displayed showing some data. I aslo want a zooming and panning functionality. note that i am using aLinuxserver. The application must not use flash.