Click here to Skip to main content
15,921,660 members
Please Sign up or sign in to vote.
4.50/5 (4 votes)
See more:
Markers were added for google map in code-behind file & how to take snapshot for that map on click of javascript button
Posted
Comments
Sergey Alexandrovich Kryukov 13-Apr-11 3:27am    
This would be a good-to-have solution, my 5 asking about it.
Any attempts to solve?
--SA
Sunasara Imdadhusen 13-Apr-11 4:08am    
Good question!
Sandeep Mewara 13-Apr-11 5:18am    
Any effort?

1 solution

There might be better ways to do this, but as per my knowledge following are the two ways you can do this.

1) Use Google Static Map API[^], they are simple querystring based API, which will return an Image as a result. also the maximum image size returned is 640 x 640, so you might want to query multiple times and combine the images.

(But in this case you will have to add those markers again)


2) A better solution is to call getTileUrl() method, this will return a URL that contains Image file of your current view.

This will give you Image of a particular tile that you are passing as a parameter at given zoom level. so you will have to call this for each tile in your view.

each tile of google map is 256 x 256 pixels. so depending upon how big is your map your tiles will be as follows.

0,0     1,0     2,0     3,0
0,1     1,1     2,1     3,1
0,2     1,2     2,2     3,2
0,3     1,3     2,3     3,3


I hope either of these complicated solutions will be helpful... :)
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900