Skip to content
This repository has been archived by the owner on Nov 30, 2018. It is now read-only.

[r1-dev] Marker only visible after changing initial coordinates #113

Closed
francisdb opened this issue Sep 4, 2013 · 6 comments
Closed

[r1-dev] Marker only visible after changing initial coordinates #113

francisdb opened this issue Sep 4, 2013 · 6 comments
Assignees
Labels

Comments

@francisdb
Copy link

In my controller I have the following code

$scope.searchLocation = {
        latitude: parseFloat(getParameterByName("latitude")),
        longitude: parseFloat(getParameterByName("longitude"))
};

And my template has this

<marker coords="searchLocation"></marker>

After loading the page the marker is not visible, only after changing the latitude and/or longitude values the marker appears.

Is this a bug or should I do this differently?

@nmccready
Copy link
Contributor

Looking into this now.

@ghost ghost assigned nmccready Sep 5, 2013
@nmccready
Copy link
Contributor

Confirmed bug

@nmccready
Copy link
Contributor

This is related to the chatter in this pull. Look at #83

If we are worried about trying to create items when the map is fully created.. we should use another mechanism >and not timeout. We should chain in a event handler on tilesloaded and do things after that.

Basically the map is not fully rendered yet and the marker's coords were set before the map was ready. You can fix this by setting your scope values when the tilesloaded event is hit. Use the events: {} option to have a handler on tilesloaded. This would work for the time being, and I will see if I can tie it into the directive as well. Originally there was a timeout to delay the marker rendering . However if you doing tons of markers this is really slow.

@nmccready
Copy link
Contributor

I think I will add the timeout back to the marker directive. IE if you need to use alot of markers use the markers directive.

@nmccready
Copy link
Contributor

Fixed with e5f287f

@francisdb
Copy link
Author

Just confirming this is fixed

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants