File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes google maps allways get the same map Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "google maps allways get the same map" Watch "google maps allways get the same map" New topic

google maps allways get the same map

david dabush

Joined: Sep 16, 2012
Posts: 10
i am new with google maps API and i try to get a map by defining cordinates.
but i allways get the same map

function initialize() {
directionsDisplay = new google.maps.DirectionsRenderer();
geocoder = new google.maps.Geocoder();
var address = "HaYarkon 100 TelAviv Israel";
geocoder.geocode( { 'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK)
TelAviv = new google.maps.LatLng(results[0],results[0].geometry.location.lng());

var myOptions = {
mapTypeId: google.maps.MapTypeId.ROADMAP,
center: TelAviv
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 39547
It looks as if the address you're searching for is hardcoded - why wouldn't you always get the same map?

Ping & DNS - updated with new look and Ping home screen widget
david dabush

Joined: Sep 16, 2012
Posts: 10
no, dont loook on the example
even if i change the cordinate i still get the same map allways of Los-Angeles Area
this is just an Example of Tel-Aviv cordinates but i still get Los-Angeles map
K. Gil
Ranch Hand

Joined: Apr 29, 2011
Posts: 75

isn't that javascript? :)

Java / Tomcat Hosting at
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 60053

david dabush wrote:no, dont loook on the example

Then what are we supposed to look at?

Please post the real code you'd like us to examine and be sure to UseCodeTags.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: google maps allways get the same map
Similar Threads
Getting Distance between two addresses
HTML5 Geoloaction
Change cursor during Ajax
Display simple address on google maps
how to put a pin in a google maps location