Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Need to limit GeoMashup zoom WordPress

  • SOLVED

I'm using the GeoMashup plugin, but I need to hide the addresses of people's locations -- I just want to show their general location.

So I either need the markers to disappear when the map is zoomed in to a certain level, or I need to limit the zoom.

I've messed around with different short codes from the GeoMashup codex, but can't get anything to work for me.

Using Google v3 api and everything else with GeoMashup is working correctly.

Thanks!

Answers (1)

2015-03-17

Dylan Kuhn answers:

If you set up the [[LINK href="https://code.google.com/p/wordpress-geo-mashup/wiki/JavaScriptApi"]]Geo Mashup custom plugin[[/LINK]], you could put something like this in a custom-googlev3.js file:



GeoMashup.addAction( 'newMap', function( properties, mxn ) {
mxn.getMap().setOptions( { maxZoom: 10 } );
} );



That should limit the zoom level, but you should be aware that a user could still view the source of the map and find exact coordinates for the markers.


Kyler Boudreau comments:

Dylan - Thanks for responding.

Where would I place that js file? I'm used to server administration and front end/CSS coding, but get me into java script stuff and I'm lost.

Also, would there we a way to just force markers to not join if they're the same? The whole reason I'm taking street address info from people is because if they're in the same city and zip, the map locators pile them all together. I need them to be separate bubbles.

Your plugin rocks btw. I'm using it on two decent sized sites -- works awesome.


Dylan Kuhn comments:

The geo mashup custom plugin will create the directory plugins/geo-mashup-custom. Add the custom-googlev3.js file in there. There are more details about this here:

https://code.google.com/p/wordpress-geo-mashup/wiki/JavaScriptApi

Geo Mashup joins co-located markers because if you don't, only the top one is clickable. There isn't an option to disable this. The only option I can think of would be to do some javascript development using the multiObjectMarker action to undo Geo Mashup's handling and do something else instead.

http://code.cyberhobo.net/jsdoc/geo-mashup-1.8/symbols/GeoMashup.html#event:multiObjectMarker

Thanks for supporting Geo Mashup!