Google Maps V3 MarkerCluster plugin by polygon coordinate boundaries - google-maps-markers

I'm having trouble figuring out how to implement markercluster v3 in my map. I am able to get it to work, but am trying to cluster the markers based on specific neighborhoods and regions. I have created a layer on my map from a kml file that is seperated into several neighborhoods and I'd like the map markers to "cluster" by the neighborhood that they're located in. I tried messing with
http://jsfromhell.com/math/is-point-in-poly#example-header
but have had no luck...
Another question led me to figure out that I should use this method:
containsLocation(point:LatLng, polygon:Polygon)
Has anyone been able to achieve this?
Here's an example of a site that does it:
apartmentlist.com
Thanks for any help!

Related

D3 visualization to create building / campus map

How do I create a building/school Map which I can zoom and get context information for each classroom using D3.
I have read examples of how to create Zoomable Geo Maps http://bl.ocks.org/mbostock/2206590 , but in the code, it uses the TopoJSON (or GeoJSON) format of the US states.
How do I get the GeoJSON file for a school building?
Thanks,
Raj.
Hard core geojson
There are online geojson editors, such geojson.io. You can find your building, map it, add properties such rooms name, then save it as geojson or as topojson file.
Note that geojson.io doesn't allow an infinite zoom, so your drawing may be quite approximative.
In your D3js code, you will have to autofocus on your json data (shape). A convenient working example is explain in the 2nd half of this answer, the D3js call and Focus sections.
Witty SVG
Designing your building as an SVG / XML file using Inkscape or some other vector editor would be a bit longer to do, but will end up into better end results. You then use d3.xml(http://yourwebsite.org/file.xml, function(data){ ... }). I have, unfortunately, too few expertise in this direction, but it's the way I would go for if quality is requested at that level.

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

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/

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).

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

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