Does anyone know how to:
1) make the Google map not zoom-able? make it so it is at a fixed zoom size and the user cannot change it?
2) have the map API load a picture of my choosing and overlay the little blue dot of the user's current location over it?
Here is what I want to do, I'm want to have a custom picture of the world (that i have created in Photoshop or w/e, it will be .jpeg, .png, or whatever file format will work) the picture of the world will be 'artsy' and I just want the Google maps to overlay the little blue dot of where you are in the world. For example, if you are in New York, NY, you will see the picture of the world with the blue dot over what on the picture is New York.
Any help will be greatly appreciated, Thanks
You should be able to control the map as follows:
map = (MapView) findViewById(R.id.mapview);
map.setBuiltInZoomControls(false);
As for overlaying an image, you'll need to create an image layout file (in XML) and then inflate that over the top of the map. This tutorial shows you the basics of inflating a layout and adding it to an existing view:
http://www.mysamplecode.com/2011/10/android-dynamic-layout-using-xml-add.html
To position the inflated layout (your image), you will need to use LayoutParams (http://developer.android.com/reference/android/widget/LinearLayout.LayoutParams.html) to set the position of the new view on to the map.
Hope that helps.
Regarding you second question: it sounds like you actually want to replace the Google Maps tiles by images you've created yourself. As far as I know, that's not possible with the Maps API. You can potentially hack something together by adding your own creation as overlay to the map, but that may not give your the results you're looking for, especially if you want the user to still be able to pan/drag the map around.
In stead, you might want to take a look at the osmdroid (Open Street Maps for Android) project. They do support loading in your own tiles via the ModularTileProviderArchitecture. It'll probably give you more freedom and flexibility, but might be overkill for what you're after.
I know that OSM is hip and cool, but the OP asked about Google maps — and the question is readily answered in the Google Maps API documentation (https://developers.google.com/maps/documentation/javascript/).
The Google Maps API has supported custom maps for years. I think you can edit their first "ImageMapType" (https://developers.google.com/maps/documentation/javascript/maptypes#CustomMapTypes) example to solve your problem.
In your case, you would set the "maxZoom" and "minZoom" fields to whatever zoom you want to create artwork for. Use the "mapOptions" dictionary to take away the zoom control. You'll need to cut your artwork into tiles, and replace their "getTileUrl" function with one that returns your tiled image.
Related
I am trying to make an indoor map of a hospital , when i click on certain buildings it would open their respective indoor maps and when i select a certain area of their respective floor it would show me further details.How can I achieve this?
Any suggestions would be appreciated.
P.S I have tried using image view but i can't get the image to scroll freely like a real map or a webview (pinch zoom in/zoom out ,rotation etc).
As you wanted your "floor" to have the behavior of a map you should have look for custom map implementations.
Then you may have found that you can use your own Tile Overlay using a Custom Map Tile Provider as described in Using custom map tiles with Google Map API V2 for Android?
Or if you don't want to use Google, you can look at Open Street Map Android SDK
Ether way you are still responsible for the graphical assets of tile layers. As well as any UI/UX leading to the custom map view.
Alternatively there are third-party libraries for 'deep zoom' of an image which may provide the expected touch behavior like: https://github.com/davemorrissey/subsampling-scale-image-view
You can have rooms as scolling views, with a background view image and buttons where you want to click. Clicking the buttons opens a popup with an image. You can also place transparent buttons on the buildings to have a natural feeling of click to open.
From your question it seems that you don't want to use web view, but you can code a regular html page/web app and use a web view to display it. That way, you only have a screen with a web view to deal with.
Then the possibilities are endless and fun and shifts in the web domain!
I need to use my own image as a map and place markers (or a small flag-image) dynamically on the map at different positions (x,y coordinates or l,t,r,b parameters) on the map based on certain criteria. I am having problems implementing it with 'ImageView', 'ImageMap' & 'Drawable' and have searched all questions on stackoverflow. Any help would be appreciated.
I did something similar to this for my very first app. Inside of my activity, I created a custom View class, where I overrode the onDraw method and drew my map image, flags, etc. This is the tutorial I used, I recommend you check it out: Anddev.org (you may not need to implement scrolling, but the rest of it should be relevant).
Alternatively, you can use the Google Maps API to display their map with Overlays but it doesn't sound like that's what you're looking to do.
You have to user Overlays for displaying images on a map. A very good tutorial is given in the official docs.
I want to code a map application in Android(MinSDK=2.1).
But this map will not use any online features.It will be completely offline.
Also this map shows a high definition image which is drawn by me.I must specify points (like buildings,parkings,cafes...etc) and place little Imageviews on these points.
When needed , screen must move any requested point.
So Is there any sdk,library...etc to do this you know ? Or Should I implement myself.Lead the way pls.Thanks for any help...
I need to create some map tiles for open street map.
I want them based on OS maps but I want to edit a particular section of the map in photoshop.
I have looked at mobile atlas creator (MOBAC) and can generate tile from the OS maps, but what I want to do is update the main map image first, then generate the tiles with my updates.
I don't think it's possible to do this with MOBAC so can anyone point me in the right direction of what I need to do?
Thanks Bex
I have not heard about MOBAC, but there is a company called CloudMade.
They provide different services around OpenStreetMap data. One of their service is Style Editor:
http://developers.cloudmade.com/projects/show/style-editor
You can create your own style of tiles, i.e. show/hide POIs, change colors for different types of roads, rivers and so on.
Is it what you need?
Finally found a way, use oziexplore to calibrate an image (or a map) and then load the .map file into Mapc2Mapc then generate the tiles in adnav format. Unfortunately then I need to rename all my tiles so they end in .tile rather than .adnav for the default version of OSMDroid.
To explain my problem, I am going to start from a case study that is not what I have to do but which will give you a good idea of what I am talking about.
Imagine the map of the US in which you have the states / provinces. Each of these provinces has got a shape that is random (by random I mean it is not a rectangle, a triangle or a circle). I need to build these shapes independantly, size them correctly and put them at the correct place on the screen to represent the country. Finally, each of these province should be clickable.
To achieve that :
1) I don't want to use google map
2) I guess that I'll have to construct each provine using android path and android region ... can you confirm?
3) Is there a graphical tool for building these paths (photoshop import ?)
4) Assuming that I succeed to build the path, how can I put them at the correct place on the screen ?
5) How can I make these path clickable ?
Basically, I want to build an interactive map with clickable items that doesn't use Google map because it won't necessarly be a real map.
Thanks for your help,
R.
There are lot of variables in the problem you describe:
If you don't want to use google-maps, you'll need to use another engine. There are a few open-source ones available.
If you feel you don't need a map engine, you'll need to provide you're own image of the US to draw on an pin the image to the View
How do you plan to draw the boundaries? Do you have coordinate data for the boundaries or do you plan to draw them manually.
I would suggest first looking at openstreetmap: http://www.openstreetmap.org/ The have a lot of information and tools on creating Maps. From there you can attack adding to the phone. Or you can use their web api and build a web view for doing what you suggest.