# MapMarker not binding

**URL:** <https://forums.fusetools.com/t/mapmarker-not-binding/6120>\
**Category:** Bug Reports\
**Created:** [March 29, 2016, 11:13pm UTC](https://forums.fusetools.com/t/mapmarker-not-binding/6120 "2016-03-29T23:13:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Patrick\_Jones](https://avatars.discourse-cdn.com/v4/letter/p/ecd19e/32.png) [@Patrick\_Jones](https://forums.fusetools.com/u/Patrick_Jones)\
**Post date:** [March 29, 2016, 11:13pm UTC](https://forums.fusetools.com/t/mapmarker-not-binding/6120/1 "2016-03-29T23:13:23Z")

</div>

When trying to set MapMarker location via an Observable, the lat/long values of the marker are set to 0,0 (off the coast of Africa) instead of the correct values. MapMarkers work fine when lat/long are explicitly defined in UX.

This works:

```auto
<MapMarker Latitude="30.217947" Longitude="-97.796168" Label="ME!"/>

```

but this does not:

```auto
<MapMarker Latitude="{markerLatitude}" Longitude="{markerLongitude}" Label="ME!"/>

```

In this example I have a function called `dropPin` which sets the `markerLatitude` and `markerLongitude` values to the current lat/long of the MapView.

```auto
<App Theme="Basic">
    <JavaScript>
        var Observable = require('FuseJS/Observable'),
            geo = require('FuseJS/GeoLocation'),
            latitude = Observable(),
            longitude = Observable(),
            accuracy = Observable(),
            markerLatitude = Observable(),
            markerLongitude = Observable(),
            zoom = Observable(500); // default zoom for ios
        var currentLat = 0,
            currentLong = 0;

        if (geo.location != null) {
            var location = geo.location;

            // save and set current location
            currentLat = latitude.value = location.latitude;
            currentLong = longitude.value = location.longitude;

            // set marker to current position
            markerLatitude.value = currentLat;
            markerLongitude.value = currentLong;

            debug_log('markerLat: ' + markerLatitude.value);
            debug_log('markerLong: ' + markerLongitude.value);

            accuracy.value = location.accuracy;
        }

        var resetView = function(args) {
            latitude.value = currentLat;
            longitude.value = currentLong;
            zoom.value = 500;
        }

        var dropPin = function(args) {
            // set marker to current map location
            markerLatitude.value = latitude.value;
            markerLongitude.value = longitude.value;

            debug_log(markerLatitude.value);
            debug_log(markerLongitude.value);
        }

        module.exports = {
            latitude:latitude,
            longitude:longitude,
            accuracy: accuracy,
            zoom: zoom,
            markerLatitude: markerLatitude,
            markerLongitude: markerLongitude,

            // functions
            resetView: resetView,
            dropPin: dropPin
        }
    </JavaScript>
    <DockPanel>
        <Panel>
            <NativeViewHost>
                <MapView Zoom="{zoom}" Latitude="{latitude}" Longitude="{longitude}">
                    <MapMarker Latitude="{markerLatitude}" Longitude="{markerLongitude}" Label="ME!"/>
                    <!-- <MapMarker Latitude="30.217947" Longitude="-97.796168" Label="ME!"/> -->
                </MapView>
            </NativeViewHost>
        </Panel>
        <StackPanel Dock="Bottom" Height="100">
            <Text Value="{latitude}" />
            <Text Value="{longitude}" />
            <StackPanel Orientation="Horizontal">
                <Button Text="Reset" Clicked="{resetView}" />
                <Button Text="Drop Pin" Clicked="{dropPin}" /> </StackPanel>
        </StackPanel>
    </DockPanel>
</App>

```

Thank you in advance!

---

<div class="post-metadata">

**Author:** ![Andreas\_Ronning](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/andreas_ronning/32/303_2.png) [@Andreas\_Ronning](https://forums.fusetools.com/u/Andreas_Ronning)\
**Post date:** [March 30, 2016, 11:12am UTC](https://forums.fusetools.com/t/mapmarker-not-binding/6120/2 "2016-03-30T11:12:13Z")

</div>

Hey Patrick, this exact thing was something we thought we fixed in the previous release. Which version are you on?

---

<div class="post-metadata">

**Author:** ![Patrick\_Jones](https://avatars.discourse-cdn.com/v4/letter/p/ecd19e/32.png) [@Patrick\_Jones](https://forums.fusetools.com/u/Patrick_Jones)\
**Post date:** [March 30, 2016, 5:04pm UTC](https://forums.fusetools.com/t/mapmarker-not-binding/6120/3 "2016-03-30T17:04:43Z")

</div>

I’m running 0.11 latest

---

<div class="post-metadata">

**Author:** ![Andreas\_Ronning](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/andreas_ronning/32/303_2.png) [@Andreas\_Ronning](https://forums.fusetools.com/u/Andreas_Ronning)\
**Post date:** [April 1, 2016, 12:55pm UTC](https://forums.fusetools.com/t/mapmarker-not-binding/6120/4 "2016-04-01T12:55:24Z")

</div>

Thanks Patrick, you’ve uncovered a nasty bug. A fix has been committed and will make it into a release soon.
