How do I highlight a country with the google maps api v3? - javascript

I'm trying to achieve an effect similar to this:
Notice how France is brighter than the other countries. It has the 'focus'. I've been exploring the API and it looks like I'm supposed use kmlLayers to achieve this effect. Is this correct? If so, how do I leverage or even find kml to do this? How else could I do this?
Thanks

I found this can be done with polygons and 'holes'. Google has this pentagon example
The only down side is the polygon needs to be drawn by hand (maybe there's a database of country outlines?) I used this tool to assist with the manual drawing for now.

The information at these links will help you, I think:
KML of the World Countries as created by Valery Hronusov
KML of the World Capitals as created by Filipumme

this demo shows you how: https://google-developers.appspot.com/maps/documentation/javascript/examples/layer-kml
aight, got kml for france; working demo: http://dev.bowdenweb.com/maps/gmaps/layer-kml-02.html

Related

How can I get areal view screenshots of google earth images for multiple coordinates

I am trying to download lot of google earth areal and satellite view screenshots for each coordinates i got(more that 500). I am not sure how can I automate this. After some research i found some ways which include bing maps, Google api or javascript, But no one mentioned how to go ahead with that. Can someone suggest me a way to do this?
Thank you
Capturing and storing the imagery from Bing and Google Maps is against their respective terms of use and should not be done. This is likely why you are finding little information on how to do this.

Javascript Google Earth path editor

What I am trying to do is create a embedded javascript application where the google earth plugin is embedded in a webpage with various paths drawn on. Here is an example of what I am trying to achieve.
The catch is that the lines need to be editable, with each joint having a handle where the user can click and drag. I have looked high and low on Googles api documentation and I cannot find anything even close to this. If anyone can point me in the right direction it would be much appreciated.
You want each 'joint' to be a dragable placemark so that when you drag it the line geometry is updated.
For reference check out the Google Earth API Samples - Draggable Placemark:
http://earth-api-samples.googlecode.com/svn/trunk/examples/placemark-dragdrop.html
And possibly James Stafford's polyplot:
http://www.barnabu.co.uk/geapi/polyplot/
Together they should help you achieve what you want.

Google Maps API polygon overlay

I have been looking through some libraries and the API itself for a solution like the one apartmentlist.com uses to show parts of cities. For example when you hover over Palo Alto, Menlo Park or Redwood City, you get a nice overlay that cover that parts.
I would like to do the same thing, but have no clue how it is done.
Have found out a bit about polygons but I don't really think that is what I am looking for?
This is what I want to achieve:
Thanks in advance.
It was polygons I wanted to use. They are easy to create by using the Google Maps Drawing Library.
Google Maps Drawing Library

Drawing an animated line in the Google Earth Plug-in

Is there a way to incrementally draw a line in the Google Earth Plug-in using the JavaScript API?
If that's not possible, is there a round about method to achieve the same effect?
What I want to achieve is similar to this: http://www.wolfpil.de/v3/animated-poly_v3.html
Yes this is entirely possible, and to be fair it would be trivial to convert the code in the example to use the earth, rather than maps, api. All you would need to do is to find any references to maps objects and simply use the equivalent earth api objects. The math and timing is all done for you...
If you wanted to convert it take a look at the following links, they should give you everything you need to know.
Information on Geometries and Overlays
https://developers.google.com/earth/documentation/geometries
Example of Drawing line strings
http://earth-api-samples.googlecode.com/svn/trunk/examples/linestring.html
Example of Smooth Animation with frameend
http://earth-api-samples.googlecode.com/svn/trunk/examples/event-frameend.html
Finally, you could also just add the earth plugin to the maps implementation, take a look at the following example of Maps/Earth Integration. This would just mean adding the a few lines of code to the example you posted allowing the 'earth' mode to be activated from the maps api. If set up correctly things like polylines are available across the map/earth displays.
Earth Maps integration
http://earth-api-samples.googlecode.com/svn/trunk/examples/maps-integration.html
Beefy integration example
http://earth-api-samples.googlecode.com/svn/trunk/demos/mapsapi/beefy.html

How to highlight a region on Google Maps

How can I highlight/cover a region or multiple regions with different colors (for example 3 US states), using google maps polygon arrays?
I found a tuto on google code about how to draw a polygon but it's not giving detailed information.
Thank you for your help.
This documentation on Google is about as straight forward as you can get.
http://code.google.com/apis/maps/documentation/javascript/overlays.html
View the source of this page. Copy and paste the code into your own page and start from there.
http://code.google.com/apis/maps/documentation/javascript/examples/polygon-simple.html
In the example above you simply need to make more than one instance of bermudaTriangle and name it something else and add it to the map.

Categories