This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
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 Building Microservices this week in the Design 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
Author

google maps allways get the same map

david dabush
Greenhorn

Joined: Sep 16, 2012
Posts: 27
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].geometry.location.lat(),results[0].geometry.location.lng());
}
});

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

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

Joined: Sep 16, 2012
Posts: 27
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? :)

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 63231
    
  69

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: http://aspose.com/file-tools
 
subject: google maps allways get the same map
 
jQuery in Action, 3rd edition