How to scroll map based on Google maps APIs - google-maps

I want to make Custom Map based on Google maps APIs I am using this code to get the Bitmap image
http://maps.googleapis.com/maps/api/staticmap?zoom=18&maptype=hybrid&size=560x480&markers=loc:26.177001,32.736675&sensor=false
Now I want to scroll the map, How can I do that. in other words I want algorithm to link between coordinates and gotten image size and map zoom
Thanks a lot

You are using Static google maps api. That's mean you will get just a print of the map as an image. This is really useful when you want to show just a place in the map without download the javascript lib.
If you want use the map zoom, scrool and other things you have to use the javascript google maps api

Related

Showing information on Google Maps API

I'm fairly new to working with Google Maps API. When embedding a map you get the place and a white box in the top right hand corner with a little information on the place. However I want to use the JavaScript API and want to know is there anyway to replicate this with the JavaScript API and not the iframe embed.
Thanks.
Basically to display the information you would need to use the infoWindow, yes. You can attach an infoWindow to either a marker or directly to map co-ordinates. In depth documentation about infoWindow and detailed references can be found here.

How do you shift the centre of the map in an embedded Google map?

I have a Google Map that I have embedded on my web site. I have managed to size and position the iFrame so that it sits where I want it to sit on my web page. I am using the new Google Maps version.
However, I want to be able to shift the centre of the map to the right, because as it standsnow, the box that displays the map layers is covering some of the locations I have marked.
I am not at this point using any Javascript or jQuery. I have simply taken the iFrame link provided by Google's embed feature and placed it in my HTML. I see there are other questions about map centering, but I can't parse them for my situation because they assume some Javascript implementation. Also, I'm hoping that I do not have to take on a whole API or Javascript library to solve this. Further, it is unclear to me if the other questions relate to the new Google Maps version, which is what I'm using.
Is there a way I can alter the centre of the embedded Google Map?
Just add a "center" parameter to your iframe url. Like so - center="40.714728,-73.998672". You can get the required coordinates by searching in google maps and picking them from the address.
You could alternatively also use a query parameter but center is more accurate.
refer - https://developers.google.com/maps/documentation/static-maps/intro#location

Clicking markers on Google Static Maps

I have an application that downloads static images off Google maps, with markers placed where I want them (Placed by passing arguments into the Google Static Maps URL). However, I also need to be able to click the markers. I figured I could convert the x and y coordinate is the click to lon/lat, and then figure out that way which marker was clicked, but I haven't found that too easy.
I know the dimensions of the map in pixels, the zoom level, and the centre point of the map in pixels and lon/lat, so I followed this blog post. Unfortunately this didn't work.
Does anyone know how I could do this, or know another way I could figure out if a marker has been clicked? I'm forced to use the Static maps unfortunately, so I can't do any of it with the JavaScript API
See:
http://home.provide.net/~bratliff/largetiles/
or
http://home.provide.net/~bratliff/harbor/
It is not exactly what you are doing but it does demonstrate Mercator projection conversions & cross-browser mouse events.

Remove/hide default maps layer in google maps and add image overlay

So basically what i'm trying to achieve is this functionality in google maps v3,that they have in openlayers: http://dev.openlayers.org/releases/OpenLayers-2.11/examples/image-layer.html
Hide the base layer of googlemaps (the actual map), and then add a image overlay that is placed over the entire surface of the map.
Is this possible? and do anyone have any solutions at hand?
It's called a GroundOverlay: https://developers.google.com/maps/documentation/javascript/reference#GroundOverlay
However, while a GroundOverlay covers the base map, it does not remove it. You'd need a custom map type for that: https://developers.google.com/maps/documentation/javascript/maptypes#CustomMapTypes
It would be fairly easy to develop a custom map type that always returns a blank tile.

google maps: use directly on google server?

Usually u have to set up a little script + htmlpage on your server to run google maps,
but i was wondering - is it possible to use google maps directly?
i mean by just calling an url with parameters (gpoint coordinates, zoomfactor ..) and it loads the map fullscreen without having to use my own server?
Sounds like you might be after the static maps api. You can build a URL specifying the properties of the map like:
zoom
position
markers (including custom markers)
image size
etc
and you will get back a rendered image of the map. Something like:
Obviously this just gives you a fixed image of the map you are after. If you need a dynamic Google map, then you will need to use the Google Maps Javascript API.
Not hosted by Google. You might find some other website that uses the API to do the same thing.
Google Maps API