Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot modify default opening position on map #28

Open
davegallant opened this issue Dec 16, 2013 · 12 comments
Open

Cannot modify default opening position on map #28

davegallant opened this issue Dec 16, 2013 · 12 comments

Comments

@davegallant
Copy link

I've got the map embedded on iOS but cannot change the default location.

I tried changing (in MapKit.js)

var MapKit = function() {
this.options = {
height: 260,
diameter: 1000,
atBottom: true,
lat: 33.281468,
lon: -71.104446
};

the lat and lon to different values but the map always opens to the same location.

What am I doing wrong here?

Cheers,

@adellamano
Copy link

I modified the showMap function in MapKit.js:

showMap: function(success, error, options) {
for (var v in options) {
if (options.hasOwnProperty(v)) {
this.options[v] = options[v];
}
}
cordovaRef.exec(success, error, 'MapKit', 'showMap', [this.options]);
}

Then passed in a new options object with updated params and have it working successfully.

@tiendq
Copy link

tiendq commented Apr 10, 2014

Map is centered on the first call and being reused in next calls so it doesn't update to new location. Look at showMap method (Objective-C code) for detail. You need to update this method.

@imhotep
Copy link
Owner

imhotep commented Aug 30, 2014

Do you want to change it after it's loaded or is not loading with the right position ?

@jvence
Copy link

jvence commented Sep 17, 2014

Having same problem. Any resolution on this?

@imhotep
Copy link
Owner

imhotep commented Sep 19, 2014

@jvence what problem?

@jvence
Copy link

jvence commented Sep 23, 2014

After the map is drawn, if you redraw it second time with a new location, it ignores the new location (not pin location but the map center location) - See Tiendq's comment above

@jvence
Copy link

jvence commented Sep 25, 2014

We basically want to be able to change the location of the map after the first redraw. The first time it's drawn with the correct location but subsequent calls to draw a map, do not update the location and always uses the first location drawn.

@jvence
Copy link

jvence commented Oct 3, 2014

Anyone know how to fix this? (@imhotep please refrain from saying "fix what?" ;-) )

@imhotep
Copy link
Owner

imhotep commented Oct 3, 2014

I will take a look at it this week-end

@jvence
Copy link

jvence commented Oct 6, 2014

Thanks @imhotep let me know if we can help.

@jvence
Copy link

jvence commented Oct 7, 2014

@adellamano tried your solution to no avail. Can you elaborate more on how you got it working using the javascript solution you posted above?

@imhotep
Copy link
Owner

imhotep commented Oct 7, 2014

@jvence There is a pending pull request #56

Maybe you can give it a try? It only works for iOS though for now

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

No branches or pull requests

5 participants