Adding Markers To Googlemaps?
Apr 8, 2009
I'm trying to get addresses from an XML doc and use them to populate a google map with markers. My problems are (A) markers don't show up when I first load the page, but if I return to the page they magically appear, angles sing and all is right with the world, and (B) Markers just flat out refuse to populate when using Firefox. My code is pretty simple and I'm just not understanding where I'm going wrong:seemlingly the offending code:
functin addMarkers(){
htt.open('get', 'phoneBook.xml', true);
http.send(null);
[code]....
View 7 Replies
ADVERTISEMENT
Aug 22, 2009
For years I have been using external_link.js, a file that I found at sitepoint, in one of Kevin Yank's articles I believe, to open new pages in a new tab when a link contained rel="external"
I just added the googlemaps api to a site to display maps, and none of the old menu links open in new tabs anymore! Has anyone else had this problem or have any idea why it has happened? Same function name in both javascripts?
View 1 Replies
View Related
Feb 21, 2010
Notice: This is a discussion thread for comments about the SitePoint article, Adding Markers to a Map Using the Google Maps API and jQuery.
I just got a little lost as to where the #showmarkers button comes from?
View 7 Replies
View Related
Oct 16, 2010
I'm trying to create a simple GoogleMaps site, to insert data into a SQL database for retreival later.I can pass all the information apart from the longitude and latitude values, and they just appear as '0' in my database.
Quote:
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map"));
map.enableGoogleBar();
[code].....
View 3 Replies
View Related
Oct 19, 2009
I would like to integrate google maps into Birt (which is a business intelligence framework with html reports). What I succeeded so far is to build an iframe which is calling an html which contains the googlemaps page, this looks like this:the iframe (which is part of my html report):
Code HTML4Strict:
<iframe src ="text.html" width="100%" height="300">
<p>Your browser does not support iframes.</p>
</iframe>
and the text.html which contains the google maps page:
Code HTML4Strict:
<html xmlns="h t t p : // w w w . w3 . org/ 1999/xhtml">
<head>
<script src="h t t p : // ma ps. google . com/ maps?file=api&v=1&key=ABQIAA...." type="text/javascript">
</script>
[code]....
This works so far, but this is not dynamic. What I need is some way to pass the coordinates to the GPoint(x, y) object. The iframe is inside of Birt and I can insert some code there, the values would be represented as following: <VALUE-OF>row["X"]</VALUE-OF>, <VALUE-OF>row["Y"]</VALUE-OF>.
My problem is now how to pass this values to the GPoint object in text.html. Is it possible to build a function which receives this parameters or is it possible to put the text.html code inside of the iframe (what i tried so far didn't work, as I said, my javascript/html knowledge is limited).
View 1 Replies
View Related
Sep 15, 2010
You'll see a google map there, created with this jQuery plugin. Although I've used the plugin on several occasions without any trouble, this time the map's .png icon/marker cannot be made transparent.
I've tried several things (removing my reset.css file, adding a js png- transparency fix, fiddling with the plugin options) but nothing works...
View 2 Replies
View Related
Mar 13, 2011
i have a project for school to create a web app that's using geolocation to recive the LatLong coordinates and draw a path in google maps using polylines. There are more features that we are going to implement but this is the one i need help with.What i need is to push into the array of the polyline the coordinates i get from geotraker.Use Chrome Browser, the other ones are not supported buy the geotraker.Try this in chrome and see if ur getting the coordinates The zipped files
View 1 Replies
View Related
Feb 25, 2011
what i would like is to achieve what has been implemented here : [URL] the problem is that, although i have the numerical values (%) that indicate the traffic that passes through a link available as data, how to display them onto the google map?
View 1 Replies
View Related
Oct 24, 2010
Another quick question re. the JQuery sidebar I have on my Google map. I would like to link to individual markers from different websites or via email, so would like to convert for example, the 'javascript:myclick(7)' link on the menu to an external URL that will click to the marker and info box containing the video. Is this possible?I have tried something like [URL].. but that doesn't seem to work. Does someone know of anotherwayto do this?[URL]...
View 4 Replies
View Related
Apr 6, 2011
I have a lot of javascript for my google map api and I have all the information stored away in an xml file which the javascrupt reads. I have many map markers but I cannot get a line break between th esets of markers, only each and every marker. I tried this in the xml and in the javascript but I am stuck
<markers>
<marker lat="30.2672" lng="-97.7431"
name="Pantera"
[code]....
View 8 Replies
View Related
Nov 1, 2010
I have a php page that pulls MySQL marker locations.I have tried using examples for bounds etc but the map isn't centered or zoomed, it instead seems to center over the Pacific and minimum zoom level (For the url below it should be centered over the Devon region of the UK and zoomed in)the page where you can see the end result is here:
http:[url].......... whereby I was using deprecated function of GPoint for passing locations but one of the group mods kindly pointed this out and this was replaced with GLatLng but the fault is still there.
View 31 Replies
View Related
Nov 5, 2010
i have a page with an input field where a user can input a name. when they do so it will bring back the postcode for that name and then display a marker on a google map in the correct place.
unfortunately some of the names have more than 1 result which means it needs to plot more than 1 marker on the map...ive spent a lot of time on this but cant figure it out.
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
[Code]...
View 1 Replies
View Related
Oct 25, 2011
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>
View 1 Replies
View Related
Jul 8, 2010
I have some trouble with the google maps api. I want to add markers from a xml file to my map but it seems that the function is not parsing my xml file and I am clueless.
[Code]..
View 3 Replies
View Related
Nov 25, 2011
MY GOAL - I have a database with a bunch of items and each has latitude, longitude and a category (all the items are within 1 city). I want to have a page that will show a google map, display a marker based on the lat/lng and the image of the marker should be customized based on the category of the row. For example, some rows have a 'food' category and some have a 'health' category - I have specific images I want displayed for each image. I need a script that will plot a marker for each item in my db. I have never used Google maps API before and I'm thinking V3 is what I need to use.
$query=mysql_query("SELECT * FROM table");
while($row=mysql_fetch_array($query)){
$lat=$row['lat'];
$lng=$row['lng'];
$category=$row['category'];
//SET MARKER PICTURE TO $category
//ADD MARKER TO MAP
}
I don't know javascript that well and I have tried about 40 different things and get nothing but a blank page!
View 12 Replies
View Related
Mar 25, 2011
I was using a google map V2 API, but decided as it is deprectaed, to step up and use the latest version, and it is doing my head in. Basically all I want is a map, that has 5 checkboxes, checkbox1, checkbox2 etc... and if one or all is checked then a marker will appear on the map that I have location preset, the marker when clicked will show a little information and contain a url. I was able to get the map with the five markers completed using V2, but when I was researching how to use checkboxes, i kept being led to the V3 API. I think the Google documentation is pretty bad for this PAI, as there is tons and tons of information but none of it is explaing the simple things, like how to set mutilple markers in V3. It will instead show you how to create polygons using images and fancy stuff that is not essential.
View 24 Replies
View Related
Aug 1, 2010
I've got a few locations that I'd like to put on a google map and can do it just fine when I use the following code:[code]However, when I try to do it via an array the markers appear, but not in the correct location and I can't figure out why.Below is my version where I attempt to use an array:[code]
View 6 Replies
View Related
Mar 3, 2011
The client is a realtor with a non-standard intranet which is a "conferencing" system with a very interesting built-in web server (FirstClass). They post property listings to conferences as email messages, with the property address as the message subject. I'm trying to place the addresses on a Google map using the goMap() plugin.
I've figured out how to read the conferences and extract the addresses to a web page, either as well-formed JSON or as a string formatted exactly as one would hard code it for goMap, but when I attempt to initialize a map it either rejects it with an error, or ignores it and gives me the default map (of Europe). If I copy/paste the server-generated string into the init function it works just fine.
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
[Code]....
how to get that info into my initialization function dynamically?
View 1 Replies
View Related
Mar 29, 2011
I'm working on this project for university.I have loaded in several markers via xml and pushed their latlng into an array.
I have created an html link that on click should run through the marker lat lng array and pan the map to the next location in the array.
Problem is that the map just pans to the last entry in the array because it runs through the loop before the animation has played
Here is the working example[url] contains all code we are troubleshooting.
something like this is require but i'm new to jquery and not sure of the syntax. maybe i need some kind of event listener in there too?
View 1 Replies
View Related
Oct 20, 2011
so far any values recorded in my database are shown on the map:
[Code]...
View 1 Replies
View Related
Dec 22, 2011
I have a video (.wmv) that has markers in it one can access these markers in video players like "Windows Media Player" at "view" -> "file markers"
I want to embed the video object in an HTML page and be able to let the user jump to these markers via JavaScript or such. I managed to do this with Internet Explorer ודןמע JavaScript but I can't get any other browser to access these markers or any timeline. function for that matter. I need to be able to do so cross browser.
View 2 Replies
View Related
Apr 14, 2010
I have a few questions:
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].........
View 1 Replies
View Related
Aug 24, 2009
I pulled this code from Google's example section to make markers on a v3 Google Maps API (I have added my own lat/long points and corresponding event listeners, of course, but this is still the spirit of the code):
[Code]...
It's not throwing up any errors in Firefox's developer or in IE but there it sits, a blank map. I'm sure this isn't clean or optimized code, but it looks correct to me. I've color-coded the code above to show what "for" loops are being used to try to replace which code. Hopefully that makes this more sensible.
View 6 Replies
View Related
Nov 8, 2010
I want to load markers with an ajax request that retrieve data in json format all the markers.
I have no problem with the json data and ajax request but I don't know how to give this json data to $.goMap plugin.
Ajax with json data.
This is the right format of data that I want to achieve but dinamically, with ajax request:
View 2 Replies
View Related
Jul 5, 2011
I have Been trying to make a webpage that displays a googlemap with multiple markers based on data from an XML file but can't seem to get it to work. Would be ETERNALLY grateful to anyone who can pick out where I'm going wrong!
<html>
<head>
<script type="text/javascript">
function callXML(){
if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
[Code]...
View 9 Replies
View Related
Apr 15, 2010
I'm looking to build a user form where the user can drag and drop markers onto an image and then retrieve/send the resulting new image with markers back to the server
for processing.
what UI functions / Framework will be in the right direction to achieve this?
Anyone familiar with some existing similar functionality?
View 2 Replies
View Related