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.
On google maps I have several hundred markers for different countries and cities across the globe. It is just not practical to navigate through several hundred markers therefore I would like my browser to auto navigate to predefined multiple latitudes and longtitudes or cities, once the navigation for predefined cities completes, the navigation loop carries on. Also for certain cities or latitude / longitude can we set zoom level so when the browser is auto navigating it zooms in and zooms out for predefined cities. Is this possible, here is the code that I am using.
I can see several hundred markers on the map, rather than navigating between each marker I would like my browser to auto navigate through predefined cities with auto zoom in and zoom out values.
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.
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>
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.
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!
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.
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]
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 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.
I am going to include a google maps to my web with markers, the map works perfect, the problem is that I dont want people to be able to do max zoom for security reason, so I need to put an limit zoom in it, and I cant find out how to on internet, I dont know javascript to do it for myself.
I am completely new to javascript programming. We had another company (out of business now) develop a mapping system that placed many different business locations on a Google map. However, the points overlap and hide each other. I would like the user to have to single click on the map (thus zooming the map in) before they can choose a business.Is there a simple line of code that will do this? I want to remove the need to double click to zoom and make it a single click to zoom prior to selecting a business.If you want to see the mapping code, I can post it. I wasn't sure what to do
I was not happy with the zoom scripts that I found on the net, so I wrote one myself, or one that simulates it. It has become an extremely simple one, and can be seen in action here (function toggleZoom). Click the images to zoom in and click to zoom out again.However, only the images with an initial width of >= 100 pixels will zoom out again. The ones width an initial width of < 100 (nrs. 4, 5 and 7) won't. Why is that, and how do I solve it?
i m using the below code to disable ctrl+ and ctrl- (zoom in/out using keyboard). The below code is working in firefox but it is not working in IE. The return false; is not working in IE. can you please some one help in this?
$(document).ready(function() { var ctrlDown = false;[code].....
I have seen a website that has a great image zoom function and would like to be able to add this function to my website. I'm afraid my Javascript isn't very good. where I can get a script to do this or how else if there is some free software that could do it? The webpage is: http:[url].....On this page if you click on Zoom on the left another image comes up on the right and when you mouse over the square on the left image it zooms the right image.
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:
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
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.
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.
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 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]...