Hi Pamela, Mike, or whoever else can help,
I'm using the google maps 1.9a API for flash within a Flex application
with custom markers (saw the post about 1.16 but according to the
changelog it doesn't fix my problems so I'm not gonna upgrade at the
moment). I'm having a few weird issues that I can't seem to resolve
was hoping someone could point me in the right direction, they're all
different so if they should be posted as separate requests, let me
know and I'll split them up and re-post.
The first problem is with the MarkerOptions.ALIGN_VERTICAL_CENTER, for
some reason if I set this as the iconAlignment on the MarkerOptions
object I'm using the markers don't line up correctly until after the
map is dragged. So I set all the options add the markers using
addOverlay and they show up on the map but about 30 pixels higher than
they should, the only thing I can think of is if the measure on my
custom markers isn't reporting the correct height initially, but it
appears that is not true, they report their height to be 24 before
they are added. If I remove the iconAlignment assignment then they
are in the correct place.
The second problem is with OverviewMapControl.setSize(point) which
throws an error whenever I try to use it... I'm making a call to set
the size as soon as the map is ready, just before adding the control
to the map.
private function mapReady(event:MapEvent):void
{
trace("Map ("+currentMap+") "+"running map ready");
overviewMapControl=new OverviewMapControl();
overviewMapControl.setSize(new Point(100,200));
overviewMapControl.setControlPosition(new ControlPosition
(ControlPosition.ANCHOR_TOP_RIGHT,10,10));
overviewMapControl.visible=false;
overviewMapControl.setStyle("showEffect",showEffect);
overviewMapControl.setStyle("hideEffect",hideEffect);
theMap.addControl(overviewMapControl);
this is the stacktrace from the flash debug plugin:
TypeError: Error #1009: Cannot access a property or method of a null
object reference.
at com.google.maps.controls::OverviewMapControl/size()
at com.google.maps.controls::OverviewMapControl/setSize()
at com.google.maps.wrappers::IOverviewMapControlWrapper/setSize()
at
mil.af.gcssdsrf.pic.client.view.components.alerts.alertMap::MapMain/
mapReady()[C:\Users\shusain\workspace\picProject\src\mil\af\gcssdsrf
\pic\client\view\components\alerts\alertMap\MapMain.mxml:79]
at
mil.af.gcssdsrf.pic.client.view.components.alerts.alertMap::MapMain/
__theMap_mapevent_mapready()[C:\Users\shusain\workspace\picProject\src
\mil\af\gcssdsrf\pic\client\view\components\alerts\alertMap
\MapMain.mxml:357]
at <anonymous>()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.2.0\frameworks
\projects\framework\src\mx\core\UIComponent.as:9298]
at com.google.maps.wrappers::BaseEventDispatcher/dispatchEvent()
at com.google.maps.wrappers::EventDispatcherWrapper/dispatchEvent()
at com.google.maps.core::MapImpl/configureMap()
at com.google.maps.wrappers::IMapWrapper/configureMap()
at com.google.maps::Map/onBootstrapInitComplete()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at com.google.maps::ClientBootstrap/createFactory()
at com.google.maps::ClientBootstrap/executeNextFrameCalls()
at flash.utils::Timer/_timerDispatch()
at flash.utils::Timer/tick()
Another issue is that I don't get a MouseDownOutside event from Flex
when I click on the map, we're drawing a drop down menu over the map
when the user clicks a button that sits at the top of the map when the
user clicks outside of the drop down, we want it to go away.
popUp.addEventListener(FlexMouseEvent.MOUSE_DOWN_OUTSIDE,
clickOutsidePopup)
That works if I click somewhere off the map and outside of the popUp
but doesn't work if I click on the map but outside the pop up. I'm
not sure how difficult this is to implement I would imagine it has to
traverse the display list and dispatch a
FlexMouseEvent.MOUSE_DOWN_OUTSIDE event on any object that is not
under the mouse point but there may be a simpler way to do this.
The last issue I have as of now is creating an overlay that goes
between two points on the globe, we want to show movements of parts as
a line from one location to another, this seems to work fine at most
zoom levels and is likely a problem with the way flash is drawing
rather than an error with how the map handles the overlay but perhaps
someone else has run into a similar issue. The line overlay I created
works fine except beyond a certain zoom level, it looks like a line
until I get to about zoom level 10 anything greater than that and the
line gets drawn as a shape rather than a thin line, I tried with both
lineTo and curveTo and got the same result, it seems like the problem
might be related to the fact that when the latLng coordinates are
translated to points on the pane the distance to the point has a very
large magnitude (>40000 pixels away). I've tested it with lines that
go between places that are close to one another and just zooming in
doesn't cause a problem it's only if the points are very far apart
that this becomes an issue, currently I'm just hiding the line beyond
a certain zoom level and although this will work it isn't an ideal
solution.
Thanks for anyone who can offer some advice, and if you see this
Pamela I've been reading a lot of you're responses to other problems
and you've helped resolve a lot of other issues, so even if you can't
help me on this one I appreciate all the other information you've
disseminated through this forum. And thanks to all the programmers
who are working on the API it's pretty sweet you guys/gals are doing a
great job of making this stuff simple for the rest of us :).
Shaun
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API For Flash" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-maps-api-for-flash?hl=en
-~----------~----~----~----~------~----~------~--~---