Using JavaScript API to customize embedded map

24 views
Skip to first unread message

Kate Chapman

unread,
Jan 26, 2011, 10:41:17 AM1/26/11
to GeoIQ Developer
I'm cross posting this from GetSatisfaction:
http://getsatisfaction.com/geocommons/topics/using_javascript_api_to_customize_embedded_map

I'm trying to use the JavaScript API (http://geocommons.com/help/
Javascript...) to customize the way my map is embedded on my site.

Here is my original map code:

#maker_map_47635 {width: 100%; height: 400px;}


View full map

I want to add:

mymap.showControl("Layers", false);
mymap.showControl("Zoom", false);

Because I do not want the Layers box to be open by default, no do I
want the zoom to show.

I'm new to JavaScript so I'm not sure if I'm correct by simply pasting
those two strings in between the tags... is there something else I am
supposed to do to the original embed code?

Kate Chapman

unread,
Jan 26, 2011, 2:30:30 PM1/26/11
to GeoIQ Developer
<style>#maker_map_42698 {width: 100%; height: 400px;}</style>
<div class="geocommons_map" id="maker_map_42698"></div><br/>
<a class="geocommons_map_link" id="maker_map_42698_link" href="http://
geocommons.com/maps/42698">View full map</a>
<script type="text/javascript" charset="utf-8" src="http://
geocommons.com/javascripts/f1.api.js"></script>
<script type="text/javascript" charset="utf-8">
maker_map_42698 = new F1.Maker.Map({map_id: "42698", dom_id:
"maker_map_42698"});
</script>

To remove the layers and zoom you just need to add to this line:

maker_map_42698 = new F1.Maker.Map({map_id: "42698", dom_id:
"maker_map_42698",uiLayers:false,uiZoom:false});

Hope this helps,

-Kate

On Jan 26, 10:41 am, Kate Chapman <k8chap...@gmail.com> wrote:
> I'm cross posting this from GetSatisfaction:http://getsatisfaction.com/geocommons/topics/using_javascript_api_to_...

Machiko Yasuda

unread,
Jan 26, 2011, 3:00:00 PM1/26/11
to GeoIQ Developer
Thank you very much Kate!
Reply all
Reply to author
Forward
0 new messages