How to add subnodes to map creation action?

  • Hello,

    I am attempting to write an action to create a Google Map. Because I plan on using a number of Google Maps in my xml files, it seemed worthwhile to have one action to create the maps,

    So far I have written an action that will successfully create the Google Map plugin itself but have been unable to figure out how to add subnodes such as radar and zoomcontrol. I have tried any number of variations without success.

    Is this even close to the correct subnode syntax?


    Obviously, I am missing something very basic and important. What is the correct syntax for adding and defining subnode properties in an action?

    For spot subnodes should I create them as the other map subnodes or should I use the addspot() function?

    I have at least been able to write an action using addspot() to add map spots.

    Once I get this map action working, what is the best way to execute it? As part of onstart?

    I've searched the web site, release notes, and forum, but have not found any clues as to the correct subnode action syntax. I hope I have not missed something obvious....

    Any help getting me properly oriented will be much appreciated!

    Köszönöm,
    Joe

  • Hello,
    Much clearer now. I had an idea the solution might be like that but was unable to find out how to "link" the actions. I never would have guessed the solution. The release notes are a bit cryptic .

    Thanks
    Joe

  • Hello,
    I was premature in thinking I solved this before testing.

    Apologies if I am being totally clueless and dumb, so please bear with me, but I have had no success using actions to add googlemaps subnodes.

    To start, I tried to use an action to add a zoomcontrol to my Google Map. Here's the first part of my map plugin (to keep testing simple I am not using the make_map action of my first post):

    Code
    <plugin name="Gmap" url="%SWFPATH%/plugins/googlemaps.swf" 
    	keep="true"
    	visible="true" 
     	enabled="true" 
     	handcursor="false" 
    	capture="true" 
     	children="true"
     	zorder="0"
    [...]
    </plugin>

    Here's the action that I thought would add the zoomcontrol subnode to the map:

    The zorder=1 (Gmap zorder=0) and the parent is the Gmap plugin. I'm not to sure about the proper url and the necessity of updatecontrol().

    Whatever the case, this make_zoomcontrol action does not work. Can anyone tell me what I am doing wrong or show me a working example?

    Similarly, I am attempting to write another action to add the Google Map radar. Using this radar action, I am able to add the radar from radar.swf to my Google Map, but haven't had any success in adding the googlemaps.swf radar subnode. The attributes of the radar in googlemaps.swf are different from radar.swf, and I need to use the googlemaps radar.

    Other than the spot subnode, is it even possible to use actions to add the other googlemaps subnodes?

    Well, I am now very confused by all this....
    Joe

  • the zoomcontrol is not an external plugin. zoomcontrol is built into gmaps do not need to create a plugin for that. just position it where you want it. the radar is external and would need to be created using the same idea as you are trying for the zooomcontrols.

    if i wanted to use radar i would add this.

    Code
    <plugin name="radar" url="../../core/plugins/radar.swf" zorder="13" Parent="maps" origin="lefttop" edge="center" visible="true"  x="75" y="140" width="80" height="80" keep="true" heading="30" blendmode="subtract" alpha=".5"/>

    radar might not work on a real time google map. the spots are set via lat and lon settings not X and Y. unless you can set the radar parent to the spot itself i have not tested that.

  • Hello,

    Thanks for the reply and taking the time to look at my problem. I understand what you are saying, but the problem I am trying to solve is somewhat different.

    It might be best to summarize what I would ideally like to accomplish:

    • Global.xml file --> Contains actions and other code common to all panorama xml files. In this file I want to place an action to create the googlemap along with actions to create googlemap subnodes such as zoomcontrol and googleradar.
    • Panorama.xml files --> There will be many (>100) of these for the various panorama locations. Here I would call the googlemap action with lat, lng, heading, zoom, etc. as parameters to create the localized googlemap.


    Because most of the googlemap xml will be the same for each panorama, I thought it would make sense and be more efficient to create actions to reuse this common xml. (Is there any Jedi xml trick to do this without actions?)

    Thus far, I have only been able to write an action to create the basic googlemap plugin without any of the subnodes.

    As for the various googlemap subnodes, I have found that it is only possible to create spot subnodes using the addspot() function.

    I now suspect that without functions similar to addspot() it is not possible to use an action to add any of the other googlemap subnodes.

    Perhaps Klaus might be willing to offer some enlightenment on this Quixotic quest

    Cheers,
    Joe

  • Hello,

    This whole thread is getting a bit confusing, I think. *sad*

    Yes, I have tried using include ....

    But, if have defined in the global.xml file a <plugin name="Gmap" [etc.]</plugin>, then all of the googlemaps parameters in my plugin are static and cannot be modified from the pano.xml file where I have the include.


    What do I do in the various pano.xml files if I want to change the lat, lng, or zoom for the googlemap?


    The only method I can see is to use an action ... and I don't see how I can create the googlemaps radar, zoomcontrol etc. via an action.

    Gaahh!! Am I dumb!?! Or what? *cursing* No, do not answer that....

    Just now a 1000W light bulb lit up in my mind and I realized what to do. Klaus, either you are very subtle in your programming or I am completely clueless at times. *g*

    So, the answer is: Yes, create a default googlmaps plugin (with no spots) in the global.xml file.

    In each of my pano.xml files I only need to write an action such as this:

    Code
    <action name="fill_map">
    	plugin[Gmap].addspot(test1, 45.394369, -121.69954, 94.4, true,);
    	plugin[Gmap].addspot(test2, 45.39768, -121.704531, 81.4, false, action(load_location, test2), showtext(Spot 2));
    	
    	plugin[Gmap].pantospot(test1);
    	plugin[Gmap].setzoom(12);
    	plugin[Gmap].updatespots();
    </action>


    Then I call this action as part of my show googlemap button plugin. Very simple and seems to work efficiently.

    This took me longer to get working because I originally had plugin[Gmap].resetspots(); as the first line in the action. This unexpectedly deleted the spots created by the action itself. It seems that this clean-up is done automatically when switching from one location to another?

    Now, if only ... double-clicking on the googlemap would zoom in as with a standard Google Map. *smile*

    Thank you for not revoking my license *whistling*
    Joe

  • Hi,

    It seems that this clean-up is done automatically when switching from one location to another?

    the spots itself will not be cleaned-up automatically normally,

    but when loading a new pano and the plugin don't have the - keep="true" attribute set,
    then the plugin will be removed,
    and when the new pano also includes the googlemaps plugin, then a new fresh plugin
    will be created,


    Now, if only ... double-clicking on the googlemap would zoom in as with a standard Google Map.

    sorry, double-clicking is currently not possible,
    (maybe in the next release)

    best regards,
    Klaus

  • Flash I ran into the same problem as you. I only want the position controls visible on my large map and not the small one. SO i need to adjust subnode settings like you needed. Rereading this i realized i was totally offbase on what you were asking. this should help i am about to start testing now.

    XML Interface / Access


    •the XML structure is mapped into a linear direct access structure:

    •the names of the nodes are joined together and seperated by a dot
    •the name of the attribute is also added and seperated by a dot
    •nodes which are defined more then once (like plugins, hotspot, ...) must have a "name" attribute for identification.
    •this name is used as index for direct access.
    syntax examples:
    node[name].attribute
    node[name].subnode.attribute
    node[name].subnode[subnodename].attribute

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!