Click here to Skip to main content
15,176,823 members
Please Sign up or sign in to vote.
2.25/5 (8 votes)
See more:
Hi,
I'm Rudra, I'm working on Project for the Client Indian Army. I need to develope a form which loads India map and various buttons on it. Out of that 1 is zoom.
Can you please help me by providing code for that
Posted
Comments
Chris C-B 28-Jun-11 2:17am
   
Are the maps raster or vector data? What format?
Christian Graus 28-Jun-11 2:36am
   
Please do not ask variations of the same question over and over. Ask once, clarify and use the 'comment' button to seek further detail.

Ah, my area of expertise. First of all, you haven't stated what GIS system you are using. While you could use Bing or Google for this, typically secure systems (such as used by the military) require mapping to be hosted on dedicated servers in safe areas that they control.

Mapping imagery typically comes in two formats; raster and vector, with raster mapping being used to show low levels of detail (in other words, this covers the whole country, and down a few levels). At some point, the raster mapping gives way to vector mapping, which can be zoomed into without losing fidelity, unlike the raster mapping which is stretched while being zoomed into.

Each decent GIS provider has their own API, which provides all the functions that you need to perform the zooming. Have a read of the API documentation and figure out what you need there.
   
v2
Wow. Zoom is so trivial, that I feel bad for the Indian Army. You just draw the portion of the image you want to view, at the size you want to view it. You would start by not using a picture box, handling the paint event, and drawing your own image. Then, you can control which portion you draw, at what size.
   
Comments
Rudra Gouda 28-Jun-11 2:10am
   
Thanks for ur reply Christian, but code should be such that it should double the view with same clearity
CPallini 28-Jun-11 3:26am
   
As already explained you cannot get 'the same clearity' however you may get 'quite nice' zoomed image using a filter. Have a look at this article:
http://www.codeproject.com/KB/GDI-plus/imgresizoutperfgdiplus.aspx
Christian Graus 28-Jun-11 2:15am
   
Well, then you and the Indian army are in trouble. If you're looking at an image 1:1, and you try to zoom it at twice the size of the actual image, it will not look too bad, but it won't be as clear as it was, you can't write code to invent pixels. You can do a bilinear or bucubic filter, but that's basically an intelligent blur to make the image look nicer, not clearer. I have articles on Code Project with image filters on them, the article on resizing images shows how to implement these filters, but, again, they are blur filters, they are NOT going to give you an endlessly sharp image.
   
Comments
Christian Graus 28-Jun-11 2:23am
   
Or google maps, for that matter, if he wants to load generic maps, and not ones that he has on hand.
keyboard warrior 28-Jun-11 2:24am
   
google...maps...indeed...

next thing you know you'll be using their search engine too!
Christian Graus 28-Jun-11 2:26am
   
ROTFL - I use google and google maps, because why would I change to something MS did later, and is not as good ? They need to do it first, to capture me, or better, to make me change. :-)
Rudra Gouda 28-Jun-11 2:37am
   
Can u pls give the code for the same........
Zoomin in and out of the image at the button click
Christian Graus 28-Jun-11 2:42am
   
You asked this twice and now you have code. Honestly, this is how the Indian ARMY does things ? Don't you have nukes ? I am scared now. Do you have map images locally, or not ? If you do, you CAN'T zoom without losing quality, but the (trivial) code you've been given, is how you do zooming.
u can use jquerys.In jquerys Zoom of images.
   
Comments
Pete O'Hanlon 28-Jun-11 3:53am
   
This really doesn't answer the question because mapping is a lot different to zooming in on an image. Have a look at the answer I gave to understand why this is so.
Christian Graus 28-Jun-11 4:02am
   
Wow - dumbest answer ever. He's not even writing a web app.

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