How can I draw images, lines, etc. on google maps - ajax

I'm investigating how I might best create an app that allows drawing of arbitrary shapes, images, etc. on google maps, based on lat/lon coords of the shapes or coords/rotations for images. Surprisingly I haven't found anything out there that offers much in the way of flexibility. Scribble-maps has created something close to what I'd aim for, but they're using flash. I'd ideally like to build something that draws on the google maps html map.
I suppose I could build a div, lay it on top of the map, and if I can listen on the map scroll/zoom events I should be able to figure out how to do everything myself. Thoughts?

You need to use overlays, check the Google API documentation.
There's an example of mouse interaction to draw lines in the Polyline Arrays section. To show images have a look at the Ground Overlays section.

I know this is a very a late response, but we have launched an API for Scribble Maps. You can check it out at http://www.scribblemaps.com/api/

Related

Set a country background to my Google Geomap

A few days ago I've explored geomaps and, however, it turned out to be easy to change the properties of the elements.
But I have two questions:
I'd like to add rivers and forests on the maps. So Ive considered to set a background image instead of the geomaps figure. But I can't find a way to get this one fixed. Is there a way to set a background picture for a country or region?
How can I change the shape of the "bubbles" when you select a city e.g. "London"? I'd like to change it to a square.
Thanks in advance for your help!
Unfortunately what you're looking for is not available in geocharts in their current implementation.
Using a background image is possible in the sense that you can use CSS to make all shapes in the map transparent, and use a background image in the div to make it appear as if the little circles are being drawn on a map with forest and rivers, but you will run in to two big hurdles:
Your map will need to be identical in size/layout to the Google Maps SVG
If Google ever changes the SVG they use (or the view/projection they use) you will need to edit yours too
This isn't ideal, obviously. You could work around it by creating custom javascript to write rivers and forests on your map, but that is going to be a huge headache (especially if you are using multiple maps/views).
As for the circles, you can't change them to squares without hacking the actual SVG in the background with javascript. While this is definitely possible (if you're really good with SVG/Javascript), it again isn't using any of the fancy features of geocharts, and is more just a custom solution that will have to be updated if/when google updates their API.
Rather than doing it that way, you may want to look in to the same implementation on google maps itself. That will allow you to use custom markers, draw custom shapes, etc. with a lot more flexibility (and a much more stable API).

How to create big organization charts like google maps?

I don't know javascript (unfortunately) and I'd like to make a mindmap-like "organization chart" similar to this one:
This map should have an ability to zoom-in and zoom-out similar to google maps, and the ability to arbitrarily connect nodes. So it is more like a free graph, not like an ordinal tree. Mindomo makes this pretty well, but it is commercial and flash-oriented.
Does anybody know of a similar solution?
My research pointed me out that this could be a svg sketch, possibly generated offline, or maybe something using canvas. A click on the node should redirect to some web location.
Google maps is good because it also hides some details, and so should do this graph map in zoomed out projection.
A few important questions:
Do you need this generated in real time based on some underlying dataset?
Aside from zooming, should the user be able to manually open/close nodes?
You can manually generate this simply using some free tools:
MindMeister
xmind
freemind
although non-traditional, can you consider using Prezi?

Zoomable image like google maps

I would like to create a website that has a large image of a tree from a distance on. When you zoom in it shows more defined image of the branches and then zooming in further the words will display in the braches. You can scroll the image to see all the other words. So its like google maps but for my own image.
I have tried looking for examples etc but can only find ones of maps. I believe I have to make different tiles for the different levels.
Is there any examples or tutorials out there that could help me or is there a specific name for what I should be looking for.
The easiest way to do it is to use a tool called MapTiler.
It's free, and you just follow a really simple wizard that just hides all the complexity from the process.
Anyway, I've posted a tutorial exactly on this topic which you can check here.
I created a Java based version of a Google Map Tiler tool here:
https://github.com/devldevelopment/googlemaptiler
This will help you cut up images as per Map Tiler but is free. An example with Javascript is provided on the github readme.
Thanks

Sophisticated HTML5 Image Map?

I have an image of a living room, which I'm turning into a menu for a new site I'm working on. The idea is that you can click on certain items in the room, like a chair, desk, couch, etc and get taken to the desired page. I'm wondering if there is a clever way of doing this. Since the items are not simple shapes, I don't want to use a standard image map.
Thanks for you help!
I'm answering because a Google search brought me here...
Because you asked for a tool:
GIMP Has a really good Image map creation function.
Open your image in GIMP and select Filters > Web > ImageMap
From there you can create image maps by drawing on the image. Saving will generate HTML you can then tailor to your needs.
This tool looks to be a solid image mapper: http://www.image-maps.com/
I'd suggest doing this with a canvas and SVG's, it would make this quite a bit easier, and more professional.
As Korvin mentioned, doing this in SVG is probably the easiest option, because you can attach events to objects in SVG rather than having to manually specify a particular area in which to listen for events.
If you go this route, I recommend using the RaphaelJS library which has a nice syntax and the advantage of working in IE pre version 9. Here's a demo which, although it uses onmouseover instead of onclick, it might be close to what you're trying to achieve:
http://raphaeljs.com/australia.html

Geoserver and dynamic markers

I am really sorry to post this question, because most likely the solution will be really simple. But I am completely out of search string ideas.
I have a running Geoserver and some custom shapefiles describing buildings etc. I can requesting maps as pngs with the WMS interface and display on a website. So for so good.
In the next step I want to enable the user to specify a coordinate an draw a little marker on the map. This position should not be stored anywhere, I just want to draw it for this user. I am pretty sure this is possible with a WMS request and an inline feature, but I had not any luck finding a working solution and I am out of google search strings.
Please help me before I start drawing overlays over a png map.
You can do this with an inline feature in your SLD - See http://lyceum.massgis.state.ma.us/wiki/doku.php?id=wms:sld:inline_feature for an example.
You can let OpenLayers do the drawing on the client.
Check this example to see how it can be done. It demonstrates how to draw lines, points, and polygons:
http://dev.openlayers.org/releases/OpenLayers-2.10/examples/draw-feature.html

Resources