Sunday, October 16, 2011

[Google Maps API v2] Re: Google API

On Oct 16, 2:01 am, Parag <parag.deorukh...@gmail.com> wrote:
> Hello,
> I am using the following in my address bar.
>
> http://maps.googleapis.com/maps/api/staticmap?&visible=346+somerset+s...label:A|size:normal&size=512x512&sensor=false
> Everything is fine, but I don't get marker pinpointed at the location.

"visible" ensures the location is shown, but the documentation implies
that it inhibits any markers being shown.

You're also not specifying where you want the marker shown: after
"size:normal" should be a | followed by the location. So the fix is
not to use "visible", but to specify the location of the marker and
let the API decide the centre-point and zoom of the map.

http://maps.googleapis.com/maps/api/staticmap?maptype=roadmap&markers=color:blue|label:A|size:normal|346+somerset+street+west+Ottawa+ON&size=512x512&sensor=false

http://maps.googleapis.com/maps/api/staticmap?maptype=roadmap&markers=color:blue|label:A|size:normal|346+somerset+street+west+Ottawa+ON&markers=color:blue|label:B|size:normal|360+lisgar+st+Ottawa&size=512x512&sensor=false

You can reduce the length of the URL by geocoding the addresses first.

http://maps.googleapis.com/maps/api/staticmap?maptype=roadmap&markers=color:blue|label:A|size:normal|45.415611,-75.695516&markers=color:blue|label:B|size:normal|45.416232,-75.698211&size=512x512&sensor=false

Documentation: http://code.google.com/apis/maps/documentation/staticmaps/#URL_Parameters

--
You received this message because you are subscribed to the Google Groups "Google Maps API V2" group.
To post to this group, send email to google-maps-api@googlegroups.com.
To unsubscribe from this group, send email to google-maps-api+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-api?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate