View Full Version : Properly Geo-Locating Custom Pushpins
jerpat
06-12-2008, 12:10 AM
I'm hoping there's a trick to this that I'm just missing....
I want to make a custom push pin to use on Google earth. The standard pushpins actually have the tip of the pin on the proper coordinates. However, if I take that pin and copy it, edit it, etc. and save it, the *middle* of my image ends up over the coordinates. Is there a special marker color or metadata that notes the exact pixel to the mapped coordinates? The only trick I can do at this point is put the end of my pushpin in the middle of the image, but then it comes out smaller than I want it to be :(
Thanks!
Jerry
Mickey
06-12-2008, 12:25 AM
Wow, excellent question. Sorry to say I can't help, but I'm quite curious about it now too. :)
jerpat
06-12-2008, 03:29 PM
One workaround is to do what I suggested originally. If you size the picture with proper respect to the size of the image, e.g., have it fill the entire horizontal space, or close to it, Google Earth (at least the version I'm playing with) will "see" the dead space at the bottom and compensate for it. I was able to make my own paddle marker by just doubling the vertical size, and now it puts the end of the paddle in the right place and it shows as the same size as Google's markers. I was able to get my thumbtack pushpin close to Google's size, but since the actual tip of the pushpin isn't centered on the image, it comes out slightly smaller (because the horizontal ends up slightly larger than the original Google thumbtacks).
One annoying thing remains....the picture isn't resized in the pushpin selection display, so it's, you know, super small and you can't really see what it has on it, so if you wanted to give a selection of several pushpins, your users wouldn't be able to really tell them apart.
The cool thing is, when the square cursor comes up with my custom pushpins, it's centered on the coordinates. When the cursor comes up over Google's standard pushpins, it centers over the image. Soooooo, I'm guessing they hacked Google Earth to recognize and offset the image when it's one of theirs....Lame. Why not designate a pixel with a bizarre color like dabeef? If there's more than one pixel with that color or no pixels with that color, it punts and centers the image. If anyone cares to have a certain spot be the mark point, I'm sure they wouldn't mind changing any pixels that actually have the color dabeef to something like dabeee (still a lovely light purple). Anyway, end of rant....if someone knows of anysuch easter eggs for designating the mark point of a custom pushpin, that'd be swell. (and yeah, I've spent way too much time geeking out on this :( ).
jerpat
06-12-2008, 04:01 PM
OK, so, duh....you can scale up the smaller images too to make them roughly the same size as the regular images...but still they show up super tiny on the selection screen :(
jerpat
06-12-2008, 08:53 PM
You can use a hotSpot inside of an icon tag.
<hotSpot x="0.5" y="0.5" xunits="fraction" yunits="fraction">
Specifies the position within the Icon that is "anchored" to the <Point> specified in the Placemark. The x and y values can be specified in three different ways: as pixels ("pixels"), as fractions of the icon ("fraction"), or as inset pixels ("insetPixels"), which is an offset in pixels from the upper right corner of the icon. The x and y positions can be specified in different ways—for example, x can be in pixels and y can be a fraction. The origin of the coordinate system is in the lower left corner of the icon.
* x - Either the number of pixels, a fractional component of the icon, or a pixel inset indicating the x component of a point on the icon.
* y - Either the number of pixels, a fractional component of the icon, or a pixel inset indicating the y component of a point on the icon.
* xunits - Units in which the x value is specified. A value of fraction indicates the x value is a fraction of the icon. A value of pixels indicates the x value in pixels. A value of insetPixels indicates the indent from the right edge of the icon.
* yunits - Units in which the y value is specified. A value of fraction indicates the y value is a fraction of the icon. A value of pixels indicates the y value in pixels. A value of insetPixels indicates the indent from the top edge of the icon.
Appletom
06-12-2008, 09:32 PM
Good stuff jerpat. I tried last night to figure this out. I got nowhere and was going to maybe find time this weekend to dig.
jerpat
06-13-2008, 07:56 AM
The hotSpot goes in an IconStyle tag, not an Icon Tag.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.