File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Android Security Essentials Live Lessons this week in the Android 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: 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].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
Marshal

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


Ping & DNS - my free Android networking tools app
david dabush
Greenhorn

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? :)

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60810
    
  65

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
 
Similar Threads
how to put a pin in a google maps location
HTML5 Geoloaction
Display simple address on google maps
Change cursor during Ajax
Getting Distance between two addresses